[GH-ISSUE #543] AutoConnectWithFSParametersAndCustomIP.ino forgets reverts to AP after power cycle #454

Closed
opened 2026-02-28 01:25:23 +03:00 by kerem · 21 comments
Owner

Originally created by @heldopsokken on GitHub (Mar 2, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/543

Hardware

WiFimanager Branch/Release: 0.12
Hardware: wemos d1 mini
Core Version: 2.4.0, staging

Description

If i use the example AutoConnectWithFSParametersAndCustomIP.ino it reverts to AP mode after a power cycle. Is this by design or am i missing something?
The custom parameters are retrieved successfully from the SPIFFS

Originally created by @heldopsokken on GitHub (Mar 2, 2018). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/543 #### Hardware WiFimanager Branch/Release: 0.12 Hardware: wemos d1 mini Core Version: 2.4.0, staging ### Description If i use the example AutoConnectWithFSParametersAndCustomIP.ino it reverts to AP mode after a power cycle. Is this by design or am i missing something? The custom parameters are retrieved successfully from the SPIFFS
kerem 2026-02-28 01:25:23 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tablatronix commented on GitHub (Mar 2, 2018):

esp8266 or esp32?
development branch?

<!-- gh-comment-id:369923847 --> @tablatronix commented on GitHub (Mar 2, 2018): esp8266 or esp32? development branch?
Author
Owner

@heldopsokken commented on GitHub (Mar 2, 2018):

esp8266, on wemos d1 mini.
using version 0.12 in arduino ide. Arduino ide version: 1.8.5

After setting the settings the JSON is succesfully written and can be read again on reboot, however if I remove the power and start the ESP again it powers up the AP again and seems to have forgotten its SSID and password.

Tried on multiple modules with the same result.

<!-- gh-comment-id:369953780 --> @heldopsokken commented on GitHub (Mar 2, 2018): esp8266, on wemos d1 mini. using version 0.12 in arduino ide. Arduino ide version: 1.8.5 After setting the settings the JSON is succesfully written and can be read again on reboot, however if I remove the power and start the ESP again it powers up the AP again and seems to have forgotten its SSID and password. Tried on multiple modules with the same result.
Author
Owner

@tablatronix commented on GitHub (Mar 2, 2018):

no idea, try development version, lots of bugs were fixed

<!-- gh-comment-id:369954350 --> @tablatronix commented on GitHub (Mar 2, 2018): no idea, try development version, lots of bugs were fixed
Author
Owner

@heldopsokken commented on GitHub (Mar 2, 2018):

tried development version. Looks totally different, but result is the same.

*WM: No saved credentials, skipping wifi *WM: Connection result: WL_NO_SSID_AVAIL *WM: lastconxresult: WL_NO_SSID_AVAIL

<!-- gh-comment-id:369968068 --> @heldopsokken commented on GitHub (Mar 2, 2018): tried development version. Looks totally different, but result is the same. `` *WM: No saved credentials, skipping wifi *WM: Connection result: WL_NO_SSID_AVAIL *WM: lastconxresult: WL_NO_SSID_AVAIL ``
Author
Owner

@tablatronix commented on GitHub (Mar 2, 2018):

sometimes config wont save if memory is corrupt, you could try erasing flash with esptool.

<!-- gh-comment-id:369987939 --> @tablatronix commented on GitHub (Mar 2, 2018): sometimes config wont save if memory is corrupt, you could try erasing flash with esptool.
Author
Owner

@heldopsokken commented on GitHub (Mar 2, 2018):

Thanks for your help. This did the trick indeed. Would love if this would be implemented inside the arduino IDE..

I do love the Wifimanager library!

<!-- gh-comment-id:370034027 --> @heldopsokken commented on GitHub (Mar 2, 2018): Thanks for your help. This did the trick indeed. Would love if this would be implemented inside the arduino IDE.. I do love the Wifimanager library!
Author
Owner

@tablatronix commented on GitHub (Mar 2, 2018):

I think there is a nodemcu flasher that has a ui that will erase also

<!-- gh-comment-id:370039643 --> @tablatronix commented on GitHub (Mar 2, 2018): I think there is a nodemcu flasher that has a ui that will erase also
Author
Owner

@heldopsokken commented on GitHub (Mar 4, 2018):

@tablatronix Thanks for the hint. I know the program. I guess I prefer the commandline tool instead. Works a lot better.

I found another issue with the WifiManager Development branch.
After saving settings it does not save the settings to spiffs.
Somehow saveconfig callback is not being set by wifimanager.

This does work in the Master branch build but there i am running into other issues.

See what happens with the development branch
*WM: Sent wifi save page *WM: Connecting to a new AP *WM: Connecting as wifi client... *WM: wifi station disconnect *WM: Connecting to new AP *WM: enableSTA PERSISTENT ON *WM: connectTimeout not set, ESP waitForConnectResult... *WM: Connection result: WL_CONNECTED *WM: lastconxresult: WL_CONNECTED *WM: Connect to new AP [SUCCESS] *WM: Got IP Address: *WM: 192.168.2.44 *WM: disconnect configportal *WM: config portal exiting

With the Master branch the SPIFFS file is being written, see below

*WM: WiFi save *WM: Parameter *WM: server *WM: mqtt.local *WM: Parameter *WM: port *WM: 8080 *WM: Parameter *WM: blynk *WM: <REMOVED> *WM: Sent wifi save page *WM: Connecting to new AP *WM: Connecting as wifi client... *WM: Connection result: *WM: 3 Should save config connected...yeey :) saving config { "mqtt_server": "mqtt.local", "mqtt_port": "8080", "blynk_token": "<REMOVED>", "ip": "192.168.2.44", "gateway": "192.168.2.254", "subnet": "255.255.255.0" }local ip
Any idea what is causing this to happen with the development build?

As mentioned earlier with with post I cannot use the master build since this does not keep wifi credentials after a power cycle. With the development branch the custom parameters are not being saved to SPIFFS after submitting values.

Thanks again for your help!

<!-- gh-comment-id:370266940 --> @heldopsokken commented on GitHub (Mar 4, 2018): @tablatronix Thanks for the hint. I know the program. I guess I prefer the commandline tool instead. Works a lot better. I found another issue with the WifiManager Development branch. After saving settings it does not save the settings to spiffs. Somehow saveconfig callback is not being set by wifimanager. This does work in the Master branch build but there i am running into other issues. See what happens with the development branch ` *WM: Sent wifi save page *WM: Connecting to a new AP *WM: Connecting as wifi client... *WM: wifi station disconnect *WM: Connecting to new AP *WM: enableSTA PERSISTENT ON *WM: connectTimeout not set, ESP waitForConnectResult... *WM: Connection result: WL_CONNECTED *WM: lastconxresult: WL_CONNECTED *WM: Connect to new AP [SUCCESS] *WM: Got IP Address: *WM: 192.168.2.44 *WM: disconnect configportal *WM: config portal exiting ` With the Master branch the SPIFFS file is being written, see below `*WM: WiFi save *WM: Parameter *WM: server *WM: mqtt.local *WM: Parameter *WM: port *WM: 8080 *WM: Parameter *WM: blynk *WM: <REMOVED> *WM: Sent wifi save page *WM: Connecting to new AP *WM: Connecting as wifi client... *WM: Connection result: *WM: 3 Should save config connected...yeey :) saving config { "mqtt_server": "mqtt.local", "mqtt_port": "8080", "blynk_token": "<REMOVED>", "ip": "192.168.2.44", "gateway": "192.168.2.254", "subnet": "255.255.255.0" }local ip ` Any idea what is causing this to happen with the development build? As mentioned earlier with with post I cannot use the master build since this does not keep wifi credentials after a power cycle. With the development branch the custom parameters are not being saved to SPIFFS after submitting values. Thanks again for your help!
Author
Owner

@tablatronix commented on GitHub (Mar 5, 2018):

The master should not also have that bug. Odd.
Ill test this, i have not yet tested hooks

<!-- gh-comment-id:370279385 --> @tablatronix commented on GitHub (Mar 5, 2018): The master should not also have that bug. Odd. Ill test this, i have not yet tested hooks
Author
Owner

@tablatronix commented on GitHub (Mar 5, 2018):

I see
callback is only called on failure and if setBreakAfterConfig true.
Ill fix tomorrow if its a bug

<!-- gh-comment-id:370296324 --> @tablatronix commented on GitHub (Mar 5, 2018): I see callback is only called on failure and if setBreakAfterConfig true. Ill fix tomorrow if its a bug
Author
Owner

@tablatronix commented on GitHub (Mar 6, 2018):

ok fixed the callback, it should be called like it was before, on save and if _shouldBreakAfterConfig , on failure

<!-- gh-comment-id:370637157 --> @tablatronix commented on GitHub (Mar 6, 2018): ok fixed the callback, it should be called like it was before, on save and if _shouldBreakAfterConfig , on failure
Author
Owner

@heldopsokken commented on GitHub (Mar 6, 2018):

Thanks! @tablatronix, This fixes the saving to SPIFFS indeed.

However I do still run into the following:
After configuring the AP via wifimanager it connects to wifi and runs the code successfully.
When i reset the device via the resetbutton it also returns to the previous configured AP.
However. If i unplug the device and leave it unpowered for several minutes and power it up again it looses the configured wifi settings and starts wifimanager again.

I guess this is not expected behavior? I tested it with several modules and cleaned the flash with esptool before.

When flashing the wifi credentials in the code this does not happen with the modules, so I am ruling out the flash to be worn out with these modules.

<!-- gh-comment-id:370841141 --> @heldopsokken commented on GitHub (Mar 6, 2018): Thanks! @tablatronix, This fixes the saving to SPIFFS indeed. However I do still run into the following: After configuring the AP via wifimanager it connects to wifi and runs the code successfully. When i reset the device via the resetbutton it also returns to the previous configured AP. However. If i unplug the device and leave it unpowered for several minutes and power it up again it looses the configured wifi settings and starts wifimanager again. I guess this is not expected behavior? I tested it with several modules and cleaned the flash with esptool before. When flashing the wifi credentials in the code this does not happen with the modules, so I am ruling out the flash to be worn out with these modules.
Author
Owner

@tablatronix commented on GitHub (Mar 6, 2018):

suggestions

add a 3 second delay at setup, WiFi.printDiag(Serial), and see what it outputs, see if your credentials are there first.

What if you unplug, replug and reset ? Could be a wifi startup race condition

<!-- gh-comment-id:370844340 --> @tablatronix commented on GitHub (Mar 6, 2018): suggestions add a 3 second delay at setup, WiFi.printDiag(Serial), and see what it outputs, see if your credentials are there first. What if you unplug, replug and reset ? Could be a wifi startup race condition
Author
Owner

@tablatronix commented on GitHub (Mar 6, 2018):

If you still can reproduce, create a new issue for this

<!-- gh-comment-id:370846137 --> @tablatronix commented on GitHub (Mar 6, 2018): If you still can reproduce, create a new issue for this
Author
Owner

@heldopsokken commented on GitHub (Mar 9, 2018):

Hi,
thanks for your answer.
with a 5 seconds delay at startup the microcontroller does not forget the stored access point.

<!-- gh-comment-id:371936852 --> @heldopsokken commented on GitHub (Mar 9, 2018): Hi, thanks for your answer. with a 5 seconds delay at startup the microcontroller does not forget the stored access point.
Author
Owner

@tablatronix commented on GitHub (Mar 9, 2018):

That is odd, it should not take that long to startup wifi and it should happen before setup

<!-- gh-comment-id:371938638 --> @tablatronix commented on GitHub (Mar 9, 2018): That is odd, it should not take that long to startup wifi and it should happen before setup
Author
Owner

@tablatronix commented on GitHub (Mar 9, 2018):

do you have a simple sketch ?
Does it happen with autoconnect example?

<!-- gh-comment-id:371943545 --> @tablatronix commented on GitHub (Mar 9, 2018): do you have a simple sketch ? Does it happen with autoconnect example?
Author
Owner

@heldopsokken commented on GitHub (Mar 9, 2018):

I will check this weekend. My sketch is based on the example sketch with custom variables. My hunch is that it is this combination which is causing this behavior.

<!-- gh-comment-id:371972504 --> @heldopsokken commented on GitHub (Mar 9, 2018): I will check this weekend. My sketch is based on the example sketch with custom variables. My hunch is that it is this combination which is causing this behavior.
Author
Owner

@tablatronix commented on GitHub (Mar 9, 2018):

Are you using static ip?

<!-- gh-comment-id:371976442 --> @tablatronix commented on GitHub (Mar 9, 2018): Are you using static ip?
Author
Owner

@heldopsokken commented on GitHub (Mar 22, 2018):

Hi, Sorry for the large delay. Was a bit occupied last weeks. I do not use static IP.

<!-- gh-comment-id:375247404 --> @heldopsokken commented on GitHub (Mar 22, 2018): Hi, Sorry for the large delay. Was a bit occupied last weeks. I do not use static IP.
Author
Owner

@tablatronix commented on GitHub (Mar 22, 2018):

Can you create a new issue for this particular issue with code if you have

<!-- gh-comment-id:375283079 --> @tablatronix commented on GitHub (Mar 22, 2018): Can you create a new issue for this particular issue with code if you have
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#454
No description provided.