Chat freely about anything...

User avatar
By martinayotte
#22599 Not exactly ! in most systems, the DHCP client config has an option which tell it to send its hostname to the DHCP server, that allow the server to place that in its log files. This option is the following in linux /etc/dhcp/dhcpclient.conf :

Code: Select allsend host-name "<hostname>";


But, unfortunately, the ESPs are not Linux machine, so the tiny DHCP client coded in Espressif libraries doesn't not provide such functionality. They could have added such feature, but it is simply not there. Maybe you can submit a request to them, they will maybe add it in future firmware ...
User avatar
By kolban
#22605 Looking in the ESP8266 SDK Programming Guide 1.2, I see two APIs ... one called:

wifi_station_get_hostname()

and one called

wifi_station_set_hostname(char *name)

It might be that these will work.

I'm afraid I'd missed the story on my last post. I had assumed (wrongly) that we were talking about DNS and not about DHCP (which I know nothing about).
User avatar
By martinayotte
#22608 Ah ! this is good news ! Yes, those are the things David was looking at.
(Maybe I missed that one with the tons of SDK updates)
About DNS, it's sure that a DHCP can provide the new hostnames to a DNS, but it requires to have those setup to talk each other.
User avatar
By PaulRB
#45181 I can see on my router that the esp does have a client name. For example:

ESP_104D87

The router can't know that the client is an esp chip, so the name must have come from the esp itself. The hex digits at the end of the name are the last 3 bytes of its mac address.