← index #11450Issue #2875
Related · high · value 0.299
QUERY · ISSUE

network.hostname() seems useless... does mDNS work?

openby massimosalaopened 2023-05-09updated 2024-06-18
bug

Current target: esp8266

On the official docs:
https://docs.micropython.org/en/latest/library/network.html

network.hostname([name])
Get or set the hostname that will identify this device on the network. It is applied to all interfaces.
This hostname is used for:
Sending to the DHCP server in the client request. (If using DHCP)
Broadcasting via mDNS. (If enabled)

It seems to me that there are no references in the esp8266 pages regarding this function:
https://docs.micropython.org/en/latest/esp8266/quickref.html

I tried to use network.hostname() both before and after the wifi initialization (AF_STA mode), but it doesn't seem to work.

With a packet sniffer, enabled in promiscuous mode on the wifi interface, I see the packets (also broadcast and multicast) of other devices but not the packets that esp8266 should send to publish its hostname.

I'm specifically interested in mDNS.

I am available for any test and feedback.

CANDIDATE · ISSUE

mDNS support for ESP8266?

closedby janfredslundopened 2017-02-15updated 2017-05-06

It doesn't seem to be possible to assign a hostname to a device on the local network, so you can connect to it via webREPL instead of setting a static IP or configure the router's DHCP. On the Arduino core for ESP8266 you can use the mDNS library.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied