fix wifi reconnection event
This commit is contained in:
parent
eacf73f450
commit
5949a90324
@ -10,9 +10,9 @@ namespace Wifi {
|
||||
String currentPsk;
|
||||
|
||||
void setup() {
|
||||
stationConnectedHandler = WiFi.onStationModeConnected([](const WiFiEventStationModeConnected& e) {
|
||||
stationConnectedHandler = WiFi.onStationModeGotIP([](const WiFiEventStationModeGotIP& e) {
|
||||
Serial.println("Reconnected to network.");
|
||||
wifiConnected.signal();
|
||||
tWifiConnected.restart();
|
||||
});
|
||||
|
||||
WiFi.hostname("esp-clock");
|
||||
@ -25,7 +25,6 @@ namespace Wifi {
|
||||
while (wifiMulti.run() != WL_CONNECTED) {
|
||||
delay(500);
|
||||
}
|
||||
Serial.println("Connected to network.");
|
||||
currentSSID = WiFi.SSID();
|
||||
currentPsk = WiFi.psk();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user