network.country availability
Hi
Please see
https://github.com/orgs/micropython/discussions/11548
@glenn20 wrote:
Oh, I nearly forgot.... re. Question 4... the country setting is not currently used for micropython on the esp8266. In fact, it is only used currently for the cyw43 wifi driver (eg. the rpi pico-w).
I've wasted time reading docs, finding a function, coding with it... and finding out it doesn't work because it's not implemented!
I kindly but firmly ask you to remove this function on all micros where it is a No Operation.
It will save confusion and frustration for all other developers as well.
I've been trying to set up a PR, but it seems I don't have the privilege.
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.