← index #11450PR #12360
Related · high · value 0.081
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 · PULL REQUEST

docs/library/network.rst: Clarify network.hostname.

mergedby jimmoopened 2023-09-04updated 2023-09-04
docs

This must be called before the interface connects.

This work was funded through GitHub Sponsors.

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