change the name of the device in STA mode

User avatar
brp80000
Posts: 138
Joined: Thu Oct 04, 2018 7:13 pm

change the name of the device in STA mode

Postby brp80000 » Wed Jan 30, 2019 12:23 am

How can I change the device name in STA mode. I see the name "espressif" now.
ddd.jpg
ddd.jpg (29.06 KiB) Viewed 16785 times

chillophil
Posts: 4
Joined: Tue Jan 29, 2019 6:05 am

Re: change the name of the device in STA mode

Postby chillophil » Wed Jan 30, 2019 2:13 am

Hey,

it's not quite clear what your screenshot is showing and I don't know the exact issue. I guess it's showing physical devices currently connected to your AP?

In that case, the shown device names probably rather identify your devices manufacturers (by MAC address OUI) than hostnames and you won't be able to change that. MAC addresses starting with OUI (organizationally unique identifier) 30:A8:DB are owned by Sony, those starting with OUI 30:AE:A4 are owned by Espressif - you can easily look that up for your own if you want to.

But if it shows hostnames (by DHCP), maybe give

tcpip_adapter_set_hostname(...)

Code: Select all

esp_err_t tcpip_adapter_set_hostname(tcpip_adapter_if_t tcpip_if, const char *hostname);
a try

User avatar
brp80000
Posts: 138
Joined: Thu Oct 04, 2018 7:13 pm

Re: change the name of the device in STA mode

Postby brp80000 » Thu Jan 31, 2019 5:51 am

its don`t work
ESP_ERROR_CHECK(tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_STA, "ULA"));
device name still "Espressif "

ESP_Sprite
Posts: 9772
Joined: Thu Nov 26, 2015 4:08 am

Re: change the name of the device in STA mode

Postby ESP_Sprite » Thu Jan 31, 2019 7:18 am

Sounds like the thing shows the owner of the MAC address (the default hostname for Espressif devices is ESP-xxxx, not Espressif). No way to change that, apart from perhaps getting your own OUI from the IEEE so you can give out your own MAC addresses...

User avatar
brp80000
Posts: 138
Joined: Thu Oct 04, 2018 7:13 pm

Re: change the name of the device in STA mode

Postby brp80000 » Thu Jan 31, 2019 8:07 am

How to change?
ddd.jpg
ddd.jpg (71.97 KiB) Viewed 16701 times

ESP_Sprite
Posts: 9772
Joined: Thu Nov 26, 2015 4:08 am

Re: change the name of the device in STA mode

Postby ESP_Sprite » Fri Feb 01, 2019 2:52 am

Hmm, seems it's indeed not MAC-related. In that case, tcpip_adapter_set_hostname should change the id. No idea what else the name could come from, perhaps you can ask your router manufacturer?

User avatar
jiapei100
Posts: 2
Joined: Wed Sep 14, 2016 5:08 am

Re: change the name of the device in STA mode

Postby jiapei100 » Fri Aug 23, 2019 8:42 pm

Same question here... I actually tried to connect multiple esp32-cams with the router, but EVERY unit is named as espressif, which seems to be problematic:

The FIRST device connected in will block the rest with the Destination Host Unreachable message.

What's your symptom?
And have you solved this by rename the device name ? For instance:
  • expressif1
  • espressif2
  • espressif3
  • etc.
Longer Vision Technology

Rainwater
Posts: 1
Joined: Sat Jun 13, 2020 4:31 pm

Re: change the name of the device in STA mode

Postby Rainwater » Sat Jun 13, 2020 5:01 pm

Have you tried changing the `Local netif hostname` in the `menuconfig` option?


"idf.py menuconfig"

Found in the "Component config" -> "LWIP"

some esp dev guy
Posts: 2
Joined: Wed Aug 21, 2024 12:08 pm

Re: change the name of the device in STA mode

Postby some esp dev guy » Sun Sep 01, 2024 3:12 pm

after

Code: Select all

esp_netif_init();
esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta();
you can change hostname

Code: Select all

esp_netif_set_hostname(sta_netif, "my tiny daemon");

Who is online

Users browsing this forum: dg9ngf and 101 guests