WIFI start AP without being initialized

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
nedoskiv
Posts: 20
Joined: Fri Jan 18, 2019 10:48 am

WIFI start AP without being initialized

Post by nedoskiv » Thu Feb 10, 2022 2:58 pm

Hello,
I start to use esp8266,
making kind a init scripts for wireless, etc. I tested my init/config scripts, they just used to initialize wifi in AP or STATION mode with given SSID, password. They looks fine, except that I realize AP mode is started always with last settings I give for AP.
I run statoion mode, AP is present. I even delete all files from board and power it up, AP come online and I can connect to it.
Did I miss something?

OH I forgot, used version is:
MicroPython v1.18 on 2022-01-17; ESP module with ESP8266

P.S.
tested with:
MicroPython v1.10-8-g8b7039d7d on 2019-01-26; ESP module with ESP8266
same result.

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: WIFI start AP without being initialized

Post by davef » Thu Feb 10, 2022 6:37 pm

I see that in my ESP32 code I have:

Code: Select all

import network

sta_if = network.WLAN(network.STA_IF) # create station interface
ap_if = network.WLAN(network.AP_IF) #  create access-point interface

def connect():

 #  disconnects AP if it is up
    ap_if.active(False) #  de-activate the AP interface
    
    now connect to station-mode
which I think is a hold-over from my work with the ESP8266. I have read a comment on the forum that either the ESP8266 or ESP32 starts in AP mode.

nedoskiv
Posts: 20
Joined: Fri Jan 18, 2019 10:48 am

Re: WIFI start AP without being initialized

Post by nedoskiv » Fri Feb 11, 2022 6:58 am

question is how it remember ssid and password that was set once.
meanwhile I tested same code on esp32, no such issue.

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: WIFI start AP without being initialized

Post by davef » Fri Feb 11, 2022 7:23 am

At the Micropython application level variables can be saved to RTC memory. I suspect that at the under-lying ESP RTOS level that variables can be stored somewhere as well.

nedoskiv
Posts: 20
Joined: Fri Jan 18, 2019 10:48 am

Re: WIFI start AP without being initialized

Post by nedoskiv » Fri Feb 11, 2022 1:07 pm

I tested with another device (wemos D1 mini)
all files from filesystem are deleted, disconnect it from power source, connect it again and AP is up with last settings that it was configured,
in additional, I create a STA_IF, and try to set .active(False)
check and it was set to false, AP is still up, I can connect to it and ping the device

Post Reply