From 55950f733cb717f59e775ad6a0e64c6615e504ea Mon Sep 17 00:00:00 2001 From: Dirk Opfer Date: Mon, 13 Mar 2023 21:29:39 +0100 Subject: [PATCH] Correct Wlan SSDI in log and use same hostname ("bsc") for MDNS and DNS as well. --- src/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c2bb486..3072595 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -103,6 +103,7 @@ static String str_lWlanPwd; static uint16_t u16_lWlanConnTimeout; static boolean bo_lWlanNeverAp; static unsigned long wlanConnectTimer; +static const char *hostname = {"bsc"}; // void task_ble(void *param); @@ -165,7 +166,8 @@ boolean connectWiFi() if(!str_lWlanSsid.equals("") && !str_lWlanPwd.equals("")) { - ESP_LOGI(TAG, "Verbindung zu %s",str_lWlanSsid); + ESP_LOGI(TAG, "Verbindung zu %s",str_lWlanSsid.c_str()); + WiFi.setHostname(hostname); WiFi.mode(WIFI_STA); WiFi.begin(str_lWlanSsid.c_str(), str_lWlanPwd.c_str()); @@ -845,8 +847,7 @@ void setup() connectWiFi(); ESP_LOGI(TAG, "Init WLAN...ok"); - char dns[30] = {'b','s','c'}; - if (MDNS.begin(dns)) + if (MDNS.begin(hostname)) { ESP_LOGI(TAG, "MDNS responder gestartet"); }