fix wifi reconnection issue by using enable:
onStationModeDisconnected is invoked every second and restartDelayed keeps getting postponed
This commit is contained in:
parent
e9415894ec
commit
57c2f3183b
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Wifi",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"description": "Helper classes for handling wifi connectiviy and OTA",
|
||||
"repository":
|
||||
{
|
||||
|
||||
@ -33,7 +33,7 @@ namespace Wifi {
|
||||
currentPsk = WiFi.psk();
|
||||
tReconnect.enable();
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
void setup(Scheduler& ts, void(*onConnected)() = nullptr) {
|
||||
stationConnectedHandler = WiFi.onStationModeGotIP(
|
||||
@ -47,7 +47,7 @@ namespace Wifi {
|
||||
stationDisconnectedHandler = WiFi.onStationModeDisconnected(
|
||||
[](const WiFiEventStationModeDisconnected& e) {
|
||||
Serial.println("Disconnected from network.");
|
||||
tReconnect.restartDelayed();
|
||||
tReconnect.enableIfNot();
|
||||
});
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user