mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1679] WiFi credentials not saved after reseting/shutting down esp32. #1425
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#1425
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 @tuadru on GitHub (Nov 21, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1679
Basic Infos
Hardware
WiFimanager Branch/Release: tried both versions 2.0.16 and 2.0.14
Esp8266/Esp32: esp32
Hardware: esp-wroom-32/esp32 devkit v1
Core Version: v3.3.5-1-g85c43024c
Description
I have tried onDemand sketch from WiFi Manager. It connects properly first time but when I reset my esp32 or turn the power off then back on it doesent connect to the network, instead I have to go into ap mode andput in credentials all over again.
Settings in IDE
Module: ESP32 Dev Module
Additional libraries:
Sketch
Debug Messages
@tuadru commented on GitHub (Nov 21, 2023):
I have just used basic sketch and apparently I need auto-reconnect function to use saved credentials to reconnect.
So I must somehow combine this with button press cause I would really like to still be able to turn AP mode on demand if I want to switch wifi networks or if credential changes?
P.S.
So what I would like for my project:
First time I turn on device I need to press button for esp to make AP and then connect to that AP and write in wifi credentials. Then I want esp to try and connect every time to those credentials (after power is off, after wifi wasnt working or available for some time). I dont want AP to be made automatically even if there is no wifi network I entered in past, only way to change credentials and wifi network would be for me to press button again. While I dont press button I want esp to try to connect on stored credentials every time it is reset or whatever.
@woodenplastic commented on GitHub (Nov 21, 2023):
Set your WiFiManager wm; before Setup.
@tuadru commented on GitHub (Nov 22, 2023):
I have put WiFi Manager wm just below int timeout = 120;
but it still works the same, it doesen't save the credentials once I restart or power off esp.
@tablatronix commented on GitHub (Nov 22, 2023):
Try full flash erase, could be corrupt flash or wrong flash size?
@Karthik-Official commented on GitHub (Feb 9, 2024):
I might have a solution, but I am not sure it would work for you. Just try if you can.
Just like yours, I too had a problem with ESP not connecting to the Wi-Fi after a reset or turned off or even go inside the config portal and click exit.
I have been trying many possible solutions like full flash erase my ESP, trying different Flash sizes and settings etc.
Then I noticed:
As you can see it does remember the name of the Wi-Fi that it connected before which means in my case, it does store the Wi-Fi credentials.
**So, I finally tried, putting
WiFiManager wm;below theint timeout = 120;just like you, and it doesn't work as you said before.Additionally I put
wm.autoConnect();just below theWiFi.mode(WIFI_STA);in the setup. Reason is because I thought if it could somehow tried to reconnect at the SETUP , it may work **Surprisingly, it worked, now even after restarting or power off, it just connects to the Wi-Fi credentials and got the IP as it should be.
This may or may not work; either way, trying is always better then give-up.
Just let everyone know whether it worked or not.
Thank you for reading this.
@tablatronix commented on GitHub (Feb 11, 2024):
Check your serial logs for auth failures some routers require a timeout before reconnect and you have to have a longer connecttimeout and multiple retries its very annoying
@lindhardt commented on GitHub (Aug 30, 2024):
You need auto connect in setup....