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

Commit 485da85

Browse files
authored
v1.5.0 to fix the blocking issue in loop()
### Major Release v1.5.0 1. Add support to RP2040-based boards, such as **NANO_RP2040_CONNECT**, using [**Earle Philhower's arduino-pico** core](https://github.com/earlephilhower/arduino-pico) 2. Fix the blocking issue in loop(). Check [retries block the main loop #18](khoih-prog/WiFiManager_NINA_Lite#18) 3. Configurable `WIFI_RECON_INTERVAL`. Check [retries block the main loop #18](khoih-prog/WiFiManager_NINA_Lite#18 (comment)) 4. Update `Packages' Patches`
1 parent a59bcbc commit 485da85

File tree

27 files changed

+1342
-350
lines changed

27 files changed

+1342
-350
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.16) or Platform.io version
18-
* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP8266 core v3.0.2, ArduinoCore-mbed v2.5.2, etc.)
18+
* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP8266 core v3.0.2, ArduinoCore-mbed v2.6.1, etc.)
1919
* Contextual information (e.g. what you were trying to achieve)
2020
* Simplest possible steps to reproduce
2121
* Anything that might be relevant in your opinion, such as:
@@ -26,11 +26,11 @@ Please ensure to specify the following:
2626
### Example
2727

2828
```
29-
Arduino IDE version: 1.8.16
30-
RASPBERRY_PI_PICO board
31-
ArduinoCore-mbed v2.5.2
29+
Arduino IDE version: 1.8.19
30+
Nano_RP2040_Connect board
31+
ArduinoCore-mbed v2.6.1
3232
OS: Ubuntu 20.04 LTS
33-
Linux xy-Inspiron-3593 5.4.0-88-generic #99-Ubuntu SMP Thu Sep 23 17:29:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
33+
Linux xy-Inspiron-3593 5.4.0-92-generic #103-Ubuntu SMP Fri Nov 26 16:13:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3434
3535
Context:
3636
The board couldn't autoreconnect to Local Blynk Server after router power recycling.

README.md

Lines changed: 106 additions & 56 deletions
Large diffs are not rendered by default.

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Major Release v1.5.0](#major-release-v150)
1516
* [Release v1.4.1](#release-v141)
1617
* [Major Release v1.4.0](#major-release-v140)
1718
* [Major Release v1.3.0](#major-release-v130)
@@ -29,6 +30,13 @@
2930

3031
## Changelog
3132

33+
### Major Release v1.5.0
34+
35+
1. Add support to RP2040-based boards, such as **NANO_RP2040_CONNECT**, using [**Earle Philhower's arduino-pico** core](https://github.com/earlephilhower/arduino-pico)
36+
2. Fix the blocking issue in loop(). Check [retries block the main loop #18](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/18)
37+
3. Configurable `WIFI_RECON_INTERVAL`. Check [retries block the main loop #18](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/18#issuecomment-1006197561)
38+
4. Update `Packages' Patches`
39+
3240
### Release v1.4.1
3341

3442
1. Update `platform.ini` and `library.json` to use original `khoih-prog` instead of `khoih.prog` after PIO fix

examples/MKR1000_WiFi101/defines.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,21 @@
8989

9090
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
9191
// Default is false (if not defined) => must input 2 sets of SSID/PWD
92-
#define REQUIRE_ONE_SET_SSID_PW false
92+
#define REQUIRE_ONE_SET_SSID_PW true //false
9393

94-
#define USE_DYNAMIC_PARAMETERS true
94+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
95+
// Default 1 if not defined, and minimum 1.
96+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
97+
98+
// Default no interval between recon WiFi if lost
99+
// Max permitted interval will be 10mins
100+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
101+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
102+
//#define WIFI_RECON_INTERVAL 30000
103+
104+
/////////////////////////////////////////////
105+
106+
#define USE_DYNAMIC_PARAMETERS true
95107

96108
/////////////////////////////////////////////
97109

