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

Commit

Permalink
v1.12.0 to optionally display Credentials
Browse files Browse the repository at this point in the history
### Releases v1.12.0

1. Optionally display Credentials (SSIDs, PWDs) in Config Portal. Check [Populate portal wifi with saved credentials #91](#91)
2. Display `Credentials` Hint on Config Portal
3. Periodic code clean-up
  • Loading branch information
khoih-prog authored Oct 7, 2022
1 parent 676cc1b commit 18d682b
Show file tree
Hide file tree
Showing 30 changed files with 681 additions and 339 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p

### How to submit a bug report

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

* Arduino IDE version (e.g. 1.8.19) or Platform.io version
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.4)
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.5)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
Expand All @@ -29,10 +29,10 @@ Please ensure to specify the following:
Arduino IDE version: 1.8.19
ESP8266 Core Version 3.0.2
OS: Ubuntu 20.04 LTS
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
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
Context:
I encountered an endless loop while trying to connect to Local WiFi.
I encountered a crash when using this library
Steps to reproduce:
1. ...
Expand Down
Binary file modified Images/Configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
289 changes: 149 additions & 140 deletions README.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Releases v1.12.0](#releases-v1120)
* [Releases v1.11.0](#releases-v1110)
* [Releases v1.10.2](#releases-v1102)
* [Releases v1.10.1](#releases-v1101)
Expand Down Expand Up @@ -55,6 +56,12 @@

## Changelog

### Releases v1.12.0

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)
2. Display `Credentials` Hint on Config Portal
3. Periodic code clean-up

### Releases v1.11.0

1. Fix ESP32 chipID. Check [Help for storing variables in memory (non-volatile) #87](https://github.com/khoih-prog/ESP_WiFiManager/discussions/87#discussioncomment-3593028)
Expand Down
16 changes: 13 additions & 3 deletions examples/AutoConnect/AutoConnect.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.11.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1011000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.12.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1012000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
#define _WIFIMGR_LOGLEVEL_ 1

// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false

//Ported to ESP32
#ifdef ESP32
Expand Down Expand Up @@ -781,6 +785,12 @@ void setup()

initialConfig = true;

#if DISPLAY_STORED_CREDENTIALS_IN_CP
// New. Update Credentials, got from loadConfigData(), to display on CP
ESP_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
#endif

// Starts an access point
//if (!ESP_wifiManager.startConfigPortal((const char *) ssid.c_str(), password))
if ( !ESP_wifiManager.startConfigPortal(AP_SSID.c_str(), AP_PASS.c_str()) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.11.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1011000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.12.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1012000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
#define _WIFIMGR_LOGLEVEL_ 1

// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false

#include <FS.h>

Expand Down Expand Up @@ -1008,6 +1012,12 @@ void setup()
Serial.print(F(", PWD = "));
Serial.println(AP_PASS);

#if DISPLAY_STORED_CREDENTIALS_IN_CP
// New. Update Credentials, got from loadConfigData(), to display on CP
ESP_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
#endif

// Starts an access point
//if (!ESP_wifiManager.startConfigPortal((const char *) ssid.c_str(), password))
if ( !ESP_wifiManager.startConfigPortal(AP_SSID.c_str(), AP_PASS.c_str()) )
Expand Down
16 changes: 13 additions & 3 deletions examples/AutoConnectWithFeedback/AutoConnectWithFeedback.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.11.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1011000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.12.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1012000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
#define _WIFIMGR_LOGLEVEL_ 1

// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false

//Ported to ESP32
#ifdef ESP32
Expand Down Expand Up @@ -790,6 +794,12 @@ void setup()
Serial.print(F(", PWD = "));
Serial.println(AP_PASS);

#if DISPLAY_STORED_CREDENTIALS_IN_CP
// New. Update Credentials, got from loadConfigData(), to display on CP
ESP_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
#endif

// Starts an access point
//if (!ESP_wifiManager.startConfigPortal((const char *) ssid.c_str(), password))
if ( !ESP_wifiManager.startConfigPortal(AP_SSID.c_str(), AP_PASS.c_str()) )
Expand Down
16 changes: 13 additions & 3 deletions examples/AutoConnectWithFeedbackLED/AutoConnectWithFeedbackLED.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.11.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1011000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.12.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1012000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
#define _WIFIMGR_LOGLEVEL_ 1

// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false

#include <FS.h>

Expand Down Expand Up @@ -821,6 +825,12 @@ void setup()
Serial.print(F(", PWD = "));
Serial.println(AP_PASS);

#if DISPLAY_STORED_CREDENTIALS_IN_CP
// New. Update Credentials, got from loadConfigData(), to display on CP
ESP_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
#endif

// Starts an access point
//if (!ESP_wifiManager.startConfigPortal((const char *) ssid.c_str(), password))
if ( !ESP_wifiManager.startConfigPortal(AP_SSID.c_str(), AP_PASS.c_str()) )
Expand Down
18 changes: 15 additions & 3 deletions examples/ConfigOnDRD_FS_MQTT_Ptr/ConfigOnDRD_FS_MQTT_Ptr.ino
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.11.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1011000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.12.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1012000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 4
#define _WIFIMGR_LOGLEVEL_ 1

// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false

#include <Arduino.h> // for button
#include <OneButton.h> // for button
Expand Down Expand Up @@ -967,6 +971,12 @@ void wifi_manager()
Serial.print(ssid);
Serial.print(F(", PWD = "));
Serial.println(password);

#if DISPLAY_STORED_CREDENTIALS_IN_CP
// New. Update Credentials, got from loadConfigData(), to display on CP
ESP_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
#endif

if (!ESP_wifiManager.startConfigPortal((const char *) ssid.c_str(), password.c_str()))
{
Expand Down Expand Up @@ -1338,6 +1348,8 @@ void setup()

if (initialConfig)
{
loadConfigData();

wifi_manager();
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.11.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1011000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.12.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1012000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
#define _WIFIMGR_LOGLEVEL_ 1

// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false

// Default is 30s, using 20s now
#define TIME_BETWEEN_MODAL_SCANS 20000UL
Expand Down Expand Up @@ -1021,6 +1025,12 @@ void wifi_manager()
Serial.print(F(", PWD = "));
Serial.println(password);

#if DISPLAY_STORED_CREDENTIALS_IN_CP
// New. Update Credentials, got from loadConfigData(), to display on CP
ESP_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
#endif

if (!ESP_wifiManager.startConfigPortal((const char *) ssid.c_str(), password.c_str()))
{
Serial.println(F("Not connected to WiFi but continuing anyway."));
Expand Down Expand Up @@ -1380,6 +1390,8 @@ void setup()

if (initialConfig)
{
loadConfigData();

wifi_manager();
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.11.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1011000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.12.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1012000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
#define _WIFIMGR_LOGLEVEL_ 1

// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false

// Default is 30s, using 20s now
#define TIME_BETWEEN_MODAL_SCANS 20000UL
Expand Down Expand Up @@ -1010,6 +1014,12 @@ void wifi_manager()
Serial.print(F(", PWD = "));
Serial.println(password);

#if DISPLAY_STORED_CREDENTIALS_IN_CP
// New. Update Credentials, got from loadConfigData(), to display on CP
ESP_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
#endif

if (!ESP_wifiManager.startConfigPortal((const char *) ssid.c_str(), password.c_str()))
{
Serial.println(F("Not connected to WiFi but continuing anyway."));
Expand Down Expand Up @@ -1369,6 +1379,8 @@ void setup()

if (initialConfig)
{
loadConfigData();

wifi_manager();
}
else
Expand Down
16 changes: 13 additions & 3 deletions examples/ConfigOnDoubleReset/ConfigOnDoubleReset.ino
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.11.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1011000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.12.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1012000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
#define _WIFIMGR_LOGLEVEL_ 1

// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false

#include <FS.h>

Expand Down Expand Up @@ -889,6 +893,12 @@ void setup()
//switched off via webserver or device is restarted.
//ESP_wifiManager.setConfigPortalTimeout(600);

#if DISPLAY_STORED_CREDENTIALS_IN_CP
// New. Update Credentials, got from loadConfigData(), to display on CP
ESP_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
#endif

// Starts an access point
if (!ESP_wifiManager.startConfigPortal((const char *) ssid.c_str(), (const char *) password.c_str()))
Serial.println(F("Not connected to WiFi but continuing anyway."));
Expand Down
17 changes: 15 additions & 2 deletions examples/ConfigOnDoubleReset_Multi/ConfigOnDoubleReset_Multi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,15 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.11.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1011000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.12.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1012000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 1

// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false

// These definitions must be placed before #include <ESPAsync_WiFiManager.h>
#include "ConfigOnDoubleReset_Multi.h"
Expand Down Expand Up @@ -246,6 +253,12 @@ void setup()
//switched off via webserver or device is restarted.
//ESP_wifiManager.setConfigPortalTimeout(600);

#if DISPLAY_STORED_CREDENTIALS_IN_CP
// New. Update Credentials, got from loadConfigData(), to display on CP
ESP_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
#endif

// Starts an access point
if (!ESP_wifiManager.startConfigPortal((const char *) ssid.c_str(), (const char *) password.c_str()))
Serial.println(F("Not connected to WiFi but continuing anyway."));
Expand Down
16 changes: 13 additions & 3 deletions examples/ConfigOnStartup/ConfigOnStartup.ino
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@
#error This code is intended to run only on the ESP8266 and ESP32 boards ! Please check your Tools->Board setting.
#endif

#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.11.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1011000
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.12.0"
#define ESP_WIFIMANAGER_VERSION_MIN 1012000

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _WIFIMGR_LOGLEVEL_ 3
#define _WIFIMGR_LOGLEVEL_ 1

// To not display stored SSIDs and PWDs on Config Portal, select false. Default is true
// Even the stored Credentials are not display, just leave them all blank to reconnect and reuse the stored Credentials
//#define DISPLAY_STORED_CREDENTIALS_IN_CP false

//For ESP32, To use ESP32 Dev Module, QIO, Flash 4MB/80MHz, Upload 921600

Expand Down Expand Up @@ -804,6 +808,12 @@ void setup()
Serial.println(password);

digitalWrite(PIN_LED, LED_ON); // turn the LED on by making the voltage LOW to tell us we are in configuration mode.

#if DISPLAY_STORED_CREDENTIALS_IN_CP
// New. Update Credentials, got from loadConfigData(), to display on CP
ESP_wifiManager.setCredentials(WM_config.WiFi_Creds[0].wifi_ssid, WM_config.WiFi_Creds[0].wifi_pw,
WM_config.WiFi_Creds[1].wifi_ssid, WM_config.WiFi_Creds[1].wifi_pw);
#endif

// Starts an access point
if (!ESP_wifiManager.startConfigPortal((const char *) ssid.c_str(), password.c_str()))
Expand Down
Loading

0 comments on commit 18d682b

Please sign in to comment.