Improve Wifi automatic reconnect for ESP32 (#504)

* do not launch a ble scan if mqtt client is disconnected

* add wifi.begin when disconnected

https://github.com/espressif/arduino-esp32/issues/2501
This commit is contained in:
Florian authored and GitHub committed 2019-12-07 13:45:10 +01:00
1 parent 4b1f09b06b
commit 7384455fb9
1 file changed
+5 -1
+5 -1
View File
@@ -475,7 +475,11 @@ void reconnect() {
}
trc(F("failed, rc="));
trc(client.state());
delay(10000);
delay(5000);
// On ESP32 force wifi begin https://github.com/espressif/arduino-esp32/issues/2501
#if defined(ESP32)
WiFi.begin();
#endif
}
}
}