From 521c7ca3071f1e2adec98c2fdaa6614b7c627efb Mon Sep 17 00:00:00 2001 From: lumapu Date: Sun, 2 Apr 2023 00:08:06 +0200 Subject: [PATCH] 0.6.1 * potential fix of WiFi hostname during boot up #752 --- src/CHANGES.md | 1 + src/wifi/ahoywifi.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index 9df7d29c..0a2613ae 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -3,3 +3,4 @@ ## 0.6.1 - 2023-04-01 * merge LED fix - LED1 shows MqTT state, LED configureable active high/low #839 * only publish new inverter data #826 +* potential fix of WiFi hostname during boot up #752 diff --git a/src/wifi/ahoywifi.cpp b/src/wifi/ahoywifi.cpp index 0acdf9e2..9677e7ee 100644 --- a/src/wifi/ahoywifi.cpp +++ b/src/wifi/ahoywifi.cpp @@ -1,6 +1,6 @@ //----------------------------------------------------------------------------- -// 2023 Ahoy, https://www.mikrocontroller.net/topic/525778 -// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/ +// 2023 Ahoy, https://ahoydtu.de +// Creative Commons - https://creativecommons.org/licenses/by-nc-sa/4.0/deed //----------------------------------------------------------------------------- #if defined(ESP32) && defined(F) @@ -160,6 +160,9 @@ void ahoywifi::setupAp(void) { DBGPRINTLN(mApIp.toString()); DBGPRINTLN(F("---------\n")); + if(String(mConfig->sys.deviceName) != "") + WiFi.hostname(mConfig->sys.deviceName); + WiFi.mode(WIFI_AP_STA); WiFi.softAPConfig(mApIp, mApIp, IPAddress(255, 255, 255, 0)); WiFi.softAP(WIFI_AP_SSID, WIFI_AP_PWD);