Skip to content

Commit

Permalink
[WiFi] Retry setting WiFi mode if it fails to do so (letscontrolit#2721)
Browse files Browse the repository at this point in the history
See discussion in letscontrolit#2721
  • Loading branch information
TD-er committed Nov 18, 2019
1 parent bd4f0ab commit efae098
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ESPEasyWifi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,11 @@ void setWifiMode(WiFiMode_t wifimode) {

addLog(LOG_LEVEL_INFO, String(F("WIFI : Set WiFi to ")) + getWifiModeString(wifimode));

if (!WiFi.mode(wifimode)) {
int retry = 2;
while (!WiFi.mode(wifimode) && retry > 0) {
addLog(LOG_LEVEL_INFO, F("WIFI : Cannot set mode!!!!!"));
delay(100);
--retry;
}

if (wifimode == WIFI_OFF) {
Expand Down

0 comments on commit efae098

Please sign in to comment.