mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 17:15:53 +03:00
[GH-ISSUE #1215] (Question) How to achieve high reliabilty that credentials are never lost across reboots #1038
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1038
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bwjohns4 on GitHub (Feb 18, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1215
I'm using WiFiManager in a project where I need high reliability and never want to have to redo entering in SSID/password. Sometimes when I do an OTA update, the credentials get cleared and the device stays offline if no one is around to redo the configuration page. I'm trying to understand how to save the credentials is wifimanager.autoconnect("SSID NAME") fails to try them again. Is that unnecessary? Should I store them in EEPROM after successful connection and then try to directly connect with them first before calling WiFimanager, or does the library have a better way of doing this? Right now I'm doing this, but it does not always work...
@Djmartel commented on GitHub (Feb 19, 2021):
I didn't know this was a potential issue. If it is, I need the solution also. Are you sure that it cleared the credentials? Could it have failed to connect to the WiFi network with the correct credentials? In my code if it fails to connect after a previous successful attempt I deep sleep for a bit and then try again.
@tablatronix commented on GitHub (Feb 19, 2021):
This is not a thing.
The only thing that would break credentials is changes to the ESP lib, or major verison updates, afaik config should not have broken since pre 2.3
I suspect you have something else going on
@bwjohns4 commented on GitHub (Feb 19, 2021):
How does WiFiManager keep track of the credentials? If it fails to connect to the last known network, does it not clear the known credentials in the act of establishing the config portal? I'm guessing not. So then does it try the captive portal and if that fails, then it just had never cleared the previous credentials and then just tries those again?
@tablatronix commented on GitHub (Feb 19, 2021):
Credentials are never cleared, they are stored by the esp library itself. If you have issues with wiped credentials , there is a bug in esp lib, you have corrupt flash (do full erase) , or you are explicitly clearing them eg. WiFi.disconnect()
There were some bugs a very long time ago when migrating from versions where the SDK config flash struct changed breaking this, but as I said I think this was some time ago
@bwjohns4 commented on GitHub (Feb 19, 2021):
So should I just do
while (!wifiManager.autoConnect("STARTUP"))And leave it at that? Allowing periodic option to do portal, but if no connection just keep falling back and retrying previous credentials?
@tablatronix commented on GitHub (Feb 19, 2021):
Well no I would use a configportal timeout, or never start configportal unless necessary button press or no connect for some time
Wm now has the capability to do retries and connect timers, there are also some esp bugs posted that reconnects are failing first time and some other stuff, seems to be related to some router combos