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

Commit c91d8bc

Browse files
authored
v1.4.2
### Releases v1.4.2 1. Fix examples' bug not using saved WiFi Credentials after losing all WiFi connections. 2. Fix compiler warnings.
1 parent b7c7dfd commit c91d8bc

File tree

36 files changed

+897
-521
lines changed

36 files changed

+897
-521
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Please ensure to specify the following:
2929
Arduino IDE version: 1.8.13
3030
ESP8266 Core Version 2.7.4
3131
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.4.0-51-generic #56-Ubuntu SMP Mon Oct 5 14:28:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux xy-Inspiron-3593 5.4.0-60-generic #67-Ubuntu SMP Tue Jan 5 18:31:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
I encountered an endless loop while trying to connect to Local WiFi.

README.md

Lines changed: 73 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
* [Why do we need this ESPAsync_WiFiManager library](#why-do-we-need-this-async-espasync_wifimanager-library)
1515
* [Changelog](#changelog)
16+
* [Releases v1.4.2](#releases-v142)
1617
* [Releases v1.4.1](#releases-v141)
1718
* [Major Releases v1.4.0](#major-releases-v140)
1819
* [Releases v1.3.0](#releases-v130)
@@ -158,6 +159,11 @@ To appreciate the power of the [ESPAsyncWebServer](https://github.com/me-no-dev/
158159

159160
## Changelog
160161

162+
### Releases v1.4.2
163+
164+
1. Fix examples' bug not using saved WiFi Credentials after losing all WiFi connections.
165+
2. Fix compiler warnings.
166+
161167
### Releases v1.4.1
162168

163169
1. Fix bug.
@@ -236,7 +242,7 @@ Thanks to this [ESPAsync_WiFiManager library](https://github.com/khoih-prog/ESPA
236242
4. [`ESPAsyncWebServer v1.2.3+`](https://github.com/me-no-dev/ESPAsyncWebServer) for all ESP32/ESP8266-based boards.
237243
5. [`ESPAsyncTCP v1.2.2+`](https://github.com/me-no-dev/ESPAsyncTCP) for ESP8266-based boards.
238244
6. [`AsyncTCP v1.1.1+`](https://github.com/me-no-dev/AsyncTCP) for ESP32-based boards
239-
7. [`ESP_DoubleResetDetector v1.1.0+`](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). Use v1.1.0+ if using LittleFS for EP32.
245+
7. [`ESP_DoubleResetDetector v1.1.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). Use v1.1.0+ if using LittleFS for EP32.
240246
8. [`LittleFS_esp32 v1.0.5+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS.
241247

242248
---
@@ -1738,7 +1744,7 @@ void loop()
17381744
// is configuration portal requested?
17391745
if ((digitalRead(TRIGGER_PIN) == LOW) || (digitalRead(TRIGGER_PIN2) == LOW))
17401746
{
1741-
Serial.println("\nConfiguration portal requested.");
1747+
Serial.println(F("\nConfiguration portal requested."));
17421748
digitalWrite(LED_BUILTIN, LED_ON); // turn the LED on by making the voltage LOW to tell us we are in configuration mode.
17431749

17441750
//Local intialization. Once its business is done, there is no need to keep it around
@@ -1753,14 +1759,16 @@ void loop()
17531759

17541760
//set custom ip for portal
17551761
//ESPAsync_wifiManager.setAPStaticIPConfig(IPAddress(192, 168, 100, 1), IPAddress(192, 168, 100, 1), IPAddress(255, 255, 255, 0));
1756-
ESPAsync_wifiManager.setAPStaticIPConfig(WM_AP_IPconfig);
17571762

17581763
#if !USE_DHCP_IP
1759-
// Set (static IP, Gateway, Subnetmask, DNS1 and DNS2) or (IP, Gateway, Subnetmask). New in v1.0.5
1760-
// New in v1.4.0
1761-
ESPAsync_wifiManager.setSTAStaticIPConfig(WM_STA_IPconfig);
1762-
//////
1763-
#endif
1764+
#if USE_CONFIGURABLE_DNS
1765+
// Set static IP, Gateway, Subnetmask, DNS1 and DNS2. New in v1.0.5
1766+
ESPAsync_wifiManager.setSTAStaticIPConfig(stationIP, gatewayIP, netMask, dns1IP, dns2IP);
1767+
#else
1768+
// Set static IP, Gateway, Subnetmask, Use auto DNS1 and DNS2.
1769+
ESPAsync_wifiManager.setSTAStaticIPConfig(stationIP, gatewayIP, netMask);
1770+
#endif
1771+
#endif
17641772

17651773
// New from v1.1.1
17661774
#if USING_CORS_FEATURE
@@ -1769,30 +1777,46 @@ void loop()
17691777

17701778
//Check if there is stored WiFi router/password credentials.
17711779
//If not found, device will remain in configuration mode until switched off via webserver.
1772-
Serial.print("Opening configuration portal. ");
1780+
Serial.println(F("Opening configuration portal. "));
1781+
17731782
Router_SSID = ESPAsync_wifiManager.WiFi_SSID();
17741783
Router_Pass = ESPAsync_wifiManager.WiFi_Pass();
1775-
1784+
1785+
//Remove this line if you do not want to see WiFi password printed
1786+
Serial.println("ESP Self-Stored: SSID = " + Router_SSID + ", Pass = " + Router_Pass);
1787+
17761788
// From v1.1.0, Don't permit NULL password
17771789
if ( (Router_SSID != "") && (Router_Pass != "") )
17781790
{
1791+
LOGERROR3(F("* Add SSID = "), Router_SSID, F(", PW = "), Router_Pass);
1792+
wifiMulti.addAP(Router_SSID.c_str(), Router_Pass.c_str());
1793+
1794+
ESPAsync_wifiManager.setConfigPortalTimeout(120); //If no access point name has been previously entered disable timeout.
1795+
Serial.println(F("Got ESP Self-Stored Credentials. Timeout 120s for Config Portal"));
1796+
}
1797+
else if (loadConfigData())
1798+
{
17791799
ESPAsync_wifiManager.setConfigPortalTimeout(120); //If no access point name has been previously entered disable timeout.
1780-
Serial.println("Got stored Credentials. Timeout 120s");
1800+
Serial.println(F("Got stored Credentials. Timeout 120s for Config Portal"));
17811801
}
17821802
else
1783-
Serial.println("No stored Credentials. No timeout");
1803+
{
1804+
// Enter CP only if no stored SSID on flash and file
1805+
Serial.println(F("Open Config Portal without Timeout: No stored Credentials."));
1806+
initialConfig = true;
1807+
}
17841808

17851809
//Starts an access point
17861810
//and goes into a blocking loop awaiting configuration
17871811
if (!ESPAsync_wifiManager.startConfigPortal((const char *) ssid.c_str(), password))
17881812
{
1789-
Serial.println("Not connected to WiFi but continuing anyway.");
1813+
Serial.println(F("Not connected to WiFi but continuing anyway."));
17901814
}
17911815
else
17921816
{
17931817
//if you get here you have connected to the WiFi
1794-
Serial.println("connected...yeey :)");
1795-
Serial.print("Local IP: ");
1818+
Serial.println(F("connected...yeey :)"));
1819+
Serial.print(F("Local IP: "));
17961820
Serial.println(WiFi.localIP());
17971821
}
17981822

@@ -1826,11 +1850,6 @@ void loop()
18261850
}
18271851
}
18281852

1829-
// New in v1.4.0
1830-
ESPAsync_wifiManager.getSTAStaticIPConfig(WM_STA_IPconfig);
1831-
displayIPConfigStruct(WM_STA_IPconfig);
1832-
//////
1833-
18341853
saveConfigData();
18351854
}
18361855

@@ -1973,10 +1992,10 @@ ESPAsync_wifiManager.setRemoveDuplicateAPs(false);
19731992
#define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3
19741993

19751994
// Default is 30s, using 20s now
1976-
#define TIME_BETWEEN_MODAL_SCANS 20000
1995+
#define TIME_BETWEEN_MODAL_SCANS 20000UL
19771996

19781997
// Default is 60s, using 30s now
1979-
#define TIME_BETWEEN_MODELESS_SCANS 30000
1998+
#define TIME_BETWEEN_MODELESS_SCANS 30000UL
19801999

19812000
#include <FS.h>
19822001

@@ -2514,15 +2533,15 @@ void check_status()
25142533
}
25152534
}
25162535

2517-
void loadConfigData()
2536+
bool loadConfigData()
25182537
{
25192538
File file = FileFS.open(CONFIG_FILENAME, "r");
25202539
LOGERROR(F("LoadWiFiCfgFile "));
25212540

2522-
memset(&WM_config, sizeof(WM_config), 0);
2541+
memset(&WM_config, 0, sizeof(WM_config));
25232542

25242543
// New in v1.4.0
2525-
memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0);
2544+
memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig));
25262545
//////
25272546

25282547
if (file)
@@ -2539,10 +2558,14 @@ void loadConfigData()
25392558
// New in v1.4.0
25402559
displayIPConfigStruct(WM_STA_IPconfig);
25412560
//////
2561+
2562+
return true;
25422563
}
25432564
else
25442565
{
25452566
LOGERROR(F("failed"));
2567+
2568+
return false;
25462569
}
25472570
}
25482571

@@ -2997,7 +3020,7 @@ void setup()
29973020
Serial.print("\nStarting Async_ConfigOnDRD_FS_MQTT_Ptr using " + String(FS_Name));
29983021
Serial.println(" on " + String(ARDUINO_BOARD));
29993022
Serial.println(ESP_ASYNC_WIFIMANAGER_VERSION);
3000-
Serial.println("ESP_DoubleResetDetector Version " + String(ESP_DOUBLE_RESET_DETECTOR_VERSION));
3023+
Serial.println(ESP_DOUBLE_RESET_DETECTOR_VERSION);
30013024

30023025
Serial.setDebugOutput(false);
30033026

@@ -3116,8 +3139,8 @@ This is terminal debug output when running [Async_ConfigOnDRD_FS_MQTT_Ptr_Medium
31163139
31173140
```
31183141
Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Medium using LittleFS on ESP32_DEV
3119-
ESPAsync_WiFiManager v1.4.1
3120-
ESP_DoubleResetDetector Version v1.1.0
3142+
ESPAsync_WiFiManager v1.4.2
3143+
ESP_DoubleResetDetector v1.1.1
31213144
Config File not found
31223145
Can't read Config File, using default values
31233146
LittleFS Flag read = 0xd0d01234
@@ -3135,8 +3158,8 @@ Opening Configuration Portal. No timeout : DRD or No stored Credentials..
31353158
31363159
```
31373160
Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Medium using LittleFS on ESP32_DEV
3138-
ESPAsync_WiFiManager v1.4.1
3139-
ESP_DoubleResetDetector Version v1.1.0
3161+
ESPAsync_WiFiManager v1.4.2
3162+
ESP_DoubleResetDetector v1.1.1
31403163
Config File not found
31413164
Can't read Config File, using default values
31423165
LittleFS Flag read = 0xd0d04321
@@ -3223,8 +3246,8 @@ This is terminal debug output when running [Async_ConfigOnDRD_FS_MQTT_Ptr_Comple
32233246
32243247
```
32253248
Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Complex using LittleFS on ESP8266_NODEMCU
3226-
ESPAsync_WiFiManager v1.4.1
3227-
ESP_DoubleResetDetector Version v1.1.0
3249+
ESPAsync_WiFiManager v1.4.2
3250+
ESP_DoubleResetDetector Version v1.1.1
32283251
{"AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name","AIO_KEY_Label":"aio_key"}
32293252
Config File successfully parsed
32303253
LittleFS Flag read = 0xd0d04321
@@ -3263,8 +3286,8 @@ TWWWW WTWWW
32633286
32643287
```
32653288
Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Complex using LittleFS on ESP8266_NODEMCU
3266-
ESPAsync_WiFiManager v1.4.1
3267-
ESP_DoubleResetDetector Version v1.1.0
3289+
ESPAsync_WiFiManager v1.4.2
3290+
ESP_DoubleResetDetector Version v1.1.1
32683291
{"AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name","AIO_KEY_Label":"aio_key"}
32693292
Config File successfully parsed
32703293
LittleFS Flag read = 0xd0d01234
@@ -3353,8 +3376,8 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset](examples/
33533376
33543377
```cpp
33553378
Starting Async_ConfigOnDoubleReset with DoubleResetDetect using SPIFFS on ESP32_DEV
3356-
ESPAsync_WiFiManager v1.4.1
3357-
ESP_DoubleResetDetector Version v1.1.0
3379+
ESPAsync_WiFiManager v1.4.2
3380+
ESP_DoubleResetDetector v1.1.1
33583381
[WM] RFC925 Hostname = ConfigOnDoubleReset
33593382
[WM] setSTAStaticIPConfig for USE_CONFIGURABLE_DNS
33603383
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
@@ -3412,8 +3435,8 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset](examples/
34123435

34133436
```cpp
34143437
Starting Async_ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP8266_NODEMCU
3415-
ESPAsync_WiFiManager v1.4.1
3416-
ESP_DoubleResetDetector Version v1.1.0
3438+
ESPAsync_WiFiManager v1.4.2
3439+
ESP_DoubleResetDetector v1.1.1
34173440
[WM] RFC925 Hostname = ConfigOnDoubleReset
34183441
[WM] setSTAStaticIPConfig for USE_CONFIGURABLE_DNS
34193442
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
@@ -3472,8 +3495,8 @@ This is terminal debug output when running [Async_ESP_FSWebServer_DRD](examples/
34723495
34733496
```cpp
34743497
Starting Async_ESP_FSWebServer_DRD using LittleFS on ESP8266_NODEMCU
3475-
ESPAsync_WiFiManager v1.4.1
3476-
ESP_DoubleResetDetector Version v1.1.0
3498+
ESPAsync_WiFiManager v1.4.2
3499+
ESP_DoubleResetDetector v1.1.1
34773500
Opening / directory
34783501
FS File: CanadaFlag_1.png, size: 40.25KB
34793502
FS File: CanadaFlag_2.png, size: 8.12KB
@@ -3550,8 +3573,8 @@ This is terminal debug output when running [Async_ESP32_FSWebServer_DRD](example
35503573

35513574
```
35523575
Starting Async_ESP32_FSWebServer_DRD using LittleFS on ESP32_DEV
3553-
ESPAsync_WiFiManager v1.4.1
3554-
ESP_DoubleResetDetector Version v1.1.0
3576+
ESPAsync_WiFiManager v1.4.2
3577+
ESP_DoubleResetDetector v1.1.1
35553578
FS File: /CanadaFlag_1.png, size: 40.25KB
35563579
FS File: /CanadaFlag_2.png, size: 8.12KB
35573580
FS File: /CanadaFlag_3.jpg, size: 10.89KB
@@ -3690,6 +3713,11 @@ Submit issues to: [ESPAsync_WiFiManager issues](https://github.com/khoih-prog/ES
36903713

36913714
## Releases
36923715

3716+
### Releases v1.4.2
3717+
3718+
1. Fix examples' bug not using saved WiFi Credentials after losing all WiFi connections.
3719+
2. Fix compiler warnings.
3720+
36933721
### Releases v1.4.1
36943722

36953723
1. Fix bug.
@@ -3763,6 +3791,7 @@ to use the better **asynchronous** [ESPAsyncWebServer](https://github.com/me-no-
37633791
6. Thanks to [Vague Rabbit](https://github.com/thewhiterabbit) for requesting, collarborating in creating the [**HOWTO Add Dynamic Parameters**](#howto-add-dynamic-parameters).
37643792
7. Thanks to [krupis](https://github.com/krupis) for reporting [ESP32 static IP not saved after restarting the device](https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/19) bug which is fixed in v1.4.0.
37653793
8. Thanks to [Roshan](https://github.com/solroshan) to report the issue in [Error esp_littlefs.c 'utime_p'](https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/28) to fix PIO error in using ESP32 LittleFS with old [`LittleFS_esp32 v1.0`](https://github.com/lorol/LITTLEFS)
3794+
9. Thanks to [Manuel Capilla](https://github.com/molillo) for reporting [ESP8266 Clear SSID and Pass](https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/33) bug which is fixed and leading to v1.4.2.
37663795

37673796
<table>
37683797
<tr>
@@ -3778,6 +3807,8 @@ to use the better **asynchronous** [ESPAsyncWebServer](https://github.com/me-no-
37783807
<td align="center"><a href="https://github.com/thewhiterabbit"><img src="https://github.com/thewhiterabbit.png" width="100px;" alt="thewhiterabbit"/><br /><sub><b>Vague Rabbit</b></sub></a><br /></td>
37793808
<td align="center"><a href="https://github.com/krupis"><img src="https://github.com/krupis.png" width="100px;" alt="krupis"/><br /><sub><b>krupis</b></sub></a><br /></td>
37803809
<td align="center"><a href="https://github.com/solroshan"><img src="https://github.com/solroshan.png" width="100px;" alt="solroshan"/><br /><sub><b>Roshan</b></sub></a><br /></td>
3810+
<td align="center"><a href="https://github.com/molillo"><img src="https://github.com/molillo.png" width="100px;" alt="molillo"/><br /><sub><b>
3811+
Manuel Capilla</b></sub></a><br /></td>
37813812
</tr>
37823813
</table>
37833814

0 commit comments

Comments
 (0)