Page 1 of 2

Change hostname.

Posted: Sat Aug 13, 2016 11:18 am
by kurtsik
Hello.

I'm trying to change the board hostname but I can't. Please, could you tell my in which file is set?

Thanks in advance.

MODERATOR NOTE: I moved this to ESP8266 since I assume that's the board you're using?

Re: Change hostname.

Posted: Sun Aug 14, 2016 8:16 am
by pythoncoder

Re: Change hostname.

Posted: Mon Aug 15, 2016 10:09 am
by jms
I don't understand what hostname is in this context. It is a concept more heavyweight operating systems have and the normal place to read it is through os.uname()

Re: Change hostname.

Posted: Mon Aug 15, 2016 12:48 pm
by deshipu
It means what the esp8266 sends to the DHCP server on the local network when requesting an IP address.

Re: Change hostname.

Posted: Mon Aug 15, 2016 1:31 pm
by jms
Thanks. That's exactly the kind of answer that makes me happy.

Why not have the DHCP server key on MAC address instead ? The MAC addresses ought to be unique (if not you've got big trouble anyway) and all belong to a block issued to the manufacturer.

Re: Change hostname.

Posted: Mon Aug 15, 2016 1:57 pm
by deshipu
The DHCP server already gets the MAC address -- it's required by the protocol. The hostname is supposed to be a human-readable convenience, so that you can see on the router's side which address is which.

Re: Change hostname.

Posted: Mon Sep 05, 2016 10:53 am
by bguenthe
Sorry, but I'm blind. I cannot find in the documentaion from pythoncoder (http://docs.micropython.org/en/latest/e ... ckref.html?) where I can set the hostname?

Re: Change hostname.

Posted: Mon Sep 05, 2016 12:18 pm
by deshipu
I don't think you can.

Re: Change hostname.

Posted: Tue Sep 06, 2016 8:02 am
by pythoncoder
Apologies. Looking again at the doc I referenced, there's nothing.

Re: Change hostname.

Posted: Thu Sep 08, 2016 10:44 am
by bguenthe
No problem! I only wat to make shure that I didnÄt miss something.

After an internet research I found this: http://www.esp8266.com/viewtopic.php?p=22608 There is an function for setting the hostname in the ESP-SDK named wifi_station_set_hostname().

I think someone has to implement a new method in the ESP- or network- or WLAN-module? But to be hornest, this is not rellay important :D