Updated WiFifix

This commit is contained in:
naster_mick 2019-03-07 20:03:08 +01:00
parent f7a9223b9d
commit 43859b5b96
1 changed files with 7 additions and 2 deletions

View File

@ -106,8 +106,13 @@ void fixWiFi() {
Homie.getLogger() << "Connectivity in problematic state --> " << problemCause << "/n This remained for 2 minutes. Disconnecting WiFi to start over." << endl; Homie.getLogger() << "Connectivity in problematic state --> " << problemCause << "/n This remained for 2 minutes. Disconnecting WiFi to start over." << endl;
problemDetected = 0; problemDetected = 0;
problemCause = ""; problemCause = "";
if (WiFi.status() != 0) {
WiFi.disconnect(); WiFi.disconnect();
} }
else if (WiFi.status() == 0) {
WiFi.begin();
}
}
} }
else if (problemCount != 0 && Homie.getMqttClient().connected() || WiFi.status() == 3) { else if (problemCount != 0 && Homie.getMqttClient().connected() || WiFi.status() == 3) {
problemCount = 0; problemCount = 0;