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

Commit fb7aecf

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 93104df commit fb7aecf

File tree

12 files changed

+539
-31
lines changed

12 files changed

+539
-31
lines changed

README.md

Lines changed: 198 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* [Why Async is better](#why-async-is-better)
1717
* [Currently supported Boards](#currently-supported-boards)
1818
* [Changelog](#changelog)
19+
* [Major Release v1.5.0](#major-release-v150)
1920
* [Release v1.4.0](#release-v140)
2021
* [Release v1.3.0](#release-v130)
2122
* [Release v1.2.0](#release-v120)
@@ -61,6 +62,12 @@
6162
* [ 9. To use custom Head Elements](#9-to-use-custom-head-elements)
6263
* [10. To use CORS Header](#10-to-use-cors-header)
6364
* [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)
65+
* [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)
66+
* [11.2 If you need to use both sets of WiFi SSID/PWD](#112-if-you-need-to-use-both-sets-of-wifi-ssidpwd)
67+
* [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)
68+
* [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)
69+
* [12.2 Disable manually input SSIDs](#122-disable-manually-input-ssids)
70+
* [12.3 Select maximum number of SSIDs in the list](#123-select-maximum-number-of-ssids-in-the-list)
6471
* [Examples](#examples)
6572
* [ 1. ESPAsync_WiFi](examples/ESPAsync_WiFi)
6673
* [ 2. ESPAsync_WiFi_MQTT](examples/ESPAsync_WiFi_MQTT)
@@ -93,6 +100,9 @@
93100
* [4. ESPAsync_WiFi_MQTT on ESP32S2_DEV to demo MultiResetDetector](#4-espasync_wifi_mqtt-on-esp32s2_dev-to-demo-multiresetdetector)
94101
* [4.1 MultiResetDetected => Open Config Portal](#41-multiresetdetected--open-config-portal)
95102
* [4.2 Got valid Credentials from Config Portal then connected to WiFi](#42-got-valid-credentials-from-config-portal-then-connected-to-wifi)
103+
* [5. ESPAsync_WiFi_MQTT on ESP32_DEV to demo WiFi Scan](#5-espasync_wifi_mqtt-on-esp32_dev-to-demo-wifi-scan)
104+
* [5.1 MRD/DRD => Open Config Portal](#51-mrddrd--open-config-portal)
105+
* [5.2 Config Data Saved => Connection to Adafruit MQTT](#52-config-data-saved--connection-to-adafruit-mqtt)
96106
* [Debug](#debug)
97107
* [Troubleshooting](#troubleshooting)
98108
* [Releases](#releases)
@@ -138,9 +148,12 @@ New recent features:
138148
- Control Config Portal from software or Virtual Switches
139149
- To permit autoreset after configurable timeout if DRD/MRD or non-persistent forced-CP
140150
- Use new ESP32 LittleFS features
151+
- **Scan WiFi networks** for selection in Configuration Portal
152+
141153

142154
Thanks to this [ESPAsync_WiFiManager_Lite library](https://github.com/khoih-prog/ESPAsync_WiFiManager_Lite) is based on and sync'ed with [`ESP_WiFiManager_Lite`](https://github.com/khoih-prog/ESP_WiFiManager_Lite), all the features currently supported by [`ESP_WiFiManager_Lite`](https://github.com/khoih-prog/ESP_WiFiManager_Lite) will be available.
143155

156+
144157
### Why Async is better
145158

146159
- Using asynchronous network means that you can handle **more than one connection at the same time**
@@ -163,14 +176,20 @@ To appreciate the power of the [ESPAsyncWebServer](https://github.com/me-no-dev/
163176

164177
This [**ESPAsync_WiFiManager_Lite** library](https://github.com/khoih-prog/ESPAsync_WiFiManager_Lite) currently supports these following boards:
165178

166-
1. **ESP32 including ESP32-S2 (ESP32-S2 Saola, AI-Thinker ESP-12K, etc.)**
167-
2. **ESP8266**
179+
1. **ESP8266 and ESP32-based boards using EEPROM, SPIFFS or LittleFS**.
180+
2. **ESP32-S2 (ESP32-S2 Saola, AI-Thinker ESP-12K, etc.) using EEPROM, SPIFFS or LittleFS**.
181+
3. **ESP32-C3 (ARDUINO_ESP32C3_DEV) using EEPROM or SPIFFS**.
168182

169183
---
170184
---
171185

172186
## Changelog
173187

188+
### Major Release v1.5.0
189+
190+
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)
191+
2. Minor enhancement to not display garbage when data is invalid
192+
174193
### Release v1.4.0
175194

176195
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).
@@ -667,7 +686,7 @@ Once Credentials / WiFi network information is saved in the host non-volatile me
667686
668687
#### 11. To use and input only one set of WiFi SSID and PWD
669688
670-
#### If you need to use and input only one set of WiFi SSID/PWD.
689+
#### 11.1 If you need to use and input only one set of WiFi SSID/PWD
671690
672691
```
673692
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
@@ -676,14 +695,45 @@ Once Credentials / WiFi network information is saved in the host non-volatile me
676695
```
677696
But it's always advisable to use and input both sets for reliability.
678697
679-
#### If you need to use both sets of WiFi SSID/PWD
698+
#### 11.2 If you need to use both sets of WiFi SSID/PWD
680699
681700
```
682701
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
683702
// Default is false (if not defined) => must input 2 sets of SSID/PWD
684703
#define REQUIRE_ONE_SET_SSID_PW false
685704
```
686705
706+
#### 12. To enable auto-scan of WiFi networks for selection in Configuration Portal
707+
708+
#### 12.1 Enable auto-scan of WiFi networks for selection in Configuration Portal
709+
710+
711+
```
712+
#define SCAN_WIFI_NETWORKS true
713+
```
714+
715+
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.
716+
717+
#### 12.2 Disable manually input SSIDs
718+
719+
```
720+
// To disable manually input SSID, only from a scanned SSID lists
721+
#define MANUAL_SSID_INPUT_ALLOWED false
722+
```
723+
724+
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.
725+
726+
#### 12.3 Select maximum number of SSIDs in the list
727+
728+
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.
729+
730+
731+
```
732+
// From 2-15
733+
#define MAX_SSID_IN_LIST 8
734+
```
735+
736+
687737
---
688738
---
689739
@@ -707,10 +757,28 @@ After you connected, please, go to http://192.168.4.1 or newly configured AP IP,
707757
708758
Enter your credentials,
709759
760+
### 1. Without SCAN_WIFI_NETWORKS
761+
762+
Enter your credentials,
763+
764+
<p align="center">
765+
<img src="https://github.com/khoih-prog/ESPAsync_WiFiManager_Lite/blob/main/pics/Input.png">
766+
</p>
767+
768+
or
769+
710770
<p align="center">
711771
<img src="https://github.com/khoih-prog/ESPAsync_WiFiManager_Lite/blob/main/pics/MQTT.png">
712772
</p>
713773
774+
### 2. With SCAN_WIFI_NETWORKS
775+
776+
777+
<p align="center">
778+
<img src="https://github.com/khoih-prog/ESPAsync_WiFiManager_Lite/blob/main/pics/Input_With_Scan.png">
779+
</p>
780+
781+
714782
then click `Save`.
715783
716784
<p align="center">
@@ -1165,6 +1233,16 @@ void loop()
11651233

11661234
/////////////////////////////////////////////
11671235

1236+
#define SCAN_WIFI_NETWORKS true
1237+
1238+
// To be able to manually input SSID, not from a scanned SSID lists
1239+
#define MANUAL_SSID_INPUT_ALLOWED true
1240+
1241+
// From 2-15
1242+
#define MAX_SSID_IN_LIST 8
1243+
1244+
/////////////////////////////////////////////
1245+
11681246
#include <ESPAsync_WiFiManager_Lite.h>
11691247

11701248
#if ESP8266
@@ -1357,7 +1435,7 @@ This is the terminal output when running [**ESPAsync_WiFi_MQTT**](examples/ESPAs
13571435

13581436
```
13591437
Starting ESPAsync_WiFi_MQTT using LittleFS on ESP32_DEV
1360-
ESPAsync_WiFiManager_Lite v1.4.0
1438+
ESPAsync_WiFiManager_Lite v1.5.0
13611439
ESP_MultiResetDetector v1.1.1
13621440
LittleFS Flag read = 0xFFFE0001
13631441
multiResetDetectorFlag = 0xFFFE0001
@@ -1432,7 +1510,7 @@ NNN
14321510
14331511
14341512
Starting ESPAsync_WiFi_MQTT using LittleFS on ESP32_DEV
1435-
ESPAsync_WiFiManager_Lite v1.4.0
1513+
ESPAsync_WiFiManager_Lite v1.5.0
14361514
ESP_MultiResetDetector v1.1.1
14371515
LittleFS Flag read = 0xFFFE0001
14381516
multiResetDetectorFlag = 0xFFFE0001
@@ -1524,7 +1602,7 @@ This is the terminal output when running [**ESPAsync_WiFi_MQTT**](examples/ESPAs
15241602

15251603
```
15261604
Starting ESPAsync_WiFi_MQTT using LittleFS on ESP8266_NODEMCU
1527-
ESPAsync_WiFiManager_Lite v1.4.0
1605+
ESPAsync_WiFiManager_Lite v1.5.0
15281606
ESP_MultiResetDetector v1.1.1
15291607
LittleFS Flag read = 0xFFFE0001
15301608
multiResetDetectorFlag = 0xFFFE0001
@@ -1599,7 +1677,7 @@ NNN
15991677
16001678
16011679
Starting ESPAsync_WiFi_MQTT using LittleFS on ESP8266_NODEMCU
1602-
ESPAsync_WiFiManager_Lite v1.4.0
1680+
ESPAsync_WiFiManager_Lite v1.5.0
16031681
ESP_MultiResetDetector v1.1.1
16041682
LittleFS Flag read = 0xFFFE0001
16051683
multiResetDetectorFlag = 0xFFFE0001
@@ -1690,7 +1768,7 @@ This is the terminal output when running [**ESPAsync_WiFi_MQTT**](examples/ESPAs
16901768

16911769
```
16921770
Starting ESPAsync_WiFi_MQTT using LittleFS on ESP32S2_DEV
1693-
ESPAsync_WiFiManager_Lite v1.4.0
1771+
ESPAsync_WiFiManager_Lite v1.5.0
16941772
ESP_MultiResetDetector v1.1.1
16951773
LittleFS Flag read = 0xFFFE0001
16961774
multiResetDetectorFlag = 0xFFFE0001
@@ -1803,7 +1881,7 @@ entry 0x4004c190
18031881
18041882
18051883
Starting ESPAsync_WiFi_MQTT using LittleFS on ESP32S2_DEV
1806-
ESPAsync_WiFiManager_Lite v1.4.0
1884+
ESPAsync_WiFiManager_Lite v1.5.0
18071885
ESP_MultiResetDetector v1.1.1
18081886
LittleFS Flag read = 0xFFFE0001
18091887
multiResetDetectorFlag = 0xFFFE0001
@@ -1906,7 +1984,7 @@ This is the terminal output when running [**ESPAsync_WiFi_MQTT**](examples/ESPAs
19061984

19071985
```
19081986
Starting ESPAsync_WiFi_MQTT using LittleFS on ESP32S2_DEV
1909-
ESPAsync_WiFiManager_Lite v1.4.0
1987+
ESPAsync_WiFiManager_Lite v1.5.0
19101988
ESP_MultiResetDetector v1.1.1
19111989
LittleFS Flag read = 0xFFFC0003
19121990
multiResetDetectorFlag = 0xFFFC0003
@@ -1949,7 +2027,7 @@ entry 0x4004c190
19492027

19502028
```
19512029
Starting ESPAsync_WiFi_MQTT using LittleFS on ESP32S2_DEV
1952-
ESPAsync_WiFiManager_Lite v1.4.0
2030+
ESPAsync_WiFiManager_Lite v1.5.0
19532031
ESP_MultiResetDetector v1.1.1
19542032
LittleFS Flag read = 0xFFFE0001
19552033
multiResetDetectorFlag = 0xFFFE0001
@@ -1995,6 +2073,99 @@ AIO_SUB_TOPIC = /feeds/LED_Control
19952073
TWTWTWT
19962074
```
19972075

2076+
---
2077+
2078+
### 5. [ESPAsync_WiFi_MQTT](examples/ESPAsync_WiFi_MQTT) on ESP32_DEV to demo WiFi Scan
2079+
2080+
This is the terminal output when running [**ESPAsync_WiFi_MQTT**](examples/ESPAsync_WiFi_MQTT) example on **ESP32_DEV** with WiFi Scan for selection in Configuration Portal
2081+
2082+
#### 5.1 MRD/DRD => Open Config Portal
2083+
2084+
```
2085+
Starting ESPAsync_WiFi_MQTT using LittleFS on ESP32_DEV
2086+
ESPAsync_WiFiManager_Lite v1.5.0
2087+
ESP_MultiResetDetector v1.1.1
2088+
LittleFS Flag read = 0xFFFC0003
2089+
multiResetDetectorFlag = 0xFFFC0003
2090+
lowerBytes = 0x0003, upperBytes = 0x0003
2091+
multiResetDetected, number of times = 3
2092+
Saving config file...
2093+
Saving config file OK
2094+
[WML] Hdr=ESP_WM_LITE,SSID=HueNet1,PW=12345678
2095+
[WML] SSID1=HueNet2,PW1=12345678
2096+
[WML] BName=ESP32_DEV
2097+
[WML] Hdr=ESP_WM_LITE,SSID=HueNet1,PW=12345678
2098+
[WML] SSID1=HueNet2,PW1=12345678
2099+
[WML] BName=ESP32_DEV
2100+
[WML] WiFi networks found:
2101+
[WML] 1: HueNet, -26dB
2102+
[WML] 2: HueNet1, -28dB
2103+
[WML] 3: HueNetTek, -31dB
2104+
[WML] 4: dragino-1ed63c, -43dB
2105+
[WML] 5: HueNet2, -56dB
2106+
[WML] 6: bacau, -74dB
2107+
[WML] 7: guest_24, -74dB
2108+
[WML] 8: Rogers 786, -86dB
2109+
[WML] 9: dlink-4F96, -90dB
2110+
[WML] 10: Waterhome, -91dB
2111+
[WML] 11: BELL246, -93dB
2112+
[WML] 12: BELL627, -96dB
2113+
[WML]
2114+
stConf:SSID=ESP_9ABF498,PW=MyESP_9ABF498
2115+
[WML] IP=192.168.4.1,ch=5
2116+
N
2117+
Your stored Credentials :
2118+
AIO_SERVER = io.adafruit.com
2119+
AIO_SERVERPORT = 1883
2120+
AIO_USERNAME = user_name
2121+
AIO_KEY = aio_key
2122+
AIO_PUB_TOPIC = /feeds/Temperature
2123+
AIO_SUB_TOPIC = /feeds/LED_Control
2124+
NNNN NNNNN NNNNN N
2125+
```
2126+
2127+
### 5.2 Config Data Saved => Connection to Adafruit MQTT
2128+
2129+
```
2130+
Starting ESPAsync_WiFi_MQTT using LittleFS on ESP32_DEV
2131+
ESPAsync_WiFiManager_Lite v1.5.0
2132+
ESP_MultiResetDetector v1.1.1
2133+
LittleFS Flag read = 0xFFFE0001
2134+
multiResetDetectorFlag = 0xFFFE0001
2135+
lowerBytes = 0x0001, upperBytes = 0x0001
2136+
No multiResetDetected, number of times = 1
2137+
LittleFS Flag read = 0xFFFE0001
2138+
Saving config file...
2139+
Saving config file OK
2140+
[WML] Hdr=ESP_WM_LITE,SSID=HueNet1,PW=12345678
2141+
[WML] SSID1=HueNet2,PW1=12345678
2142+
[WML] BName=ESP32_DEV
2143+
[WML] Hdr=ESP_WM_LITE,SSID=HueNet1,PW=12345678
2144+
[WML] SSID1=HueNet2,PW1=12345678
2145+
[WML] BName=Async_ESP32_DEV
2146+
[WML] WiFi connected after time: 1
2147+
[WML] SSID=HueNet1,RSSI=-30
2148+
[WML] Channel=2,IP=192.168.2.45
2149+
Stop multiResetDetecting
2150+
Saving config file...
2151+
Saving config file OK
2152+
2153+
Creating new WiFi client object OK
2154+
Creating new MQTT object OK
2155+
AIO_SERVER = io.adafruit.com, AIO_SERVERPORT = 1883
2156+
AIO_USERNAME = user_name, AIO_KEY = aio_key
2157+
Creating new MQTT_Pub_Topic, Temperature = user_name/feeds/Temperature
2158+
Creating new Temperature object OK
2159+
Temperature MQTT_Pub_Topic = user_name/feeds/Temperature
2160+
Creating new AIO_SUB_TOPIC, LED_Control = user_name/feeds/LED_Control
2161+
Creating new LED_Control object OK
2162+
LED_Control AIO_SUB_TOPIC = user_name/feeds/LED_Control
2163+
2164+
Connecting to WiFi MQTT (3 attempts)...
2165+
WiFi MQTT connection successful!
2166+
TWTWTWTW TWTWTWTWTWTW
2167+
```
2168+
19982169
---
19992170
---
20002171

@@ -2032,6 +2203,11 @@ If you connect to the created configuration Access Point but the ConfigPortal do
20322203

20332204
## Releases
20342205

2206+
### Major Release v1.5.0
2207+
2208+
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)
2209+
2. Minor enhancement to not display garbage when data is invalid
2210+
20352211
### Release v1.4.0
20362212

20372213
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).
@@ -2097,6 +2273,7 @@ Submit issues to: [ESPAsync_WiFiManager_Lite issues](https://github.com/khoih-pr
20972273
18. Configurable **Customs HTML Headers**, including Customs Style, Customs Head Elements, CORS Header
20982274
19. Add support to **ESP32-S2 (ESP32-S2 Saola, AI-Thinker ESP-12K, etc.) using EEPROM, LittleFS and SPIFFS**
20992275
20. Add support to **ESP32-C3 using EEPROM and SPIFFS**
2276+
21. Enable **scan of WiFi networks** for selection in Configuration Portal
21002277

21012278
---
21022279
---
@@ -2105,6 +2282,15 @@ Submit issues to: [ESPAsync_WiFiManager_Lite issues](https://github.com/khoih-pr
21052282

21062283
Please help contribute to this project and add your name here.
21072284

2285+
1. Thanks to [Michael H. "bizprof"](https://github.com/bizprof). With the impressive new feature :
2286+
- `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
2287+
2288+
<table>
2289+
<tr>
2290+
<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>
2291+
</tr>
2292+
</table>
2293+
21082294

21092295
---
21102296

examples/ESPAsync_WiFi/ESPAsync_WiFi.ino

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

2324
#include "defines.h"

0 commit comments

Comments
 (0)