config wifi channel in STA mode

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
MMliam
Posts: 121
Joined: Mon May 07, 2018 1:08 pm

Re: config wifi channel in STA mode

Post by MMliam » Sun Jun 26, 2022 11:07 pm

Hi davef,

After running code similar to your example, I can say with some confidence that the ESP8266 does NOT remember connection credentials between Resets; I was not able to duplicate your test results. After many Resets the ESP8266 never connected after Object-creation/Activation, it always required a ".connect" method with appropriate credentials.

On another topic:
davef, I was reviewing some recent post by Glenn regarding ESPNow, that the build originally posted as ESPNow did not actually import ESPNow.

This is the build I've been using: esp8266-1m-20210902-v1.17; is this the best build to be using for ESPNow on an ESP8266; getting quite confused on this issue?

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

Re: config wifi channel in STA mode

Post by davef » Mon Jun 27, 2022 12:02 am

... ESP8266 does NOT remember connection credentials between Resets
Which kind of resets? CTRL-D in rshell, power-off reset or any on-board reset button. I too have been quite confused about the behaviour I have seen.

I'll respond to your last question on PM.

MMliam
Posts: 121
Joined: Mon May 07, 2018 1:08 pm

Re: config wifi channel in STA mode

Post by MMliam » Mon Jun 27, 2022 1:08 am

I'm performing an on-board Reset that reboots the ESP8266.
BTW: I've seen other articles that says the ESP8266 stores the credentials in flash between reboots. Even Glenn posted a version similar to the procedure I gave you to fix the STA channel. In Glenn's post he actually performs a disconnect, of the STA without even testing to see if it's connected. Some how I have a feeling there's some misinformation going around, perhaps based on a poster's miscommunication. I could see the ESP8266 automatically restore a connection on a signal loss, but not after reboot.

When I reboot, the STA and AP objects are recreated, after I set the STA to Active I test if it's connected, and will print "Already connected". That printout never occurs; I always need to reconnect with credentials.

Very Confusing

KJM
Posts: 158
Joined: Sun Nov 18, 2018 10:53 pm
Location: Sydney AU

Re: config wifi channel in STA mode

Post by KJM » Mon Jun 27, 2022 1:12 am

Possible thread drift here Dave, but the LTE modem in the pycom gpy was a bugger for waking up thinking it was connected (when it wasn't because there was no attachment). Interested to read your post about esp32 wifi doing likewise.

Is there some timeout in a router we could adjust to keep a wifi connection to an esp32 active while the the esp32 is in deepsleep so that it wakes up still connected? Probably a dumb question but then I'm a bit ignorant of wifi nitty gritty.

Post Reply