Setting hostname on Pico W (still) has no effect: no host name is exposed (also not the default one)
Port, board and/or hardware
Pico W
MicroPython version
MicroPython v1.26.0 on 2025-08-09; Raspberry Pi Pico W with RP2040
Reproduction
- Create a WLAN with IF_AP and set hostname via network.hostname('test') or via deprecated WLAN.config(hostname = 'test')
- Confirm that the hostname is printed as such
- Conclude that no hostname is exposed when connected to the Pico W, not even the default one (CYW43)
Expected behaviour
Expected the hostname to be exposed as set (or at least as default)
Observed behaviour
No hostname is being exposed (not even the default one)
Additional Information
According to this issue the problem was solved and closed, but that doesn't appear to be the case in reality.
Another case is here - same issue.
There is some writing of people re-building the firmware themselves whilst backing the hostname in it, but that's not a true solution for general Pico users.
See also this url.
Code of Conduct
Yes, I agree
top: Common network hostname/country configuration.
The overall goal is to allow configuration of the hostname on Pico W, but also unify the way networking works across ports. Fixes #8906, #10397
This PR adds network.hostname() and network.country() to globally set the device hostname (for all interfaces) and country (for radio compliance). For interfaces that previously supported nic.config(hostname) this will continue to work, as will pyb.country() (and rp2.country()).
Additionally configure the default hostname on a per-port and per-board basis. We may want to remove this change if it's considered a breaking change to change the default hostname?
It also updates the stm32 port to use the new cyw43-driver (in the lib/cyw43-driver submodule) and removes the old version from drivers. This relies on https://github.com/georgerobotics/cyw43-driver/pull/58.
Next steps (separate PR):
- Investigate configuring mDNS more explicitly. See #9058 and #9086 for more history.
- Implement hostname for other NICs (Nina, Wiznet) and country for all other non-cyw43 wifi (Nina, ESP8266, ESP32).
- Unify other networking config, in particular the auth and mode constants, and make it possible to write the same code on all ports to manage the WiFi interface. Eventually I'd like to remove the modnetwork customisations used by ESP8266/ESP32 and have them work like the other ports.