how to change host name from "espressif" in wifi station mode for esp32

jiangzhiyong
Posts: 1
Joined: Wed Jan 29, 2020 9:34 pm

how to change host name from "espressif" in wifi station mode for esp32

Postby jiangzhiyong » Fri Feb 07, 2020 5:29 am

I tried to change the host name which is displayed in the router after esp32 is connected to it in station mode. It is displayed as "espressif" in the router. I used esp_netif_get_hostname(esp_netif_sta_handle, (const char**)temp) and esp_netif_set_hostname(esp_netif_sta_handle, (const char*)sta_name) to check and set the name, those functions works fine and did change the name. But after the esp_wifi_start(), the hostname is changed back again back to "espressif". I tried to change the name before and after wifi_start() , and nothing works. Also these is no setting in sdkconfig to make this change. Please help. Thanks.

Aeronautic
Posts: 15
Joined: Thu Jan 02, 2020 12:07 am

Re: how to change host name from "espressif" in wifi station mode for esp32

Postby Aeronautic » Sun Feb 09, 2020 1:37 am

Code: Select all

tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_AP, WIFI_MDNS_HOSTNAME);

axellin
Posts: 200
Joined: Mon Sep 17, 2018 9:09 am

Re: how to change host name from "espressif" in wifi station mode for esp32

Postby axellin » Sun Feb 09, 2020 4:10 am

jiangzhiyong wrote:
Fri Feb 07, 2020 5:29 am
I tried to change the host name which is displayed in the router after esp32 is connected to it in station mode. It is displayed as "espressif" in the router. I used esp_netif_get_hostname(esp_netif_sta_handle, (const char**)temp) and esp_netif_set_hostname(esp_netif_sta_handle, (const char*)sta_name) to check and set the name, those functions works fine and did change the name. But after the esp_wifi_start(), the hostname is changed back again back to "espressif". I tried to change the name before and after wifi_start() , and nothing works. Also these is no setting in sdkconfig to make this change. Please help. Thanks.
I observed the same problem and report it below
https://github.com/espressif/esp-idf/issues/4737

Who is online

Users browsing this forum: Majestic-12 [Bot] and 158 guests