Reconnect Wifi after lost conneciton

This commit is contained in:
Joe Tretter
2023-09-09 14:41:31 -05:00
parent 3761b09ce1
commit 845ca37c76

View File

@@ -95,7 +95,13 @@ void setup() {
} }
void loop() { void loop() {
if (!client.connected()) { if (WiFi.status() != WL_CONNECTED) {
WiFi.disconnect();
delay(1000);
setup_wifi();
}
if ((WiFi.status() == WL_CONNECTED)&&(!client.connected())) {
reconnect(); reconnect();
} }
client.loop(); client.loop();