Short background. I am migrating some stuff from ESP8266/ESP32.
When my pico W connects to the network, it has the host name 'PicoW'.
If I have a different pico W with the same .uf2, it too, is called PicoW.
Having done a little digging, I have determined that if i use -DCYW43_HOST_NAME="xyzzy" at compile time, I can get the host name for the .uf2 to be different, but of course, it is tied to the UF2.
This seems not unreasonable, but when you have multiple boards which all run the same image attaching to the same network, this can get a bit awkward.
In my own environment, I run dnsmasq, so I can mitigate this by putting dhcp-host lines into the dnsmasq configuration. This solves the problem somewhat, since I can connect to the boards by the configured name.
However, when I take the boards and put them in a different environment, where things are less under my control (such as a typical ISP's router providing DHCP/DNS services), I am back to square one.
Now in uPython, the network stuff exposes a way to get/set the host name. Is there a similar mechanism in the SDK that I have just overlooked?
Ideally, I would be able to do:
XXXXX_set_hostname( ... )
(where XXXXX is something I haven't found yet!), the get part is optional, since I should already know it!
I am pretty confident that by making small modifications to the pico_cyw43 sources in the SDK, that I can get what I want, but I don't _REALLY_ want to have to change the standard SDK - there are then potential issues when an updated SDK is released, or if the machine I use for development gets reinstalled - been there, done that (developed for WIN32 API on different releases....)
When my pico W connects to the network, it has the host name 'PicoW'.
If I have a different pico W with the same .uf2, it too, is called PicoW.
Having done a little digging, I have determined that if i use -DCYW43_HOST_NAME="xyzzy" at compile time, I can get the host name for the .uf2 to be different, but of course, it is tied to the UF2.
This seems not unreasonable, but when you have multiple boards which all run the same image attaching to the same network, this can get a bit awkward.
In my own environment, I run dnsmasq, so I can mitigate this by putting dhcp-host lines into the dnsmasq configuration. This solves the problem somewhat, since I can connect to the boards by the configured name.
However, when I take the boards and put them in a different environment, where things are less under my control (such as a typical ISP's router providing DHCP/DNS services), I am back to square one.
Now in uPython, the network stuff exposes a way to get/set the host name. Is there a similar mechanism in the SDK that I have just overlooked?
Ideally, I would be able to do:
XXXXX_set_hostname( ... )
(where XXXXX is something I haven't found yet!), the get part is optional, since I should already know it!
I am pretty confident that by making small modifications to the pico_cyw43 sources in the SDK, that I can get what I want, but I don't _REALLY_ want to have to change the standard SDK - there are then potential issues when an updated SDK is released, or if the machine I use for development gets reinstalled - been there, done that (developed for WIN32 API on different releases....)
Statistics: Posted by SteveSpencer — Wed Mar 20, 2024 12:50 pm