examples/MKR1000_WiFi101_MQTT/defines.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,21 @@
8989

9090
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
9191
// Default is false (if not defined) => must input 2 sets of SSID/PWD
92-
#define REQUIRE_ONE_SET_SSID_PW false
92+
#define REQUIRE_ONE_SET_SSID_PW true //false
9393

94-
#define USE_DYNAMIC_PARAMETERS true
94+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
95+
// Default 1 if not defined, and minimum 1.
96+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
97+
98+
// Default no interval between recon WiFi if lost
99+
// Max permitted interval will be 10mins
100+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
101+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
102+
//#define WIFI_RECON_INTERVAL 30000
103+
104+
/////////////////////////////////////////////
105+
106+
#define USE_DYNAMIC_PARAMETERS true
95107

96108
/////////////////////////////////////////////
97109

examples/RP2040_WiFi/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,19 @@
143143

144144
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
145145
// Default is false (if not defined) => must input 2 sets of SSID/PWD
146-
#define REQUIRE_ONE_SET_SSID_PW false
146+
#define REQUIRE_ONE_SET_SSID_PW true //false
147+
148+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
149+
// Default 1 if not defined, and minimum 1.
150+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
151+
152+
// Default no interval between recon WiFi if lost
153+
// Max permitted interval will be 10mins
154+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
155+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
156+
//#define WIFI_RECON_INTERVAL 30000
157+
158+
/////////////////////////////////////////////
147159

148160
#define USE_DYNAMIC_PARAMETERS true
149161

examples/RP2040_WiFi_MQTT/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,19 @@
150150

151151
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
152152
// Default is false (if not defined) => must input 2 sets of SSID/PWD
153-
#define REQUIRE_ONE_SET_SSID_PW false
153+
#define REQUIRE_ONE_SET_SSID_PW true //false
154+
155+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
156+
// Default 1 if not defined, and minimum 1.
157+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
158+
159+
// Default no interval between recon WiFi if lost
160+
// Max permitted interval will be 10mins
161+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
162+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
163+
//#define WIFI_RECON_INTERVAL 30000
164+
165+
/////////////////////////////////////////////
154166

155167
#define USE_DYNAMIC_PARAMETERS true
156168

examples/SAMD_WiFi/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,19 @@
226226

227227
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
228228
// Default is false (if not defined) => must input 2 sets of SSID/PWD
229-
#define REQUIRE_ONE_SET_SSID_PW false
229+
#define REQUIRE_ONE_SET_SSID_PW true //false
230+
231+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
232+
// Default 1 if not defined, and minimum 1.
233+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
234+
235+
// Default no interval between recon WiFi if lost
236+
// Max permitted interval will be 10mins
237+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
238+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
239+
//#define WIFI_RECON_INTERVAL 30000
240+
241+
/////////////////////////////////////////////
230242

231243
#define USE_DYNAMIC_PARAMETERS true
232244

examples/SAMD_WiFi_MQTT/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,19 @@
242242

243243
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
244244
// Default is false (if not defined) => must input 2 sets of SSID/PWD
245-
#define REQUIRE_ONE_SET_SSID_PW false
245+
#define REQUIRE_ONE_SET_SSID_PW true //false
246+
247+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
248+
// Default 1 if not defined, and minimum 1.
249+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
250+
251+
// Default no interval between recon WiFi if lost
252+
// Max permitted interval will be 10mins
253+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
254+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
255+
//#define WIFI_RECON_INTERVAL 30000
256+
257+
/////////////////////////////////////////////
246258

247259
#define USE_DYNAMIC_PARAMETERS true
248260

examples/SAM_DUE_WiFi/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,19 @@
142142

143143
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
144144
// Default is false (if not defined) => must input 2 sets of SSID/PWD
145-
#define REQUIRE_ONE_SET_SSID_PW false
145+
#define REQUIRE_ONE_SET_SSID_PW true //false
146+
147+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
148+
// Default 1 if not defined, and minimum 1.
149+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
150+
151+
// Default no interval between recon WiFi if lost
152+
// Max permitted interval will be 10mins
153+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
154+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
155+
//#define WIFI_RECON_INTERVAL 30000
156+
157+
/////////////////////////////////////////////
146158

