Skip to content

Commit

Permalink
Merge pull request #34 from do13/wlanssid_fix_set_dns_name
Browse files Browse the repository at this point in the history
Correct Wlan SSDI in log and use same hostname ("bsc") for MDNS and DNS as well
  • Loading branch information
shining-man authored Mar 14, 2023
2 parents 382cbb4 + 55950f7 commit 126bd81
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 126bd81

Please sign in to comment.