Skip to content

Commit

Permalink
Correct Wlan SSDI in log and use same hostname ("bsc") for MDNS and D…
Browse files Browse the repository at this point in the history
…NS as well.
  • Loading branch information
do13 committed Mar 13, 2023
1 parent 382cbb4 commit 55950f7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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());

Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit 55950f7

Please sign in to comment.