Skip to content

Commit 37d1f39

Browse files
committed
call wifi reconnect manually
1 parent f718da8 commit 37d1f39

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/esp-config-page-wireless.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace ESP_CONFIG_PAGE
1212
IPAddress apIp = IPAddress(192, 168, 1, 1);
1313
String dnsName = "esp-config.local";
1414
int lastConnectionError = -1;
15+
unsigned long connectionRetryCounter;
1516
unsigned long connectionTimeoutCounter;
1617
unsigned long connectionTimeoutMs = 45000;
1718

@@ -253,6 +254,13 @@ namespace ESP_CONFIG_PAGE
253254
LOGN("Disabling AP");
254255
WiFi.mode(WIFI_STA);
255256
}
257+
258+
if (status != WL_CONNECTED && millis() - connectionRetryCounter > 3000)
259+
{
260+
LOGN("Trying to reconnect...");
261+
WiFi.reconnect();
262+
connectionRetryCounter = millis();
263+
}
256264
}
257265
}
258266
#endif //ESP_CONFIG_PAGE_WIRELESS_H

0 commit comments

Comments
 (0)