← index #7179Issue #11546
Related · high · value 1.237
QUERY · ISSUE

Missing country settings for ESP WIFI

openby karfasopened 2021-04-28updated 2024-09-13
enhancementport-esp32

In micropython, there is no way to define in which country the ESP WIFI transmitters operate.
This might create legal problems for anyone using the ESP devices and micropython "out of the box".

The ESP-IDF function call is esp_wifi_set_country(), described in https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/wifi.html#wi-fi-country-code.

Current uPy sources have no call to esp_wifi_set_country() - I searched *.[hc] for it.

The issue had been discussed in https://forum.micropython.org/viewtopic.php?f=18&t=10388

CANDIDATE · ISSUE

docs: network.WLAN in STA_IF mode: which parameters are persistent?

closedby massimosalaopened 2023-05-18updated 2023-05-18

I hit the problem on esp8266, but it is primarly a lack of documentation.

Example: this basic code to init the micro as Wifi client:

network.country("it")
WIFI = network.WLAN(network.STA_IF)
WIFI.config(dhcp_hostname = "test")
WIFI.connect(ssid, pwd)

From the docs I read

ESP8266 automatically reconnects to the last Access Point when STA_IF is active, even after reboot/reset

Indeed after a reboot the ESP will auto-reconnect the the access point.
But

  • It has lost the hostname: in the router I see the factory default "ESP_xxx" (where xxx seems to be the machine unique id).

  • I don't know about the country setting, if it is persistent between reboots.
    I haven't the radio equiment to check the esp radio emissions, regarding WiFi compliance to national requirements.

Questions:

  1. Is it confirmed the esp8266 store only the SSID and password ?
  2. Is this a behaviour of the esp8266 of also on other micros, like esp32 ?
  3. At power up, is it possible to mantain the working WiFi connection and set the hostname?
  4. which country codes are supported by network.country() ?

I cannot find hints.
Please anybody point me to the docs - - or how can we improve the existing ones.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied