-
Notifications
You must be signed in to change notification settings - Fork 10
retries block the main loop #18
Description
Thanks for the great work on this library. I have an issue that might not be a bug; in that case it would be a useful feature i think.
When the configured WiFi network becomes unavailable, retries are blocking the loop.
Steps to Reproduce
I'm using REQUIRE_ONE_SET_SSID_PW true
, and i can configure a single SSID/PWD via the portal and it connects successfully. When i switch off my home AP, the wifimanager keeps trying to reconnect for about 25 seconds, then goes back to the loop but immediately tries again to reconnect, producing and endless loop of:
[WN] r:WLost.ReconW
[WN] Ignore invalid WiFi PW : index=1, PW=
[WN] con2WF:SSID=Cassiopeia,PW=***
[WN] Failed using index=0, retry_time=0
[WN] Failed using index=0, retry_time=0
[WN] con2WF:failed
[WN] r:Check&WLost
Expected behavior
My application requires the retries to occur only at a certain interval, to allow the main functions of the loop to continue to work even when the wifi connection is down (e.g. polling sensors and saving the data to SD to upload later). I have tried changing RETRY_TIMES_RECONNECT_WIFI
but that does not accept lower than 2. Would it be possible to define an interval between retries, e.g. RETRY_RECONNECT_WIFI_INTERVAL
in order to allow the application to run in between retries? Or can you suggest a workaround?
Also, i'm not seeing the behaviour described in the readme, where the Config Portal is reopened when both SSIDs fail. I set REQUIRE_ONE_SET_SSID_PW false
and configure 2 SSIDs, and when they both become unavailable, the retries alternate but there is no countdown to the Config Portal.
Information
- Arduino IDE 1.8.13
- SAMD21G Industruino board
- library version 1.4.1