You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 14, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 14, 2026. It is now read-only.
Currently, setting network.hostname() does not actually set a hostname that gets picked up in DHCP. I have not done a packet dump to investigate why, but I assume the WIZNET5K driver used in MicroPython ignores the setting when sending DHCP requests. Other MicroPython implementations of the W5500 exists where DHCP is handled outside of the built-in driver, likely fixing the issue, but developing an entire W5500 driver just for DHCP hostnames seems a bit extreme.
It doesn't seem like there's a register in the W5500 that stores a hostname, so any use of the hostname would have to be done in software, likely requiring the efforts like in the above example.
I did some testing on the different implementation and while it works, it doesn't use the Pico Unique ID function to generate a MAC. This can be replicated though. The bigger issue is that asyncio (used by Microdot) uses the built-in socket library, where this custom implementation provides its own socket.
I don't know if you're still interested in this issue now that the C version is pretty much ready, but I stumbled on something today...
Try changing this, so the hostname is set first:
def w5500_init(spi):
nic = network.WIZNET5K(spi, Pin(5), Pin(0)) # Bus, CSn, RSTn
# Setting the hostname currently does nothing.
# See https://github.com/OpenJBOD/software/issues/2
network.hostname(CONFIG["network"]["hostname"])
The MicroPython docs say "... you must set the hostname before activating/connecting your network interfaces."
This did the trick for me in another project (that's based on this one), however I am using a different microcontroller and Ethernet device, so not sure it applies here. Maybe worth trying.
Activity
TheGuyDanish commentedon Oct 9, 2024
I did some testing on the different implementation and while it works, it doesn't use the Pico Unique ID function to generate a MAC. This can be replicated though. The bigger issue is that asyncio (used by Microdot) uses the built-in
socketlibrary, where this custom implementation provides its own socket.DaveCorder commentedon Mar 5, 2026
I don't know if you're still interested in this issue now that the C version is pretty much ready, but I stumbled on something today...
Try changing this, so the hostname is set first:
to:
The MicroPython docs say "... you must set the hostname before activating/connecting your network interfaces."
This did the trick for me in another project (that's based on this one), however I am using a different microcontroller and Ethernet device, so not sure it applies here. Maybe worth trying.