[GH-ISSUE #1442] Restoring Persistent Wi-Fi Data on the ESP8266 #1234

Closed
opened 2026-02-28 01:29:10 +03:00 by kerem · 6 comments
Owner

Originally created by @bergutja on GitHub (Jun 28, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1442

github.com/tzapu/WiFiManager@65fec94317/WiFiManager.cpp (L3638-L3639)

I think these 2 lines of code should be like this:
if(persistent) wifi_station_get_config(&conf);
else wifi_station_get_config_default(&conf);

This resolves restoring persistent wifi data on the ESP8266.

Originally created by @bergutja on GitHub (Jun 28, 2022). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1442 https://github.com/tzapu/WiFiManager/blob/65fec943173e254c36b152867a53c23a4135c713/WiFiManager.cpp#L3638-L3639 I think these 2 lines of code should be like this: if(persistent) wifi_station_get_config(&conf); else wifi_station_get_config_default(&conf); This resolves restoring persistent wifi data on the ESP8266.
kerem 2026-02-28 01:29:10 +03:00
Author
Owner

@tablatronix commented on GitHub (Jun 28, 2022):

Resolves what? Whats the issue?

<!-- gh-comment-id:1169062322 --> @tablatronix commented on GitHub (Jun 28, 2022): Resolves what? Whats the issue?
Author
Owner

@tablatronix commented on GitHub (Jun 28, 2022):

Screen Shot 2022-06-28 at 1 16 26 PM

<!-- gh-comment-id:1169067541 --> @tablatronix commented on GitHub (Jun 28, 2022): ![Screen Shot 2022-06-28 at 1 16 26 PM](https://user-images.githubusercontent.com/807787/176254281-89b1fe03-609e-4b37-86bd-18469f7a2c09.png)
Author
Owner

@bergutja commented on GitHub (Jun 29, 2022):

Solution to: "This resolves restoring persistent wifi data on the ESP8266."

Solve the problem in the ESP8266 of loading the wifi data configured and saved via the web.
Well, every time it restarted it went into configuration mode and did not connect the saved wifi.

I understand that persistent wifi is to save the wifi and keep it on every reboot. I'm wrong?

Thank you

<!-- gh-comment-id:1169824766 --> @bergutja commented on GitHub (Jun 29, 2022): Solution to: "This resolves restoring persistent wifi data on the ESP8266." Solve the problem in the ESP8266 of loading the wifi data configured and saved via the web. Well, every time it restarted it went into configuration mode and did not connect the saved wifi. I understand that persistent wifi is to save the wifi and keep it on every reboot. I'm wrong? Thank you
Author
Owner

@tablatronix commented on GitHub (Jun 29, 2022):

I mean it has been working, noone has opened any bugs saying anything was broken. Persistent should already be working. If you are having issues with data saving, it could be corrupt flash, try a full erase, or a bug in an older version of esp library you are using

<!-- gh-comment-id:1170555637 --> @tablatronix commented on GitHub (Jun 29, 2022): I mean it has been working, noone has opened any bugs saying anything was broken. Persistent should already be working. If you are having issues with data saving, it could be corrupt flash, try a full erase, or a bug in an older version of esp library you are using
Author
Owner

@bergutja commented on GitHub (Jun 30, 2022):

If you look at the code, when the "persistent" variable is true it retrieves the default data, but if the variable is false it retrieves the saved data, shouldn't it be the other way around?
I have changed those 2 lines and now it works perfectly for me when recovering the data saved on the web, before they were continuously deleted.
Thank you and greetings.

<!-- gh-comment-id:1170835093 --> @bergutja commented on GitHub (Jun 30, 2022): If you look at the code, when the "persistent" variable is true it retrieves the default data, but if the variable is false it retrieves the saved data, shouldn't it be the other way around? I have changed those 2 lines and now it works perfectly for me when recovering the data saved on the web, before they were continuously deleted. Thank you and greetings.
Author
Owner

@tablatronix commented on GitHub (Jun 30, 2022):

wifi_station_get_config_default IS the saved data, that code i posted above is from the esp library itself in begin()

<!-- gh-comment-id:1171421948 --> @tablatronix commented on GitHub (Jun 30, 2022): `wifi_station_get_config_default` IS the saved data, that code i posted above is from the esp library itself in begin()
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#1234
No description provided.