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

Commit 703b82e

Browse files
authored
v1.15.0 to optionally display Credentials
### Releases v1.15.0 1. Optionally display Credentials (SSIDs, PWDs) in Config Portal. Check [Populate portal wifi with saved credentials #91](khoih-prog/ESP_WiFiManager#91) and [Prepopulating the configuration with SSID and Password from stored file #115](#115) 2. Display `Credentials` Hint on Config Portal 3. Periodic code clean-up
1 parent d343abb commit 703b82e

File tree

30 files changed

+514
-187
lines changed

30 files changed

+514
-187
lines changed

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
2222

2323
### How to submit a bug report
2424

25-
Please ensure to specify the following:
25+
Please ensure to specify the following, or your post will be ignored and deleted:
2626

2727
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
28-
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.4)
28+
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.5)
2929
* Contextual information (e.g. what you were trying to achieve)
3030
* Simplest possible steps to reproduce
3131
* Anything that might be relevant in your opinion, such as:
@@ -39,10 +39,10 @@ Please ensure to specify the following:
3939
Arduino IDE version: 1.8.19
4040
ESP8266 Core Version 3.0.2
4141
OS: Ubuntu 20.04 LTS
42-
Linux xy-Inspiron-3593 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
42+
Linux xy-Inspiron-3593 5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:17:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
4343
4444
Context:
45-
I encountered an endless loop while trying to connect to Local WiFi.
45+
I encountered a crash when using this library
4646
4747
Steps to reproduce:
4848
1. ...

Images/Configuration.png

4.31 KB
Loading

