OpenJBOD / software

MIT License
30 stars 2 forks source link

Hostname Setting #2

Open TheGuyDanish opened 3 months ago

TheGuyDanish commented 3 months ago

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.

TheGuyDanish commented 1 month ago

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.