Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 19ff3b7

Browse files
authored
v1.6.0 to autodetect ESP32 core version
### Release v1.6.0 1. Auto detect ESP32 core and use either built-in LittleFS or LITTLEFS library. 2. Fix bug returning IP `255.255.255.255` in core v2.0.0+ when using `hostname`
1 parent 4f08134 commit 19ff3b7

File tree

8 files changed

+117
-56
lines changed

8 files changed

+117
-56
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.16) or Platform.io version
18-
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.0)
18+
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.1)
1919
* Contextual information (e.g. what you were trying to achieve)
2020
* Simplest possible steps to reproduce
2121
* Anything that might be relevant in your opinion, such as:
@@ -29,7 +29,7 @@ Please ensure to specify the following:
2929
Arduino IDE version: 1.8.16
3030
ESP8266 Core Version 3.0.2
3131
OS: Ubuntu 20.04 LTS
32-
Linux Inspiron 5.4.0-86-generic #97-Ubuntu SMP Fri Sep 17 19:19:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux Inspiron 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
The board couldn't autoreconnect to Local Blynk Server after router power recycling.

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ This [**ESP_WiFiManager_Lite** library](https://github.com/khoih-prog/ESP_WiFiMa
139139
## Prerequisites
140140

141141
1. [`Arduino IDE 1.8.16+` for Arduino](https://www.arduino.cc/en/Main/Software)
142-
2. [`ESP32 Core 2.0.0+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/)
142+
2. [`ESP32 Core 2.0.1+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/)
143143
3. [`ESP8266 Core 3.0.2+`](https://github.com/esp8266/Arduino) for ESP8266-based boards. [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/). SPIFFS is deprecated from ESP8266 core 2.7.1+, to use LittleFS.
144-
4. [`ESP_DoubleResetDetector v1.1.2+`](https://github.com/khoih-prog/ESP_DoubleResetDetector) if using DRD feature. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_DoubleResetDetector.svg?)](https://www.ardu-badge.com/ESP_DoubleResetDetector).
145-
5. [`ESP_MultiResetDetector v1.1.2+`](https://github.com/khoih-prog/ESP_MultiResetDetector) if using MRD feature. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_MultiResetDetector.svg?)](https://www.ardu-badge.com/ESP_MultiResetDetector).
146-
6. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32). **Notice**: This [`LittleFS_esp32 library`](https://github.com/lorol/LITTLEFS) has been integrated to Arduino [esp32 core v1.0.6](https://github.com/espressif/arduino-esp32/tree/master/libraries/LITTLEFS).
144+
4. [`ESP_DoubleResetDetector v1.2.1+`](https://github.com/khoih-prog/ESP_DoubleResetDetector) if using DRD feature. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_DoubleResetDetector.svg?)](https://www.ardu-badge.com/ESP_DoubleResetDetector).
145+
5. [`ESP_MultiResetDetector v1.2.1+`](https://github.com/khoih-prog/ESP_MultiResetDetector) if using MRD feature. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_MultiResetDetector.svg?)](https://www.ardu-badge.com/ESP_MultiResetDetector).
146+
6. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS with ESP32 core v1.0.4-. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32). **Notice**: This [`LittleFS_esp32 library`](https://github.com/lorol/LITTLEFS) has been integrated to Arduino [ESP32 core v1.0.6+](https://github.com/espressif/arduino-esp32/tree/master/libraries/LITTLEFS) and you don't need to install it if using ESP32 core v1.0.6+
147147

148148
---
149149

@@ -1171,8 +1171,8 @@ This is the terminal output when running [**ESP_WiFi**](examples/ESP_WiFi) examp
11711171

11721172
```
11731173
Starting ESP_WiFi using LittleFS on ESP32_DEV
1174-
ESP_WiFiManager_Lite v1.5.1
1175-
ESP_MultiResetDetector v1.1.2
1174+
ESP_WiFiManager_Lite v1.6.0
1175+
ESP_MultiResetDetector v1.2.1
11761176
LittleFS Flag read = 0xFFFC0003
11771177
multiResetDetectorFlag = 0xFFFC0003
11781178
lowerBytes = 0x0003, upperBytes = 0x0003
@@ -1242,8 +1242,8 @@ FFFFFFFFF
12421242

12431243
```
12441244
Starting ESP_WiFi using LittleFS on ESP32_DEV
1245-
ESP_WiFiManager_Lite v1.5.1
1246-
ESP_MultiResetDetector v1.1.2
1245+
ESP_WiFiManager_Lite v1.6.0
1246+
ESP_MultiResetDetector v1.2.1
12471247
LittleFS Flag read = 0xFFFE0001
12481248
multiResetDetectorFlag = 0xFFFE0001
12491249
lowerBytes = 0x0001, upperBytes = 0x0001
@@ -1314,8 +1314,8 @@ This is the terminal output when running [**ESP_WiFi_MQTT**](examples/ESP_WiFi_M
13141314

13151315
```
13161316
Starting ESP_WiFi_MQTT using LittleFS on ESP8266_NODEMCU
1317-
ESP_WiFiManager_Lite v1.5.1
1318-
ESP_MultiResetDetector v1.1.2
1317+
ESP_WiFiManager_Lite v1.6.0
1318+
ESP_MultiResetDetector v1.2.1
13191319
LittleFS Flag read = 0xFFFE0001
13201320
multiResetDetectorFlag = 0xFFFE0001
13211321
lowerBytes = 0x0001, upperBytes = 0x0001
@@ -1389,8 +1389,8 @@ NNN
13891389
13901390
13911391
Starting ESP_WiFi_MQTT using LittleFS on ESP8266_NODEMCU
1392-
ESP_WiFiManager_Lite v1.5.1
1393-
ESP_MultiResetDetector v1.1.2
1392+
ESP_WiFiManager_Lite v1.6.0
1393+
ESP_MultiResetDetector v1.2.1
13941394
LittleFS Flag read = 0xFFFE0001
13951395
multiResetDetectorFlag = 0xFFFE0001
13961396
lowerBytes = 0x0001, upperBytes = 0x0001
@@ -1481,8 +1481,8 @@ This is the terminal output when running [**ESP_WiFi_MQTT**](examples/ESP_WiFi_M
14811481

14821482
```
14831483
Starting ESP_WiFi_MQTT using LittleFS on ESP32S2_DEV
1484-
ESP_WiFiManager_Lite v1.5.1
1485-
ESP_MultiResetDetector v1.1.2
1484+
ESP_WiFiManager_Lite v1.6.0
1485+
ESP_MultiResetDetector v1.2.1
14861486
LittleFS Flag read = 0xFFFE0001
14871487
multiResetDetectorFlag = 0xFFFE0001
14881488
lowerBytes = 0x0001, upperBytes = 0x0001
@@ -1594,8 +1594,8 @@ entry 0x4004c190
15941594
15951595
15961596
Starting ESP_WiFi_MQTT using LittleFS on ESP32S2_DEV
1597-
ESP_WiFiManager_Lite v1.5.1
1598-
ESP_MultiResetDetector v1.1.2
1597+
ESP_WiFiManager_Lite v1.6.0
1598+
ESP_MultiResetDetector v1.2.1
15991599
LittleFS Flag read = 0xFFFE0001
16001600
multiResetDetectorFlag = 0xFFFE0001
16011601
lowerBytes = 0x0001, upperBytes = 0x0001
@@ -1696,8 +1696,8 @@ This is the terminal output when running [**ESP_WiFi_MQTT**](examples/ESP_WiFi_M
16961696

16971697
```
16981698
Starting ESP_WiFi_MQTT using LittleFS on ESP32S2_DEV
1699-
ESP_WiFiManager_Lite v1.5.1
1700-
ESP_MultiResetDetector v1.1.2
1699+
ESP_WiFiManager_Lite v1.6.0
1700+
ESP_MultiResetDetector v1.2.1
17011701
LittleFS Flag read = 0xFFFC0003
17021702
multiResetDetectorFlag = 0xFFFC0003
17031703
lowerBytes = 0x0003, upperBytes = 0x0003
@@ -1724,8 +1724,8 @@ NNNN NNNNN NNNNN NNNNN NN[WML] h:UpdLittleFS
17241724

17251725
```
17261726
Starting ESP_WiFi_MQTT using LittleFS on ESP32S2_DEV
1727-
ESP_WiFiManager_Lite v1.5.1
1728-
ESP_MultiResetDetector v1.1.2
1727+
ESP_WiFiManager_Lite v1.6.0
1728+
ESP_MultiResetDetector v1.2.1
17291729
LittleFS Flag read = 0xFFFE0001
17301730
multiResetDetectorFlag = 0xFFFE0001
17311731
lowerBytes = 0x0001, upperBytes = 0x0001
@@ -1780,8 +1780,8 @@ This is the terminal output when running [**ESP_WiFi**](examples/ESP_WiFi) examp
17801780

17811781
```
17821782
Starting ESP_WiFi_MQTT using LittleFS on ESP32_DEV
1783-
ESP_WiFiManager_Lite v1.5.1
1784-
ESP_MultiResetDetector v1.1.2
1783+
ESP_WiFiManager_Lite v1.6.0
1784+
ESP_MultiResetDetector v1.2.1
17851785
LittleFS Flag read = 0xFFFC0003
17861786
multiResetDetectorFlag = 0xFFFC0003
17871787
lowerBytes = 0x0003, upperBytes = 0x0003
@@ -1824,8 +1824,8 @@ N
18241824

18251825
```
18261826
Starting ESP_WiFi_MQTT using LittleFS on ESP32_DEV
1827-
ESP_WiFiManager_Lite v1.5.1
1828-
ESP_MultiResetDetector v1.1.2
1827+
ESP_WiFiManager_Lite v1.6.0
1828+
ESP_MultiResetDetector v1.2.1
18291829
LittleFS Flag read = 0xFFFE0001
18301830
multiResetDetectorFlag = 0xFFFE0001
18311831
lowerBytes = 0x0001, upperBytes = 0x0001
@@ -1934,6 +1934,7 @@ Submit issues to: [ESP_WiFiManager_Lite issues](https://github.com/khoih-prog/ES
19341934
22. Configurable **Customs HTML Headers**, including Customs Style, Customs Head Elements, CORS Header
19351935
23. Add support to **ESP32-C3 using EEPROM and SPIFFS**
19361936
24. Enable **scan of WiFi networks** for selection in Configuration Portal
1937+
25. Ready for ESP32 core v2.0.0+
19371938

19381939
---
19391940
---

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Release v1.6.0](#release-v160)
1516
* [Release v1.5.1](#release-v151)
1617
* [Major Release v1.5.0](#major-release-v150)
1718
* [Release v1.4.0](#release-v140)
@@ -25,6 +26,12 @@
2526

2627
## Changelog
2728

29+
### Release v1.6.0
30+
31+
1. Auto detect ESP32 core and use either built-in LittleFS or LITTLEFS library.
32+
2. Fix bug returning IP `255.255.255.255` in core v2.0.0+ when using `hostname`
33+
34+
2835
### Release v1.5.1
2936

3037
1. Update `platform.ini` and `library.json` to use original `khoih-prog` instead of `khoih.prog` after PIO fix

library.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESP_WiFiManager_Lite",
3-
"version": "1.5.1",
3+
"version": "1.6.0",
44
"keywords": "wifi, wi-fi, MultiWiFi, multi-wifi, WiFiManager, esp8266, esp32, esp32-s2, esp32-c3, Communication, iot, credentials, persistent, config-portal, DoubleReset, MultiReset, DoubleResetDetector, littlefs, spiffs, eeprom, light-weight",
55
"description": "Library to configure MultiWiFi/Credentials at runtime for ESP32 (including ESP32-S2 and ESP32-C3) and ESP8266 boards. You can also specify DHCP HostName, static AP and STA IP. Use much less memory compared to full-fledge WiFiManager. Config Portal will be auto-adjusted to match the number of dynamic custom parameters. Optional default Credentials to be autoloaded into Config Portal to use or change instead of manually input. Credentials are saved in LittleFS, SPIFFS or EEPROM. New powerful-yet-simple-to-use feature to enable adding dynamic custom parameters from sketch and input using the same Config Portal. Double or MultiDetectDetector as well as Virtual Switches feature permits entering Config Portal as requested. Configurable Customs HTML Headers, including Customs Style, Customs Head Elements, CORS Header.",
66
"authors":
@@ -27,13 +27,13 @@
2727
{
2828
"owner": "khoih-prog",
2929
"name": "ESP_DoubleResetDetector",
30-
"version": "^1.1.2",
30+
"version": "^1.2.1",
3131
"platforms": ["espressif8266", "espressif32"]
3232
},
3333
{
3434
"owner": "khoih-prog",
3535
"name": "ESP_MultiResetDetector",
36-
"version": "^1.1.2",
36+
"version": "^1.2.1",
3737
"platforms": ["espressif8266", "espressif32"]
3838
},
3939
{
@@ -45,5 +45,6 @@
4545
],
4646
"frameworks": "*",
4747
"platforms": ["espressif8266", "espressif32"],
48-
"examples": "examples/*/*/*.ino"
48+
"examples": "examples/*/*/*.ino",
49+
"headers": "ESP_WiFiManager_Lite.h"
4950
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP_WiFiManager_Lite
2-
version=1.5.1
2+
version=1.6.0
33
author=Khoi Hoang
44
maintainer=Khoi Hoang <[email protected]>
55
license=MIT

platformio/platformio.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ lib_compat_mode = strict
3232

3333
lib_deps =
3434
; PlatformIO 4.x
35-
ESP_DoubleResetDetector@>=1.1.2
36-
ESP_MultiResetDetector@>=1.1.2
37-
LittleFS_esp32@>=1.0.6
35+
; ESP_DoubleResetDetector@>=1.2.1
36+
; ESP_MultiResetDetector@>=1.2.1
37+
; LittleFS_esp32@>=1.0.6
3838
; PlatformIO 5.x
39-
; khoih-prog/ESP_DoubleResetDetector@>=1.1.2
40-
; khoih-prog/ESP_MultiResetDetector@>=1.1.2
41-
; lorol/LittleFS_esp32@>=1.0.6
39+
khoih-prog/ESP_DoubleResetDetector@>=1.2.1
40+
khoih-prog/ESP_MultiResetDetector@>=1.2.1
41+
lorol/LittleFS_esp32@>=1.0.6
4242

4343

4444
build_flags =

src/ESP_WiFiManager_Lite.h

Lines changed: 68 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/ESP_WiFiManager_Lite
1010
Licensed under MIT license
1111
12-
Version: 1.5.1
12+
Version: 1.6.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -20,6 +20,7 @@
2020
1.4.0 K Hoang 21/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM
2121
1.5.0 Michael H 24/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
2222
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
23+
1.6.0 K Hoang 26/11/2021 Auto detect ESP32 core and use either built-in LittleFS or LITTLEFS library. Fix bug.
2324
*****************************************************************************************************************************/
2425

2526
#pragma once
@@ -39,7 +40,7 @@
3940
#define USING_ESP32_C3 true
4041
#endif
4142

42-
#define ESP_WIFI_MANAGER_LITE_VERSION "ESP_WiFiManager_Lite v1.5.1"
43+
#define ESP_WIFI_MANAGER_LITE_VERSION "ESP_WiFiManager_Lite v1.6.0"
4344

4445
#ifdef ESP8266
4546

@@ -96,14 +97,26 @@
9697
// Use LittleFS
9798
#include "FS.h"
9899

99-
// The library will be depreciated after being merged to future major Arduino esp32 core release 2.x
100-
// At that time, just remove this library inclusion
101-
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
100+
// Check cores/esp32/esp_arduino_version.h and cores/esp32/core_version.h
101+
//#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
102+
#if ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 2) )
103+
#warning Using ESP32 Core 1.0.6 or 2.0.0+ and LittleFS in ESP_WiFiManager_Lite.h
104+
// The library has been merged into esp32 core from release 1.0.6
105+
#include <LittleFS.h>
106+
107+
FS* filesystem = &LittleFS;
108+
#define FileFS LittleFS
109+
#define FS_Name "LittleFS"
110+
#else
111+
#warning Using ESP32 Core 1.0.5- and LittleFS in ESP_WiFiManager_Lite.h. You must install LITTLEFS library
112+
// The library has been merged into esp32 core from release 1.0.6
113+
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
114+
115+
FS* filesystem = &LITTLEFS;
116+
#define FileFS LITTLEFS
117+
#define FS_Name "LittleFS"
118+
#endif
102119

103-
FS* filesystem = &LITTLEFS;
104-
#define FileFS LITTLEFS
105-
#define FS_Name "LittleFS"
106-
#warning Using LittleFS in ESP_WiFiManager_Lite.h
107120
#elif USE_SPIFFS
108121
#include "FS.h"
109122
#include <SPIFFS.h>
@@ -563,6 +576,7 @@ class ESP_WiFiManager_Lite
563576
{
564577
if ( strlen(ESP_WM_LITE_config.WiFi_Creds[i].wifi_pw) >= PASSWORD_MIN_LEN )
565578
{
579+
ESP_WML_LOGDEBUG5(F("bg: addAP : index="), i, F(", SSID="), ESP_WM_LITE_config.WiFi_Creds[i].wifi_ssid, F(", PWD="), ESP_WM_LITE_config.WiFi_Creds[i].wifi_pw);
566580
wifiMulti.addAP(ESP_WM_LITE_config.WiFi_Creds[i].wifi_ssid, ESP_WM_LITE_config.WiFi_Creds[i].wifi_pw);
567581
}
568582
else
@@ -740,13 +754,20 @@ class ESP_WiFiManager_Lite
740754
WiFi.hostname(RFC952_hostname);
741755
#else
742756

743-
// Still have bug in ESP32_S2. If using WiFi.setHostname() => WiFi.localIP() always = 255.255.255.255
757+
758+
// Check cores/esp32/esp_arduino_version.h and cores/esp32/core_version.h
759+
//#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
760+
#if ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 2) )
761+
WiFi.setHostname(RFC952_hostname);
762+
#else
763+
// Still have bug in ESP32_S2 for old core. If using WiFi.setHostname() => WiFi.localIP() always = 255.255.255.255
744764
if ( String(ARDUINO_BOARD) != "ESP32S2_DEV" )
745765
{
746766
// See https://github.com/espressif/arduino-esp32/issues/2537
747767
WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE);
748768
WiFi.setHostname(RFC952_hostname);
749769
}
770+
#endif
750771
#endif
751772
}
752773
}
@@ -1132,7 +1153,7 @@ class ESP_WiFiManager_Lite
11321153
void displayWiFiData()
11331154
{
11341155
ESP_WML_LOGERROR3(F("SSID="), WiFi.SSID(), F(",RSSI="), WiFi.RSSI());
1135-
ESP_WML_LOGERROR1(F("IP="), localIP() );
1156+
ESP_WML_LOGERROR1(F("IP="), WiFi.localIP() );
11361157
}
11371158

11381159
//////////////////////////////////////
@@ -2192,11 +2213,24 @@ class ESP_WiFiManager_Lite
21922213
#endif
21932214

21942215
//////////////////////////////////////////////
2195-
2216+
21962217
uint8_t connectMultiWiFi()
21972218
{
2198-
// For ESP8266, this better be 3000 to enable connect the 1st time
2199-
#define WIFI_MULTI_CONNECT_WAITING_MS 3000L
2219+
#if ESP32
2220+
// For ESP32, this better be 0 to shorten the connect time.
2221+
// For ESP32-S2/C3, must be > 500
2222+
#if ( USING_ESP32_S2 || USING_ESP32_C3 )
2223+
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 500L
2224+
#else
2225+
// For ESP32 core v1.0.6, must be >= 500
2226+
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 800L
2227+
#endif
2228+
#else
2229+
// For ESP8266, this better be 2200 to enable connect the 1st time
2230+
#define WIFI_MULTI_1ST_CONNECT_WAITING_MS 2200L
2231+
#endif
2232+
2233+
#define WIFI_MULTI_CONNECT_WAITING_MS 500L
22002234

22012235
uint8_t status;
22022236

@@ -2208,11 +2242,12 @@ class ESP_WiFiManager_Lite
22082242

22092243
int i = 0;
22102244
status = wifiMulti.run();
2211-
delay(WIFI_MULTI_CONNECT_WAITING_MS);
2245+
delay(WIFI_MULTI_1ST_CONNECT_WAITING_MS);
22122246

2213-
while ( ( i++ < 10 ) && ( status != WL_CONNECTED ) )
2247+
while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) )
22142248
{
2215-
status = wifiMulti.run();
2249+
//status = wifiMulti.run();
2250+
status = WiFi.status();
22162251

22172252
if ( status == WL_CONNECTED )
22182253
break;
@@ -2227,8 +2262,24 @@ class ESP_WiFiManager_Lite
22272262
ESP_WML_LOGWARN3(F("Channel="), WiFi.channel(), F(",IP="), WiFi.localIP() );
22282263
}
22292264
else
2265+
{
22302266
ESP_WML_LOGERROR(F("WiFi not connected"));
22312267

2268+
#if USING_MRD
2269+
// To avoid unnecessary MRD
2270+
mrd->loop();
2271+
#else
2272+
// To avoid unnecessary DRD
2273+
drd->loop();
2274+
#endif
2275+
2276+
#if ESP8266
2277+
ESP.reset();
2278+
#else
2279+
ESP.restart();
2280+
#endif
2281+
}
2282+
22322283
return status;
22332284
}
22342285

0 commit comments

Comments
 (0)