diff --git a/src/main.cpp b/src/main.cpp index 6297384..825defd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -95,7 +95,13 @@ void setup() { } void loop() { - if (!client.connected()) { + if (WiFi.status() != WL_CONNECTED) { + WiFi.disconnect(); + delay(1000); + setup_wifi(); + } + + if ((WiFi.status() == WL_CONNECTED)&&(!client.connected())) { reconnect(); } client.loop();