mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #245] WiFi credentials entered in captive portal are not remanent upon ESP reset #204
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#204
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 @croisez on GitHub (Nov 18, 2016).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/245
Hi,
I use WiFiManager 0.12.0, and esp8266 Arduino board add-on version 2.3.0.
I use a generic esp8266 module (an ESP12-F).
I want to use WiFiManager as fallback when the AP is OFF.
After having entered my SSID and pwd in the captive portal, the ESP switches in STA mode and succeeds in connecting to my AP.
But after that, whenever I reset the ESP (by forcing the RESET to zero), I expect the previously entered credentials to be used, but no. The ESP fails in STA mode and go back to captive portal.
Here is the traces I see on screen, on reboot after the RESET:
*WM:
*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
*WM: Connection result:
*WM: 0
*WM: SET AP STA
...
What is the meaning of Connection result: 0??
Why?
@croisez commented on GitHub (Nov 18, 2016):
I use now setConnectTimeout(45) to give more chance for a possible connection.
I also have WiFi.persistent(true) in my code.
We see here traces of WifiManager in ESP. I added print out of RSSI during the connection process.
When connection fails, RSSI always stay at value 31, while on success, I get negatives values.
_WM:
*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
*WM: Waiting for connection result with time out
31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,_WM: Connection timed out
_WM: Connection result:
*WM: 0
*WM: SET AP STA
Entered AP config mode
192.168.4.1
*WM: Configuring access point...
*WM: AP IP address:
*WM: 192.168.4.1
*WM: HTTP server started
*WM: Handle root
*WM: Request redirected to captive portal
*WM: Handle root
*WM: Request redirected to captive portal
*WM: Handle root
*WM: Request redirected to captive portal
*WM: Handle root
*WM: Request redirected to captive portal
*WM: Handle root
*WM: Request redirected to captive portal
*WM: Handle root
*WM: Handle root
*WM: Handle root
*WM: WiFi save
*WM: Sent wifi save page
*WM: Connecting to new AP
*WM: Connecting as wifi client...
*WM: Waiting for connection result with time out
31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,-62,-62,-61,-61,-61,-61,-62,-63,-64,-64,-64,-64,-65,-65,-65,-65,-62,_WM: Connection result:
*WM: 3
@kentaylor commented on GitHub (Nov 18, 2016):
WiFi.persistent(true)is the default, only specify it in the unlikely event you want
WiFi.persistent(false)@croisez asks
0 corresponds to WL_IDLE_STATUS . WL_IDLE_STATUS is an Arduino term and the ESP8266 doesn't exactly match the definition because the number of attempts does not expire in this case. It will wait forever until it sees the AP then attempt to connect.
I guess the 31 means no signal detected? The negative RSSI values are dBm which in your case show a low signal strength suggesting if you were closer to the router you would see different behaviour.
You provide a good example of why I argue that autoconnect is bad . There is discussion on future changes to autoconnect.
@SensorsIot commented on GitHub (Nov 19, 2016):
I have a very similar behavior. I use webupdate and print the ssid and psk before I autoconnect. Even when the ssid/psk are displayed right, it enters quite often in the AP mode. setConnectTimeout(60) did not change this behavior as it enters the AP mode quite quickly.
@croisez commented on GitHub (Nov 21, 2016):
Yes @SensorsIot, I also had the situation where the connection could not be done, while the printf of WiFi.SSID() and WiFi.psk() show good values.
But most of the time, printing WiFi.SSID() and WiFi.psk() show empty values.
I suppose that a call to WiFi.begin(ssid,psk) should do the saving-to-eeprom process, and that normally, upon reboot, a call to WiFi.begin() without args should use previously saved credentials, and get success with it.
Is it right?
@kentaylor commented on GitHub (Nov 21, 2016):
@croisez asks
Yes it is and calling WiFi.begin() after reboot is not useful.
When @croisez says
It sounds like the same issue as @hutch120.
@hutch120 commented on GitHub (Feb 12, 2017):
We are making some progress on this issue over at https://github.com/tzapu/WiFiManager/issues/247