From 2966bb7d8472514c7930457e4f5d0112a9bfad5c Mon Sep 17 00:00:00 2001 From: admar Date: Sun, 5 Jun 2022 17:04:01 +0200 Subject: [PATCH] Add workaround for wifi disconnect issue --- Claire.ino | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Claire.ino b/Claire.ino index 5d01c7f..e257b2f 100644 --- a/Claire.ino +++ b/Claire.ino @@ -982,7 +982,20 @@ void loop(void) { firstTime = false; #ifndef DISABLE_WIFI - getPrecipitation(address); + if (WiFi.status() != WL_CONNECTED) { + Serial.print(millis()); + Serial.print(" wifi status error: "); + Serial.print(WiFi.status()); + Serial.print("; expected: "); + Serial.println(WL_CONNECTED); + bool result = WiFi.reconnect(); + Serial.print(millis()); + Serial.print(" reconnecting result: "); + Serial.print(result); + Serial.print("; expected: "); + Serial.println(ESP_OK); + } + getPrecipitation(address); if (counter == 0) { getAQI(address);