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