Add explicit wifi reconnection settings

This commit is contained in:
Tanner Collin 2024-07-01 13:10:10 -06:00
parent 8b22554c94
commit a6befca199

View File

@ -114,6 +114,8 @@ void setup() {
delay(500);
Serial.print(".");
}
WiFi.setAutoReconnect(true);
WiFi.persistent(true);
Serial.println("");
Serial.println("[WIFI] Connected to the network");
@ -155,6 +157,7 @@ void loop() {
if (WiFi.status() != WL_CONNECTED) {
Serial.println("[WIFI] Lost connection. Reconnecting...");
WiFi.disconnect();
WiFi.begin(SECRET_SSID, SECRET_PASS);
return;
} else if (!mqttClient.connected()) {