fix setting the hostname

This commit is contained in:
Nicu Hodos 2022-01-01 11:50:21 +01:00
parent cccb6c9a97
commit 9bb11299d2

View File

@ -16,10 +16,9 @@ namespace Wifi {
tWifiConnected.restart();
});
WiFi.hostname("esp-clock");
ESP8266WiFiMulti wifiMulti;
for (int i = 0; i < sizeof(credentials)/sizeof(WifiCredentials); i++) {
for (uint32_t i = 0; i < sizeof(credentials) / sizeof(WifiCredentials); i++) {
wifiMulti.addAP(credentials[i].ssid, credentials[i].password);
}
@ -27,6 +26,7 @@ namespace Wifi {
while (wifiMulti.run() != WL_CONNECTED) {
delay(500);
}
WiFi.setHostname("esp-clock");
currentSSID = WiFi.SSID();
currentPsk = WiFi.psk();
}