From af6b1d815a2fa82dd7559f7e4642967f48cbff29 Mon Sep 17 00:00:00 2001 From: Khoi Hoang <57012152+khoih-prog@users.noreply.github.com> Date: Sat, 8 Jan 2022 00:12:12 -0500 Subject: [PATCH] v1.5.0 to fix the blocking issue in loop() ### Release v1.5.0 1. Workaround for core WiFi.status() bug, which does not detect WiFi lost. 2. Fix the blocking issue in loop(). Check [retries block the main loop #18](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/18) 3. Configurable `WIFI_RECON_INTERVAL`. Check [retries block the main loop #18](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/18#issuecomment-1006197561) 4. Update `Packages' Patches` --- examples/Portenta_H7_WiFi_MQTT/defines.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/examples/Portenta_H7_WiFi_MQTT/defines.h b/examples/Portenta_H7_WiFi_MQTT/defines.h index 6bc3926..f0a5c49 100644 --- a/examples/Portenta_H7_WiFi_MQTT/defines.h +++ b/examples/Portenta_H7_WiFi_MQTT/defines.h @@ -84,9 +84,21 @@ // Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank" // Default is false (if not defined) => must input 2 sets of SSID/PWD -#define REQUIRE_ONE_SET_SSID_PW false +#define REQUIRE_ONE_SET_SSID_PW true //false -#define USE_DYNAMIC_PARAMETERS true //false +// Max times to try WiFi per loop() iteration. To avoid blocking issue in loop() +// Default 1 if not defined, and minimum 1. +//#define MAX_NUM_WIFI_RECON_TRIES_PER_LOOP 2 + +// Default no interval between recon WiFi if lost +// Max permitted interval will be 10mins +// Uncomment to use. Be careful, WiFi reconnect will be delayed if using this method +// 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. +#define WIFI_RECON_INTERVAL 30000 + +///////////////////////////////////////////// + +#define USE_DYNAMIC_PARAMETERS true /////////////////////////////////////////////