mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #543] AutoConnectWithFSParametersAndCustomIP.ino forgets reverts to AP after power cycle #454
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#454
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 @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
@tablatronix commented on GitHub (Mar 2, 2018):
esp8266 or esp32?
development branch?
@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.
@tablatronix commented on GitHub (Mar 2, 2018):
no idea, try development version, lots of bugs were fixed
@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@tablatronix commented on GitHub (Mar 2, 2018):
sometimes config wont save if memory is corrupt, you could try erasing flash with esptool.
@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!
@tablatronix commented on GitHub (Mar 2, 2018):
I think there is a nodemcu flasher that has a ui that will erase also
@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 exitingWith 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 ipAny 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!
@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
@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
@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
@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.
@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
@tablatronix commented on GitHub (Mar 6, 2018):
If you still can reproduce, create a new issue for this
@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.
@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
@tablatronix commented on GitHub (Mar 9, 2018):
do you have a simple sketch ?
Does it happen with autoconnect example?
@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.
@tablatronix commented on GitHub (Mar 9, 2018):
Are you using static ip?
@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.
@tablatronix commented on GitHub (Mar 22, 2018):
Can you create a new issue for this particular issue with code if you have