← index #2569Issue #11546
Related · high · value 0.186
QUERY · ISSUE

Access point interface active without being noticed

openby kfrickeopened 2016-10-28updated 2024-09-19
port-esp8266needs-info

After flashing my ESP modules with the current version of MicroPython i use to transfer the modules and scripts I need to run on them using the glorious mpfshell. Of course various bigger modules need to be brought onto the ESP as precompiled bytecode. So there is the common workflow of deploying my script and all of its dependencies.
The programs i run on the ESP are all connecting to my wireless network and do communicate with my home servers. Therefore they are set up as wireless stations (clients).

What I just noticed is that my ESP modules are still acting as an access point. They got introduced to start this when they were initially booting their first MicroPython code.Then the inisetup.py does configure a access point with the name "MicroPython-%s" % ubinascii.hexlify(ap_if.config("mac")[-3:]). This is only because the access point interface has written it's state to the flash of the ESP module.
I have never cared about it and not even thought about that it might happen. All just because the initial state written by the inisetup.py was persisted into the flash of the ESP and so the acces point interface always gets initialized when the ESP module does start up. Just because I did never actively deactivate it.

You might say "Know your tools!" or "ESPs did this even before MicroPython!". But I bet that this does happen to a lot of people unnoticed and should be reviewed.

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