From d9b5b0093edb3bc40a069a49b5c6c2c69997b264 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Sat, 1 Jan 2022 11:50:21 +0100 Subject: [PATCH] fix setting the hostname --- include/wifi.h | 4 ++-- platformio.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/wifi.h b/include/wifi.h index 812a6f3..47713f1 100644 --- a/include/wifi.h +++ b/include/wifi.h @@ -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(); } diff --git a/platformio.ini b/platformio.ini index 47ac5a1..6831f26 100644 --- a/platformio.ini +++ b/platformio.ini @@ -28,5 +28,5 @@ build_flags = -D IR=1 -D WIFI_ALWAYS_ON=1 [env:laptop_home] [env:ota_home] -upload_port = 192.168.5.191 +upload_port = esp-clock upload_protocol = espota