add wifi reconnection logic

This commit is contained in:
2024-10-08 09:58:46 -04:00
parent 79e52ee404
commit b90df4923d

View File

@@ -51,6 +51,15 @@ void setup() {
}
void loop() {
unsigned int wifiRetryCount = 0;
if (WiFi.status != WL_CONNECTED){
WiFi.reconnect();
while (WiFi.status != WL_CONNECTED){
if (wifiRetryCount++ > 5) return;
delay(1000);
}
}
if (!client.connected()) {
reconnect();
}