-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
network.hostname() seems useless... does mDNS work? #11450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The ESP8266 port does not support mDNS. In this port, |
@jimmo Thanks for your clarification. Two considerations:
I don't know if the lead developers will take notice or should I raise this issue...how? |
Addendum: I open a documentation issue. |
It's just a matter of doing the work. We would welcome a PR to add mDNS to the ESP8266 port.
https://docs.micropython.org/en/latest/library/network.html#network.hostname I guess the "(If enabled)" is doing some heavy lifting here and it would be good to list the ports that do and don't support mDNS. In #11545 you suggested that it should return NotImplemented and that it's useless. This is not true -- on all ports, including ESP8266, it sets the hostname that is sent with the DHCP client request. (Or at least it's supposed to, if you're seeing otherwise please let us know). |
Mmh please read also
I wrote it in Python and it's a few lines of code; they're just UDP socket calls, nothing low-level, specific to the ESP8266. |
Addition: For target ESP32 (I am using an Olimex ESP32-POE Rev. B) I am able to set my own hostname:
This hostname will be sent with the DHCP request when using Wifi (network.WLAN) but it will be ignored when using Ethernet (network.LAN - in that case the hostname used by DHCP is always "ESP32-POE" - which would be the name of the Olimex device. I'm sorry I have no idea who does the porting etc. Olimex only seems to offer Arduino code if I am not mistaken. |
There are daily builds available for the Olimex ESP32-POE boards. I can look into the hostname part. |
Oh wow that would be awesome! Many thanks! |
Hi folks! I confirm the problem on esp8266. The first time I get the Wifi credentials from user input (on a web page) and I enable the STA_IF:
On the cell-phone (hotspot) or on the router I can see the micro listed with my hostname. After resetting the esp8266, it reconnects by itself to the AP (I see the WiFi credentials are stored in flash) but the hostname was the default ESP_xxxxx (derived from the machine unique id). I am using this code:
This doesn't work, the hostname is ESP_xxxxx. Reading old posts about issues with the background LWIP tasks, I also tried inserting calls to time.sleep_ms(20) and machine.idle() between every micropython instructions. Please can you help me to troubleshoot this issue? Best regards, Massimo |
Did you discover something about hostname on wired boards? In the last weeks I got a wiznet 5500. I have the two spare parts (rp2 and w5500) and I wired them exactly as W5500_EVB_PICO The firmware is working... except hostname @hagenbuch Andreas, which network chip does your olimex board use? |
When I use it with Tasmota, it reads: ESP32-D0WDQ6 v1.0. Flash size: 4 MB. |
Current target: esp8266
On the official docs:
https://docs.micropython.org/en/latest/library/network.html
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.
The text was updated successfully, but these errors were encountered: