diff --git a/src/sheller.ino b/src/sheller.ino index 6439469..8ab1fbf 100644 --- a/src/sheller.ino +++ b/src/sheller.ino @@ -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(); }