# How to set WIFI client device name?

**URL:** <https://forum.amebaiot.com/t/how-to-set-wifi-client-device-name/3743>\
**Category:** WiFi\
**Tags:** rtl872xd\
**Created:** [January 21, 2025, 4:29pm UTC](https://forum.amebaiot.com/t/how-to-set-wifi-client-device-name/3743 "2025-01-21T16:29:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![airista\_islavov](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@airista\_islavov](https://forum.amebaiot.com/u/airista_islavov)\
**Post date:** [January 21, 2025, 4:29pm UTC](https://forum.amebaiot.com/t/how-to-set-wifi-client-device-name/3743/1 "2025-01-21T16:29:08Z")

</div>

By default, when connected to AP, AP shows “UNKNOWN” as “client name”.  
How can the client name be set?

Thanks,  
Ivan Slavov

---

<div class="post-metadata">

**Author:** ![Kelvin\_Huang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/kelvin_huang/32/2130_2.png) [@Kelvin\_Huang](https://forum.amebaiot.com/u/Kelvin_Huang)\
**Post date:** [January 22, 2025, 3:03am UTC](https://forum.amebaiot.com/t/how-to-set-wifi-client-device-name/3743/2 "2025-01-22T03:03:08Z")

</div>

Hi @airista_islavov,

Before calling the WiFi.begin API, could you try calling the API WiFi.setHostName($Your device name)?

Thank you.

---

<div class="post-metadata">

**Author:** ![airista\_islavov](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@airista\_islavov](https://forum.amebaiot.com/u/airista_islavov)\
**Post date:** [January 22, 2025, 3:41pm UTC](https://forum.amebaiot.com/t/how-to-set-wifi-client-device-name/3743/3 "2025-01-22T15:41:48Z")

</div>

Hi,  
This seems Arduino reference code.

I am using the Ameba SDK and GCC, so I need the API in the SDK context.  
This is where I thought I would find the API to call to set the host name:

> **[ameba-rtos-d/component/common/api/wifi at main · Ameba-AIoT/ameba-rtos-d](https://github.com/Ameba-AIoT/ameba-rtos-d/tree/main/component/common/api/wifi)**
>
> AmebaD SoC SDK. Contribute to Ameba-AIoT/ameba-rtos-d development by creating an account on GitHub.

I browsed all header files and I don’t see anything “host” related.  
Thanks,  
Ivan S.

---

<div class="post-metadata">

**Author:** ![Kelvin\_Huang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/kelvin_huang/32/2130_2.png) [@Kelvin\_Huang](https://forum.amebaiot.com/u/Kelvin_Huang)\
**Post date:** [January 24, 2025, 8:10am UTC](https://forum.amebaiot.com/t/how-to-set-wifi-client-device-name/3743/4 "2025-01-24T08:10:18Z")

</div>

Hi @airista_islavov,

I believe you can try to set it with the lwip API. [ameba-rtos-d/component/common/network/lwip/lwip\_v2.0.2/src/include/lwip/netif.h at main · Ameba-AIoT/ameba-rtos-d · GitHub](https://github.com/Ameba-AIoT/ameba-rtos-d/blob/main/component/common/network/lwip/lwip_v2.0.2/src/include/lwip/netif.h).

First define lwip hostname support in your lwipopts.h.  
`#define LWIP_NETIF_HOSTNAME 1 // Enable hostname`

Then try to call the function netif\_set\_hostname in line 433 of the file attached above.

Hope this helps.

Thank you.

---

<div class="post-metadata">

**Author:** ![airista\_islavov](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@airista\_islavov](https://forum.amebaiot.com/u/airista_islavov)\
**Post date:** [January 28, 2025, 2:40pm UTC](https://forum.amebaiot.com/t/how-to-set-wifi-client-device-name/3743/5 "2025-01-28T14:40:45Z")

</div>

> [@Kelvin\_Huang](#):
>
> netif\_set\_hostname

Thank you Kelvin! it worked!
