fix wifi reconnection event

This commit is contained in:
Nicu Hodos 2021-12-09 12:29:21 +01:00
parent eacf73f450
commit 5949a90324

View File

@ -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();
}