changelog.md

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Releases v1.15.0](#releases-v1150)
1516
* [Releases v1.14.1](#releases-v1141)
1617
* [Releases v1.14.0](#releases-v1140)
1718
* [Releases v1.13.0](#releases-v1130)
@@ -53,6 +54,12 @@
5354

5455
## Changelog
5556

57+
### Releases v1.15.0
58+
59+
1. Optionally display Credentials (SSIDs, PWDs) in Config Portal. Check [Populate portal wifi with saved credentials #91](https://github.com/khoih-prog/ESP_WiFiManager/discussions/91) and [Prepopulating the configuration with SSID and Password from stored file #115](https://github.com/khoih-prog/ESPAsync_WiFiManager/discussions/115)
60+
2. Display `Credentials` Hint on Config Portal
61+
3. Periodic code clean-up
62+
5663
### Releases v1.14.1
5764

5865
1. Remove dependency on ESP_AsyncWebServer, ESPAsyncTCP and AsyncTCP in `library.properties`. Check ["no protocol" error #113](https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/113)"

examples/Async_AutoConnect/Async_AutoConnect.ino

+12-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
1919
#endif
2020

21-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.14.0"
22-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1014000
21+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
22+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000
2323

2424
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
2525
#define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3
2626

27+
// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
28+
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
29+
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false
30+
2731
//Ported to ESP32
2832
#ifdef ESP32
2933
#include <esp_wifi.h>
@@ -780,6 +784,12 @@ void setup()
780784
Serial.print(F(", PWD = "));
781785
Serial.println(AP_PASS);
782786

787+
#if DISPLAY_STORED_CREDENTIALS_IN_CP
788+
// New. Update Credentials, got from loadConfigData(), to display on CP
789+
ESPAsync_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
790+
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
791+
#endif
792+
783793
// Starts an access point
784794
//if (!ESPAsync_wifiManager.startConfigPortal((const char *) ssid.c_str(), password))
785795
if ( !ESPAsync_wifiManager.startConfigPortal(AP_SSID.c_str(), AP_PASS.c_str()) )

examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino

+12-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
2020
#endif
2121

22-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.14.0"
23-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1014000
22+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
23+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000
2424

2525
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
2626
#define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3
2727

28+
// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
29+
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
30+
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false
31+
2832
#include <FS.h>
2933

3034
//Ported to ESP32
@@ -1015,6 +1019,12 @@ void setup()
10151019
Serial.print(F(", PWD = "));
10161020
Serial.println(AP_PASS);
10171021

1022+
#if DISPLAY_STORED_CREDENTIALS_IN_CP
1023+
// New. Update Credentials, got from loadConfigData(), to display on CP
1024+
ESPAsync_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
1025+
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
1026+
#endif
1027+
10181028
// Starts an access point
10191029
//if (!ESPAsync_wifiManager.startConfigPortal((const char *) ssid.c_str(), password))
10201030
if ( !ESPAsync_wifiManager.startConfigPortal(AP_SSID.c_str(), AP_PASS.c_str()) )

examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino

+12-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
2020
#endif
2121

22-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.14.0"
23-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1014000
22+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
23+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000
2424

2525
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
2626
#define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3
2727

28+
// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
29+
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
30+
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false
31+
2832
#include <FS.h> //this needs to be first, or it all crashes and burns...
2933

3034
//For ESP32, To use ESP32 Dev Module, QIO, Flash 4MB/80MHz, Upload 921600
@@ -933,6 +937,12 @@ void setup()
933937
Serial.print(F(", PWD = "));
934938
Serial.println(AP_PASS);
935939

940+
#if DISPLAY_STORED_CREDENTIALS_IN_CP
941+
// New. Update Credentials, got from loadConfigData(), to display on CP
942+
ESPAsync_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
943+
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
944+
#endif
945+
936946
// Starts an access point
937947
//if (!ESPAsync_wifiManager.startConfigPortal((const char *) ssid.c_str(), password))
938948
if ( !ESPAsync_wifiManager.startConfigPortal(AP_SSID.c_str(), AP_PASS.c_str()) )

examples/Async_AutoConnectWithFeedback/Async_AutoConnectWithFeedback.ino

+12-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
1919
#endif
2020

21-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.14.0"
22-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1014000
21+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
22+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000
2323

2424
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
2525
#define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3
2626

27+
// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
28+
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
29+
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false
30+
2731
//Ported to ESP32
2832
#ifdef ESP32
2933
#include <esp_wifi.h>
@@ -796,6 +800,12 @@ void setup()
796800
Serial.print(F(", PWD = "));
797801
Serial.println(AP_PASS);
798802

803+
#if DISPLAY_STORED_CREDENTIALS_IN_CP
804+
// New. Update Credentials, got from loadConfigData(), to display on CP
805+
ESPAsync_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
806+
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
807+
#endif
808+
799809
// Starts an access point
800810
//if (!ESPAsync_wifiManager.startConfigPortal((const char *) ssid.c_str(), password))
801811
if ( !ESPAsync_wifiManager.startConfigPortal(AP_SSID.c_str(), AP_PASS.c_str()) )

examples/Async_AutoConnectWithFeedbackLED/Async_AutoConnectWithFeedbackLED.ino

+12-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
2020
#endif
2121

22-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.14.0"
23-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1014000
22+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
23+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000
2424

2525
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
2626
#define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3
2727

28+
// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
29+
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
30+
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false
31+
2832
//Ported to ESP32
2933
#ifdef ESP32
3034
#include <esp_wifi.h>
@@ -825,6 +829,12 @@ void setup()
825829
Serial.print(AP_SSID);
826830
Serial.print(F(", PWD = "));
827831
Serial.println(AP_PASS);
832+
833+
#if DISPLAY_STORED_CREDENTIALS_IN_CP
834+
// New. Update Credentials, got from loadConfigData(), to display on CP
835+
ESPAsync_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
836+
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
837+
#endif
828838

829839
// Starts an access point
830840
//if (!ESPAsync_wifiManager.startConfigPortal((const char *) ssid.c_str(), password))

examples/Async_ConfigOnDRD_FS_MQTT_Ptr/Async_ConfigOnDRD_FS_MQTT_Ptr.ino

+25-13
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@
3131
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
3232
#endif
3333

34-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.14.0"
35-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1014000
34+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
35+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000
3636

3737
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
3838
#define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3
3939

40+
// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
41+
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
42+
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false
43+
4044
#include <FS.h>
4145

4246
// Now support ArduinoJson 6.0.0+ ( tested with v6.15.2 to v6.16.1 )
@@ -966,6 +970,12 @@ void wifi_manager()
966970
Serial.print(F(", PWD = "));
967971
Serial.println(password);
968972

973+
#if DISPLAY_STORED_CREDENTIALS_IN_CP
974+
// New. Update Credentials, got from loadConfigData(), to display on CP
975+
ESPAsync_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
976+
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
977+
#endif
978+
969979
if (!ESPAsync_wifiManager.startConfigPortal((const char *) ssid.c_str(), password.c_str()))
970980
{
971981
Serial.println(F("Not connected to WiFi but continuing anyway."));
@@ -1336,6 +1346,8 @@ void setup()
13361346

13371347
if (initialConfig)
13381348
{
1349+
loadConfigData();
1350+
13391351
wifi_manager();
13401352
}
13411353
else
@@ -1347,21 +1359,21 @@ void setup()
13471359
if (loadConfigData())
13481360
{
13491361
#if USE_ESP_WIFIMANAGER_NTP
1350-
if ( strlen(WM_config.TZ_Name) > 0 )
1351-
{
1352-
LOGERROR3(F("Current TZ_Name ="), WM_config.TZ_Name, F(", TZ = "), WM_config.TZ);
1362+
if ( strlen(WM_config.TZ_Name) > 0 )
1363+
{
1364+
LOGERROR3(F("Current TZ_Name ="), WM_config.TZ_Name, F(", TZ = "), WM_config.TZ);
13531365

13541366
#if ESP8266
1355-
configTime(WM_config.TZ, "pool.ntp.org");
1367+
configTime(WM_config.TZ, "pool.ntp.org");
13561368
#else
1357-
//configTzTime(WM_config.TZ, "pool.ntp.org" );
1358-
configTzTime(WM_config.TZ, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org");
1369+
//configTzTime(WM_config.TZ, "pool.ntp.org" );
1370+
configTzTime(WM_config.TZ, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org");
13591371
#endif
1360-
}
1361-
else
1362-
{
1363-
Serial.println(F("Current Timezone is not set. Enter Config Portal to set."));
1364-
}
1372+
}
1373+
else
1374+
{
1375+
Serial.println(F("Current Timezone is not set. Enter Config Portal to set."));
1376+
}
13651377
#endif
13661378

13671379
for (uint8_t i = 0; i < NUM_WIFI_CREDENTIALS; i++)

examples/Async_ConfigOnDRD_FS_MQTT_Ptr_Complex/Async_ConfigOnDRD_FS_MQTT_Ptr_Complex.ino

+27-14
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@
3131
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
3232
#endif
3333

34-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.14.0"
35-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1014000
34+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
35+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000
3636

3737
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
38-
#define _ESPASYNC_WIFIMGR_LOGLEVEL_ 2
38+
#define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3
39+
40+
// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
41+
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
42+
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false
3943

4044
// Optional ms delay in ConfigPortal loop, if necessary. Using 0 if not necessary
4145
#define TIME_BETWEEN_CONFIG_PORTAL_LOOP 0L
@@ -1022,6 +1026,12 @@ void wifi_manager()
10221026
Serial.print(F(", PWD = "));
10231027
Serial.println(password);
10241028

1029+
#if DISPLAY_STORED_CREDENTIALS_IN_CP
1030+
// New. Update Credentials, got from loadConfigData(), to display on CP
1031+
ESPAsync_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
1032+
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
1033+
#endif
1034+
10251035
if (!ESPAsync_wifiManager.startConfigPortal((const char *) ssid.c_str(), password.c_str()))
10261036
{
10271037
Serial.println(F("Not connected to WiFi but continuing anyway."));
@@ -1382,8 +1392,11 @@ void setup()
13821392

13831393
if (initialConfig)
13841394
{
1395+
loadConfigData();
1396+
13851397
wifi_manager();
13861398
}
1399+
else
13871400
{
13881401
// Pretend CP is necessary as we have no AP Credentials
13891402
initialConfig = true;
@@ -1392,21 +1405,21 @@ void setup()
13921405
if (loadConfigData())
13931406
{
13941407
#if USE_ESP_WIFIMANAGER_NTP
1395-
if ( strlen(WM_config.TZ_Name) > 0 )
1396-
{
1397-
LOGERROR3(F("Current TZ_Name ="), WM_config.TZ_Name, F(", TZ = "), WM_config.TZ);
1408+
if ( strlen(WM_config.TZ_Name) > 0 )
1409+
{
1410+
LOGERROR3(F("Current TZ_Name ="), WM_config.TZ_Name, F(", TZ = "), WM_config.TZ);
13981411

13991412
#if ESP8266
1400-
configTime(WM_config.TZ, "pool.ntp.org");
1413+
configTime(WM_config.TZ, "pool.ntp.org");
14011414
#else
1402-
//configTzTime(WM_config.TZ, "pool.ntp.org" );
1403-
configTzTime(WM_config.TZ, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org");
1415+
//configTzTime(WM_config.TZ, "pool.ntp.org" );
1416+
configTzTime(WM_config.TZ, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org");
14041417
#endif
1405-
}
1406-
else
1407-
{
1408-
Serial.println(F("Current Timezone is not set. Enter Config Portal to set."));
1409-
}
1418+
}
1419+
else
1420+
{
1421+
Serial.println(F("Current Timezone is not set. Enter Config Portal to set."));
1422+
}
14101423
#endif
14111424

14121425
for (uint8_t i = 0; i < NUM_WIFI_CREDENTIALS; i++)

0 commit comments

Comments
 (0)