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:
1 parent
4b1f09b06b
commit
7384455fb9
1 file changed
+5
-1
+5
-1
@@ -475,7 +475,11 @@ void reconnect() {
|
|||||||
}
|
}
|
||||||
trc(F("failed, rc="));
|
trc(F("failed, rc="));
|
||||||
trc(client.state());
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user