Added fix for long wait between connections on Adafruit feather m0#266
Added fix for long wait between connections on Adafruit feather m0#266
Conversation
| #endif | ||
| // only check for WL_DISCONNECTED if board is ESP. It is because of how WiFi library on ESP handles a connection failure. | ||
| // ToDo: reconsider this logic if support for new board (apart from M0 or ESP32) is added | ||
| while((wifiStatus == WL_IDLE_STATUS || (checkForDisconnected && wifiStatus == WL_DISCONNECTED)) && (millis() - beginDuration < attemptDelay)) // This is necessary for ESP32 unless callback is utilized |
There was a problem hiding this comment.
For reviewer:
Logic:
- For Feather M0:
checkForDisconnected= false
while((wifiStatus == WL_IDLE_STATUS || (false && wifiStatus == WL_DISCONNECTED))
which equals
while((wifiStatus == WL_IDLE_STATUS))
- For ESP32:
checkForDisconnected= true
while((wifiStatus == WL_IDLE_STATUS || (true && wifiStatus == WL_DISCONNECTED))
which equals
while((wifiStatus == WL_IDLE_STATUS || (wifiStatus == WL_DISCONNECTED))
Yes, that has been tested. I will add it to the results above and ping you.
Ah, missed the upload. Will fix that. |
|
@produceconsumerobot |
|
@nitin710 great! |
|
Added the tests to our protocols. |
version bump.
Description
Fixes a bug where network switching on feather M0 would take
attemptDelay(set in code) seconds. This artifact was introduced when changes were made to support enterprise wifi on ESP32.This bug caused the Feather M0 to wait for 20 secs before switching networks (even if the network it was trying to connect to was not available).
This patch fixes that issue and now, if a network is not available (Feather M0 fails to connect to it), it moves on to the next network.
Requirements
Issues Referenced
Documentation update
Testing
The following shows the setup log indicating time taken between trying separate networks.
WL_NO_SSID_AVAILWL_DISCONNECTEDSteps to test
Checklist to allow merge
masterDIGITAL_WRITE_DEBUG= false (if set true while testing)ofxEmotiBitVersion.hScreenshots: