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

Commit 7ce7902

Browse files
authored
v1.5.0 to enable scan of WiFi networks
### Major Release v1.5.0 1. Enable scan of WiFi networks for selection in Configuration Portal. Check [PR for v1.3.0 - Enable scan of WiFi networks #10](khoih-prog/WiFiManager_NINA_Lite#10). Now you can select optional **SCAN_WIFI_NETWORKS**, **MANUAL_SSID_INPUT_ALLOWED** to be able to manually input SSID, not only from a scanned SSID lists and **MAX_SSID_IN_LIST** (from 2-6 for ESP8266-AT or 2-15 for other) 2. Minor enhancement to not display garbage when data is invalid
1 parent ce1e434 commit 7ce7902

File tree

11 files changed

+536
-31
lines changed

11 files changed

+536
-31
lines changed

README.md

Lines changed: 197 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* [Features](#features)
1616
* [Currently supported Boards](#currently-supported-boards)
1717
* [Changelog](#changelog)
18+
* [Major Release v1.5.0](#major-release-v150)
1819
* [Release v1.4.0](#release-v140)
1920
* [Release v1.3.0](#release-v130)
2021
* [Release v1.2.0](#release-v120)
@@ -59,6 +60,12 @@
5960
* [9. To use custom Head Elements](#9-to-use-custom-head-elements)
6061
* [10. To use CORS Header](#10-to-use-cors-header)
6162
* [11. To use and input only one set of WiFi SSID and PWD](#11-to-use-and-input-only-one-set-of-wifi-ssid-and-pwd)
63+
* [11.1 If you need to use and input only one set of WiFi SSID/PWD](#111-if-you-need-to-use-and-input-only-one-set-of-wifi-ssidpwd)
64+
* [11.2 If you need to use both sets of WiFi SSID/PWD](#112-if-you-need-to-use-both-sets-of-wifi-ssidpwd)
65+
* [12. To enable auto-scan of WiFi networks for selection in Configuration Portal](#12-to-enable-auto-scan-of-wifi-networks-for-selection-in-configuration-portal)
66+
* [12.1 Enable auto-scan of WiFi networks for selection in Configuration Portal](#121-enable-auto-scan-of-wifi-networks-for-selection-in-configuration-portal)
67+
* [12.2 Disable manually input SSIDs](#122-disable-manually-input-ssids)
68+
* [12.3 Select maximum number of SSIDs in the list](#123-select-maximum-number-of-ssids-in-the-list)
6269
* [Examples](#examples)
6370
* [ 1. ESP_WiFi](examples/ESP_WiFi)
6471
* [ 2. ESP_WiFi_MQTT](examples/ESP_WiFi_MQTT)
@@ -90,7 +97,10 @@
9097
* [3.3 Lost a WiFi and autoconnect to another WiFi AP](#33-lost-a-wifi-and-autoconnect-to-another-wifi-ap)
9198
* [4. ESP_WiFi_MQTT on ESP32S2_DEV to demo MultiResetDetector](#4-esp_wifi_mqtt-on-esp32s2_dev-to-demo-multiresetdetector)
9299
* [4.1 MultiResetDetected => Open Config Portal](#41-multiresetdetected--open-config-portal)
93-
* [4.2 Got valid Credentials from Config Portal then connected to WiFi](#42-got-valid-credentials-from-config-portal-then-connected-to-wifi)
100+
* [4.2 Got valid Credentials from Config Portal then connected to WiFi](#42-got-valid-credentials-from-config-portal-then-connected-to-wifi)
101+
* [5. ESP_WiFi_MQTT on ESP32_DEV to demo WiFi Scan](#5-esp_wifi_mqtt-on-esp32_dev-to-demo-wifi-scan)
102+
* [5.1 MRD/DRD => Open Config Portal](#51-mrddrd--open-config-portal)
103+
* [5.2 Config Data Saved => Connection to Adafruit MQTT](#52-config-data-saved--connection-to-adafruit-mqtt)
94104
* [Debug](#debug)
95105
* [Troubleshooting](#troubleshooting)
96106
* [Releases](#releases)
@@ -135,20 +145,28 @@ New recent features:
135145
- Control Config Portal from software or Virtual Switches
136146
- To permit autoreset after configurable timeout if DRD/MRD or non-persistent forced-CP
137147
- Use new ESP32 LittleFS features
148+
- **Scan WiFi networks** for selection in Configuration Portal
138149

139150

140151
#### Currently supported Boards
141152

142153
This [**ESP_WiFiManager_Lite** library](https://github.com/khoih-prog/ESP_WiFiManager_Lite) currently supports these following boards:
143154

144-
1. **ESP32 including ESP32-S2 (ESP32-S2 Saola, AI-Thinker ESP-12K, etc.)**
145-
2. **ESP8266**
155+
1. **ESP8266 and ESP32-based boards using EEPROM, SPIFFS or LittleFS**.
156+
2. **ESP32-S2 (ESP32-S2 Saola, AI-Thinker ESP-12K, etc.) using EEPROM, SPIFFS or LittleFS**.
157+
3. **ESP32-C3 (ARDUINO_ESP32C3_DEV) using EEPROM or SPIFFS**.
146158

147159
---
148160
---
149161

150162
## Changelog
151163

164+
### Major Release v1.5.0
165+
166+
1. Enable scan of WiFi networks for selection in Configuration Portal. Check [PR for v1.3.0 - Enable scan of WiFi networks #10](https://github.com/khoih-prog/WiFiManager_NINA_Lite/pull/10). Now you can select optional **SCAN_WIFI_NETWORKS**, **MANUAL_SSID_INPUT_ALLOWED** to be able to manually input SSID, not only from a scanned SSID lists and **MAX_SSID_IN_LIST** (from 2-6 for ESP8266-AT or 2-15 for other)
167+
2. Minor enhancement to not display garbage when data is invalid
168+
169+
152170
### Release v1.4.0
153171

154172
1. Add **LittleFS and SPIFFS** support to new **ESP32-S2** boards (**Arduino ESP32C3_DEV**). Check [HOWTO Install esp32 core for ESP32-S2 (Saola, AI-Thinker ESP-12K) and ESP32-C3 boards into Arduino IDE](#howto-install-esp32-core-for-esp32-s2-saola-ai-thinker-esp-12k-and-esp32-c3-boards-into-arduino-ide).
@@ -628,7 +646,7 @@ Once Credentials / WiFi network information is saved in the host non-volatile me
628646
629647
#### 11. To use and input only one set of WiFi SSID and PWD
630648
631-
#### If you need to use and input only one set of WiFi SSID/PWD.
649+
#### 11.1 If you need to use and input only one set of WiFi SSID/PWD
632650
633651
```
634652
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
@@ -637,14 +655,45 @@ Once Credentials / WiFi network information is saved in the host non-volatile me
637655
```
638656
But it's always advisable to use and input both sets for reliability.
639657
640-
#### If you need to use both sets of WiFi SSID/PWD
658+
#### 11.2 If you need to use both sets of WiFi SSID/PWD
641659
642660
```
643661
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
644662
// Default is false (if not defined) => must input 2 sets of SSID/PWD
645663
#define REQUIRE_ONE_SET_SSID_PW false
646664
```
647665
666+
#### 12. To enable auto-scan of WiFi networks for selection in Configuration Portal
667+
668+
#### 12.1 Enable auto-scan of WiFi networks for selection in Configuration Portal
669+
670+
671+
```
672+
#define SCAN_WIFI_NETWORKS true
673+
```
674+
675+
The manual input of SSIDs is default enabled, so that users can input arbitrary SSID, not only from the scanned list. This is for the sample use-cases in which users can input the known SSIDs of another place, then send the boards to that place. The boards can connect to WiFi without users entering Config Portal to re-configure.
676+
677+
#### 12.2 Disable manually input SSIDs
678+
679+
```
680+
// To disable manually input SSID, only from a scanned SSID lists
681+
#define MANUAL_SSID_INPUT_ALLOWED false
682+
```
683+
684+
This is for normal use-cases in which users can only select an SSID from a scanned list of SSIDs to avoid typo mistakes and/or security.
685+
686+
#### 12.3 Select maximum number of SSIDs in the list
687+
688+
The maximum number of SSIDs in the list is seletable from 2 to 15. If invalid number of SSIDs is selected, the default number of 10 will be used.
689+
690+
691+
```
692+
// From 2-15
693+
#define MAX_SSID_IN_LIST 8
694+
```
695+
696+
648697
---
649698
---
650699
@@ -668,10 +717,28 @@ After you connected, please, go to http://192.168.4.1 or newly configured AP IP,
668717
669718
Enter your credentials,
670719
720+
### 1. Without SCAN_WIFI_NETWORKS
721+
722+
Enter your credentials,
723+
724+
<p align="center">
725+
<img src="https://github.com/khoih-prog/ESP_WiFiManager_Lite/blob/main/pics/Input.png">
726+
</p>
727+
728+
or
729+
671730
<p align="center">
672731
<img src="https://github.com/khoih-prog/ESP_WiFiManager_Lite/blob/main/pics/MQTT.png">
673732
</p>
674733
734+
### 2. With SCAN_WIFI_NETWORKS
735+
736+
737+
<p align="center">
738+
<img src="https://github.com/khoih-prog/ESP_WiFiManager_Lite/blob/main/pics/Input_With_Scan.png">
739+
</p>
740+
741+
675742
then click `Save`.
676743
677744
<p align="center">
@@ -1125,6 +1192,16 @@ void loop()
11251192

11261193
/////////////////////////////////////////////
11271194

1195+
#define SCAN_WIFI_NETWORKS true
1196+
1197+
// To be able to manually input SSID, not from a scanned SSID lists
1198+
#define MANUAL_SSID_INPUT_ALLOWED true
1199+
1200+
// From 2-15
1201+
#define MAX_SSID_IN_LIST 8
1202+
1203+
/////////////////////////////////////////////
1204+
11281205
#include <ESP_WiFiManager_Lite.h>
11291206

11301207
#if ESP8266
@@ -1317,7 +1394,7 @@ This is the terminal output when running [**ESP_WiFi**](examples/ESP_WiFi) examp
13171394

13181395
```
13191396
Starting ESP_WiFi using LittleFS on ESP32_DEV
1320-
ESP_WiFiManager_Lite v1.4.0
1397+
ESP_WiFiManager_Lite v1.5.0
13211398
ESP_MultiResetDetector v1.1.1
13221399
LittleFS Flag read = 0xFFFC0003
13231400
multiResetDetectorFlag = 0xFFFC0003
@@ -1388,7 +1465,7 @@ FFFFFFFFF
13881465

13891466
```
13901467
Starting ESP_WiFi using LittleFS on ESP32_DEV
1391-
ESP_WiFiManager_Lite v1.4.0
1468+
ESP_WiFiManager_Lite v1.5.0
13921469
ESP_MultiResetDetector v1.1.1
13931470
LittleFS Flag read = 0xFFFE0001
13941471
multiResetDetectorFlag = 0xFFFE0001
@@ -1460,7 +1537,7 @@ This is the terminal output when running [**ESP_WiFi_MQTT**](examples/ESP_WiFi_M
14601537

14611538
```
14621539
Starting ESP_WiFi_MQTT using LittleFS on ESP8266_NODEMCU
1463-
ESP_WiFiManager_Lite v1.4.0
1540+
ESP_WiFiManager_Lite v1.5.0
14641541
ESP_MultiResetDetector v1.1.1
14651542
LittleFS Flag read = 0xFFFE0001
14661543
multiResetDetectorFlag = 0xFFFE0001
@@ -1535,7 +1612,7 @@ NNN
15351612
15361613
15371614
Starting ESP_WiFi_MQTT using LittleFS on ESP8266_NODEMCU
1538-
ESP_WiFiManager_Lite v1.4.0
1615+
ESP_WiFiManager_Lite v1.5.0
15391616
ESP_MultiResetDetector v1.1.1
15401617
LittleFS Flag read = 0xFFFE0001
15411618
multiResetDetectorFlag = 0xFFFE0001
@@ -1627,7 +1704,7 @@ This is the terminal output when running [**ESP_WiFi_MQTT**](examples/ESP_WiFi_M
16271704

16281705
```
16291706
Starting ESP_WiFi_MQTT using LittleFS on ESP32S2_DEV
1630-
ESP_WiFiManager_Lite v1.4.0
1707+
ESP_WiFiManager_Lite v1.5.0
16311708
ESP_MultiResetDetector v1.1.1
16321709
LittleFS Flag read = 0xFFFE0001
16331710
multiResetDetectorFlag = 0xFFFE0001
@@ -1740,7 +1817,7 @@ entry 0x4004c190
17401817
17411818
17421819
Starting ESP_WiFi_MQTT using LittleFS on ESP32S2_DEV
1743-
ESP_WiFiManager_Lite v1.4.0
1820+
ESP_WiFiManager_Lite v1.5.0
17441821
ESP_MultiResetDetector v1.1.1
17451822
LittleFS Flag read = 0xFFFE0001
17461823
multiResetDetectorFlag = 0xFFFE0001
@@ -1842,7 +1919,7 @@ This is the terminal output when running [**ESP_WiFi_MQTT**](examples/ESP_WiFi_M
18421919

18431920
```
18441921
Starting ESP_WiFi_MQTT using LittleFS on ESP32S2_DEV
1845-
ESP_WiFiManager_Lite v1.4.0
1922+
ESP_WiFiManager_Lite v1.5.0
18461923
ESP_MultiResetDetector v1.1.1
18471924
LittleFS Flag read = 0xFFFC0003
18481925
multiResetDetectorFlag = 0xFFFC0003
@@ -1870,7 +1947,7 @@ NNNN NNNNN NNNNN NNNNN NN[WML] h:UpdLittleFS
18701947

18711948
```
18721949
Starting ESP_WiFi_MQTT using LittleFS on ESP32S2_DEV
1873-
ESP_WiFiManager_Lite v1.4.0
1950+
ESP_WiFiManager_Lite v1.5.0
18741951
ESP_MultiResetDetector v1.1.1
18751952
LittleFS Flag read = 0xFFFE0001
18761953
multiResetDetectorFlag = 0xFFFE0001
@@ -1916,6 +1993,98 @@ AIO_SUB_TOPIC = /feeds/LED_Control
19161993
TWTWTWTW TWTWTWTWTW TWTW
19171994
```
19181995

1996+
---
1997+
1998+
### 5. [ESP_WiFi_MQTT](examples/ESP_WiFi_MQTT) on ESP32_DEV to demo WiFi Scan
1999+
2000+
This is the terminal output when running [**ESP_WiFi**](examples/ESP_WiFi) example on **ESP32_DEV** with WiFi Scan for selection in Configuration Portal
2001+
2002+
#### 5.1. MRD/DRD => Open Config Portal
2003+
2004+
```
2005+
Starting ESP_WiFi_MQTT using LittleFS on ESP32_DEV
2006+
ESP_WiFiManager_Lite v1.5.0
2007+
ESP_MultiResetDetector v1.1.1
2008+
LittleFS Flag read = 0xFFFC0003
2009+
multiResetDetectorFlag = 0xFFFC0003
2010+
lowerBytes = 0x0003, upperBytes = 0x0003
2011+
multiResetDetected, number of times = 3
2012+
Saving config file...
2013+
Saving config file OK
2014+
[WML] Hdr=ESP_WM_LITE,SSID=HueNet1,PW=12345678
2015+
[WML] SSID1=HueNet2,PW1=12345678
2016+
[WML] BName=ESP32_DEV
2017+
[WML] Hdr=ESP_WM_LITE,SSID=HueNet1,PW=12345678
2018+
[WML] SSID1=HueNet2,PW1=12345678
2019+
[WML] BName=ESP32_DEV
2020+
[WML] WiFi networks found:
2021+
[WML] 1: HueNet, -24dB
2022+
[WML] 2: HueNet1, -31dB
2023+
[WML] 3: HueNetTek, -33dB
2024+
[WML] 4: dragino-1ed63c, -33dB
2025+
[WML] 5: HueNet2, -57dB
2026+
[WML] 6: bacau, -72dB
2027+
[WML] 7: guest_24, -72dB
2028+
[WML] 8: Waterhome, -91dB
2029+
[WML] 9: BAHFAMILY, -93dB
2030+
[WML] 10: TP-LINK_2.4GHz_9A67ED, -94dB
2031+
[WML] 11: Access 2.0, -96dB
2032+
[WML]
2033+
stConf:SSID=ESP_9ABF498,PW=MyESP_9ABF498
2034+
[WML] IP=192.168.4.1,ch=11
2035+
N
2036+
Your stored Credentials :
2037+
AIO_SERVER = io.adafruit.com
2038+
AIO_SERVERPORT = 1883
2039+
AIO_USERNAME = private
2040+
AIO_KEY = private
2041+
AIO_PUB_TOPIC = /feeds/Temperature
2042+
AIO_SUB_TOPIC = /feeds/LED_Control
2043+
N
2044+
```
2045+
2046+
### 2. Config Data Saved => Connection to Adafruit MQTT
2047+
2048+
```
2049+
Starting ESP_WiFi_MQTT using LittleFS on ESP32_DEV
2050+
ESP_WiFiManager_Lite v1.5.0
2051+
ESP_MultiResetDetector v1.1.1
2052+
LittleFS Flag read = 0xFFFE0001
2053+
multiResetDetectorFlag = 0xFFFE0001
2054+
lowerBytes = 0x0001, upperBytes = 0x0001
2055+
No multiResetDetected, number of times = 1
2056+
LittleFS Flag read = 0xFFFE0001
2057+
Saving config file...
2058+
Saving config file OK
2059+
[WML] Hdr=ESP_WM_LITE,SSID=HueNet1,PW=12345678
2060+
[WML] SSID1=HueNet2,PW1=12345678
2061+
[WML] BName=ESP32_DEV
2062+
[WML] Hdr=ESP_WM_LITE,SSID=HueNet1,PW=12345678
2063+
[WML] SSID1=HueNet2,PW1=12345678
2064+
[WML] BName=ESP32_DEV
2065+
[WML] WiFi connected after time: 1
2066+
[WML] SSID=HueNet1,RSSI=-30
2067+
[WML] Channel=2,IP=192.168.2.45
2068+
Stop multiResetDetecting
2069+
Saving config file...
2070+
Saving config file OK
2071+
2072+
Creating new WiFi client object OK
2073+
Creating new MQTT object OK
2074+
AIO_SERVER = io.adafruit.com, AIO_SERVERPORT = 1883
2075+
AIO_USERNAME = user_name, AIO_KEY = aio_key
2076+
Creating new MQTT_Pub_Topic, Temperature = user_name/feeds/Temperature
2077+
Creating new Temperature object OK
2078+
Temperature MQTT_Pub_Topic = user_name/feeds/Temperature
2079+
Creating new AIO_SUB_TOPIC, LED_Control = user_name/feeds/LED_Control
2080+
Creating new LED_Control object OK
2081+
LED_Control AIO_SUB_TOPIC = user_name/feeds/LED_Control
2082+
2083+
Connecting to WiFi MQTT (3 attempts)...
2084+
WiFi MQTT connection successful!
2085+
TWTWTWTW TWTW
2086+
```
2087+
19192088
---
19202089
---
19212090

@@ -1949,6 +2118,11 @@ If you get compilation errors, more often than not, you may need to install a ne
19492118

19502119
## Releases
19512120

2121+
### Major Release v1.5.0
2122+
2123+
1. Enable scan of WiFi networks for selection in Configuration Portal. Check [PR for v1.3.0 - Enable scan of WiFi networks #10](https://github.com/khoih-prog/WiFiManager_NINA_Lite/pull/10). Now you can select optional **SCAN_WIFI_NETWORKS**, **MANUAL_SSID_INPUT_ALLOWED** to be able to manually input SSID, not only from a scanned SSID lists and **MAX_SSID_IN_LIST** (from 2-6 for ESP8266-AT or 2-15 for other)
2124+
2. Minor enhancement to not display garbage when data is invalid
2125+
19522126
### Release v1.4.0
19532127

19542128
1. Add **LittleFS and SPIFFS** support to new **ESP32-S2** boards (**Arduino ESP32C3_DEV**). Check [HOWTO Install esp32 core for ESP32-S2 (Saola, AI-Thinker ESP-12K) and ESP32-C3 boards into Arduino IDE](#howto-install-esp32-core-for-esp32-s2-saola-ai-thinker-esp-12k-and-esp32-c3-boards-into-arduino-ide).
@@ -2018,6 +2192,7 @@ Submit issues to: [ESP_WiFiManager_Lite issues](https://github.com/khoih-prog/ES
20182192
21. Add support to **ESP32-S2 (ESP32-S2 Saola, AI-Thinker ESP-12K, etc.) using EEPROM, LittleFS and SPIFFS**
20192193
22. Configurable **Customs HTML Headers**, including Customs Style, Customs Head Elements, CORS Header
20202194
23. Add support to **ESP32-C3 using EEPROM and SPIFFS**
2195+
24. Enable **scan of WiFi networks** for selection in Configuration Portal
20212196

20222197
---
20232198
---
@@ -2026,6 +2201,15 @@ Submit issues to: [ESP_WiFiManager_Lite issues](https://github.com/khoih-prog/ES
20262201

20272202
Please help contribute to this project and add your name here.
20282203

2204+
1. Thanks to [Michael H. "bizprof"](https://github.com/bizprof). With the impressive new feature :
2205+
- `Enable scan of WiFi networks for selection in Configuration Portal`. Check [PR for v1.3.0 - Enable scan of WiFi networks #10](https://github.com/khoih-prog/WiFiManager_NINA_Lite/pull/10) leading to v1.5.0
2206+
2207+
<table>
2208+
<tr>
2209+
<td align="center"><a href="https://github.com/bizprof"><img src="https://github.com/bizprof.png" width="100px;" alt="bizprof"/><br /><sub><b>⭐️⭐️ Michael H. "bizprof"</b></sub></a><br /></td>
2210+
</tr>
2211+
</table>
2212+
20292213

20302214
---
20312215

examples/ESP_WiFi/ESP_WiFi.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
Built by Khoi Hoang https://github.com/khoih-prog/ESP_WiFiManager_Lite
1010
Licensed under MIT license
11-
Version: 1.4.0
11+
Version: 1.5.0
1212
1313
Version Modified By Date Comments
1414
------- ----------- ---------- -----------
@@ -17,6 +17,7 @@
1717
1.2.0 K Hoang 22/02/2021 Add customs HTML header feature. Fix bug.
1818
1.3.0 K Hoang 12/04/2021 Fix invalid "blank" Config Data treated as Valid. Fix EEPROM_SIZE bug
1919
1.4.0 K Hoang 21/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM
20+
1.5.0 Michael H 24/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
2021
*****************************************************************************************************************************/
2122

2223
#include "defines.h"

0 commit comments

Comments
 (0)