147159
#define USE_DYNAMIC_PARAMETERS true
148160

examples/SAM_DUE_WiFi_MQTT/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,19 @@
143143

144144
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
145145
// Default is false (if not defined) => must input 2 sets of SSID/PWD
146-
#define REQUIRE_ONE_SET_SSID_PW false
146+
#define REQUIRE_ONE_SET_SSID_PW true //false
147+
148+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
149+
// Default 1 if not defined, and minimum 1.
150+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
151+
152+
// Default no interval between recon WiFi if lost
153+
// Max permitted interval will be 10mins
154+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
155+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
156+
//#define WIFI_RECON_INTERVAL 30000
157+
158+
/////////////////////////////////////////////
147159

148160
#define USE_DYNAMIC_PARAMETERS true
149161

examples/STM32_WiFi/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,19 @@
205205

206206
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
207207
// Default is false (if not defined) => must input 2 sets of SSID/PWD
208-
#define REQUIRE_ONE_SET_SSID_PW false
208+
#define REQUIRE_ONE_SET_SSID_PW true //false
209+
210+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
211+
// Default 1 if not defined, and minimum 1.
212+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
213+
214+
// Default no interval between recon WiFi if lost
215+
// Max permitted interval will be 10mins
216+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
217+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
218+
//#define WIFI_RECON_INTERVAL 30000
219+
220+
/////////////////////////////////////////////
209221

210222
#define USE_DYNAMIC_PARAMETERS true
211223

examples/STM32_WiFi_MQTT/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,19 @@
206206

207207
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
208208
// Default is false (if not defined) => must input 2 sets of SSID/PWD
209-
#define REQUIRE_ONE_SET_SSID_PW false
209+
#define REQUIRE_ONE_SET_SSID_PW true //false
210+
211+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
212+
// Default 1 if not defined, and minimum 1.
213+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
214+
215+
// Default no interval between recon WiFi if lost
216+
// Max permitted interval will be 10mins
217+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
218+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
219+
//#define WIFI_RECON_INTERVAL 30000
220+
221+
/////////////////////////////////////////////
210222

211223
#define USE_DYNAMIC_PARAMETERS true
212224

examples/Teensy_WiFi/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,19 @@
154154

155155
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
156156
// Default is false (if not defined) => must input 2 sets of SSID/PWD
157-
#define REQUIRE_ONE_SET_SSID_PW false
157+
#define REQUIRE_ONE_SET_SSID_PW true //false
158+
159+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
160+
// Default 1 if not defined, and minimum 1.
161+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
162+
163+
// Default no interval between recon WiFi if lost
164+
// Max permitted interval will be 10mins
165+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
166+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
167+
//#define WIFI_RECON_INTERVAL 30000
168+
169+
/////////////////////////////////////////////
158170

159171
#define USE_DYNAMIC_PARAMETERS true
160172

examples/Teensy_WiFi_MQTT/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,19 @@
155155

156156
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
157157
// Default is false (if not defined) => must input 2 sets of SSID/PWD
158-
#define REQUIRE_ONE_SET_SSID_PW false
158+
#define REQUIRE_ONE_SET_SSID_PW true //false
159+
160+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
161+
// Default 1 if not defined, and minimum 1.
162+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
163+
164+
// Default no interval between recon WiFi if lost
165+
// Max permitted interval will be 10mins
166+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
167+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
168+
//#define WIFI_RECON_INTERVAL 30000
169+
170+
/////////////////////////////////////////////
159171

160172
#define USE_DYNAMIC_PARAMETERS true
161173

examples/nRF52_WiFi/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,19 @@
162162

