Skip to content

Commit 7384455

Browse files
authored
Improve Wifi automatic reconnect for ESP32 (#504)
* do not launch a ble scan if mqtt client is disconnected * add wifi.begin when disconnected espressif/arduino-esp32#2501
1 parent 4b1f09b commit 7384455

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main/main.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,11 @@ void reconnect() {
475475
}
476476
trc(F("failed, rc="));
477477
trc(client.state());
478-
delay(10000);
478+
delay(5000);
479+
// On ESP32 force wifi begin https://github.com/espressif/arduino-esp32/issues/2501
480+
#if defined(ESP32)
481+
WiFi.begin();
482+
#endif
479483
}
480484
}
481485
}

0 commit comments

Comments
 (0)