163163
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
164164
// Default is false (if not defined) => must input 2 sets of SSID/PWD
165-
#define REQUIRE_ONE_SET_SSID_PW false
165+
#define REQUIRE_ONE_SET_SSID_PW true //false
166+
167+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
168+
// Default 1 if not defined, and minimum 1.
169+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
170+
171+
// Default no interval between recon WiFi if lost
172+
// Max permitted interval will be 10mins
173+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
174+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
175+
//#define WIFI_RECON_INTERVAL 30000
176+
177+
/////////////////////////////////////////////
166178

167179
#define USE_DYNAMIC_PARAMETERS true
168180

examples/nRF52_WiFi_MQTT/defines.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,19 @@
161161

162162
// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
163163
// Default is false (if not defined) => must input 2 sets of SSID/PWD
164-
#define REQUIRE_ONE_SET_SSID_PW false
164+
#define REQUIRE_ONE_SET_SSID_PW true //false
165+
166+
// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop()
167+
// Default 1 if not defined, and minimum 1.
168+
//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2
169+
170+
// Default no interval between recon WiFi if lost
171+
// Max permitted interval will be 10mins
172+
// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method
173+
// Only use whenever urgent tasks in loop() can't be delayed. But if so, it's better you have to rewrite your code, e.g. using higher priority tasks.
174+
//#define WIFI_RECON_INTERVAL 30000
175+
176+
/////////////////////////////////////////////
165177

166178
#define USE_DYNAMIC_PARAMETERS true
167179

library.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "WiFiManager_Generic_Lite",
3-
"version": "1.4.1",
3+
"version": "1.5.0",
44
"keywords": "wifi, multi-wifi, WiFiNINA, WiFi101, ESP32-AT, ESP8266-AT, Teensy, SAM-DUE, SAMD, STM32, nRF52, rpi-pico, rp2040, nano-rp2040-connect, config-portal, Double-Reset, dynamic-params, LittleFS, FlashStorage-SAMD, FlashStorage-STM32, Credentials, wi-fi, FlashStorage",
55
"description": "Library to configure MultiWiFi/Credentials at runtime for Teensy, SAM DUE, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, nRF52, RP2040-based (Nano RP2040 Connect, RASPBERRY_PI_PICO) boards, etc. using Generic WiFi (WiFiNINA, WiFi101, ESP8266-AT, ESP32-AT, etc.) modules/shields. You can also specify DHCP HostName, static AP and STA IP. Use much less memory compared to full-fledge WiFiManager. Config Portal will be auto-adjusted to match the number of dynamic custom parameters. Optional default Credentials to be autoloaded into Config Portal to use or change instead of manually input. Credentials are saved in LittleFS/InternalFS, (emulated-)EEPROM, FlashStorage_SAMD, FlashStorage_STM32 or DueFlashStorage. New powerful-yet-simple-to-use feature to enable adding dynamic custom parameters from sketch and input using the same Config Portal. DoubleDetectDetector as well as Virtual Switches feature permits entering Config Portal as requested.",
66
"authors":
@@ -27,7 +27,7 @@
2727
{
2828
"owner": "khoih-prog",
2929
"name": "WiFiNINA_Generic",
30-
"version": "^1.8.13",
30+
"version": "^1.8.14-3",
3131
"platforms": ["*"]
3232
},
3333
{
@@ -57,13 +57,13 @@
5757
{
5858
"owner": "khoih-prog",
5959
"name": "WiFiWebServer",
60-
"version": "^1.4.1",
60+
"version": "^1.5.3",
6161
"platforms": ["*"]
6262
},
6363
{
6464
"owner": "khoih-prog",
6565
"name": "ESP8266_AT_WebServer",
66-
"version": "^1.4.0",
66+
"version": "^1.5.2",
6767
"platforms": ["*"]
6868
},
6969
{

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=WiFiManager_Generic_Lite
2-
version=1.4.1
2+
version=1.5.0
33
author=Khoi Hoang
44
maintainer=Khoi Hoang <[email protected]>
55
license=MIT

0 commit comments

Comments
 (0)