mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1067] CONNECTION PROBLEMS, restart, or every other restart #909
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#909
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 @tablatronix on GitHub (May 25, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1067
There has been several issues with problems with wifi not connecting. But after restarts it works.
Or every other restart it fails
Sometimes there are errors like wrong password, or ap not found
This issue is for investigating this to find some common issue.
I suspect it is a race condition or router issue with certain SDKs etc. It could also be a simple bug like autoconnect is connecting while esp is auto-connecting and it hangs. Or set sta is not returning fast enough and is asynchronous, there has been proof of this and issues by me created in esp libs.
@tablatronix commented on GitHub (May 25, 2020):
I will look into wm as the cause of this issue, since it is occurring on both platforms
@TheNitek commented on GitHub (May 25, 2020):
I already linked it in #979 but just to have it here again. I don't think it's bug in WifiManager but in the SDK: https://github.com/espressif/arduino-esp32/issues/2501 (nevertheless one that the WifiManager can work around)
@TheNitek commented on GitHub (May 25, 2020):
BTW I also suspect the router model to be important for this: In my case it's a Fritz!Box 6490.
@alfo commented on GitHub (May 25, 2020):
I’ve been having issues with both the ESP8266 and the ESP32 using v2.x.x of WiFiManager but notably the problem goes away on v0.1.5 on my ESP8266, so it might be worth having a look at what changed inside the autoConnect function?
I agree it’s probably true that WiFi routers also play a part in this, in my case I’m using a Ubiquity nanoHD access point (with two APs, one downstairs, broadcasting on the same SSID). Maybe that has something to do with it?
@1technophile commented on GitHub (May 26, 2020):
I confirm also that OpenMQTTGateway users were complaining about this issue with Ubiquity routers.
@tablatronix commented on GitHub (May 26, 2020):
One difference is we used to always disconnect,
But that adds 2 second startup time
This was removed in dev and made optional
I have also encountered issues where waitforconresult timesout and never connects ( which takes forever )
@tablatronix commented on GitHub (May 26, 2020):
A couple things to try that might be causing a race condition.
Try adding this delay and log to this function
Another thing to try
Remove the sta, begin will do this by itself also
Also time how long waitforconnectresult takes, I have been meaning to add some debugging there for timing it. Does it take long when it fails?
@thewavelength commented on GitHub (Aug 18, 2020):
I have the same issue. Sometimes, totally not reproducible for me (I'm sorry), I even get a crash which seems to be related to this. This happens now as long as I erase the flash and flash the image again.
@tablatronix commented on GitHub (Jan 11, 2022):
I have been looking into this issue here
https://github.com/espressif/arduino-esp32/issues/2501
And made a PR here for workaround via autoreconnect bugfix
https://github.com/espressif/arduino-esp32/pull/6113
I also have an open issue with IDF against the actual cause under review
@tablatronix commented on GitHub (Jan 24, 2022):
MY PR was merged, but if you need a solution without a patch
I added a test solution to wm, hardcoded, no setter. I can add a define or setter if its useful
This adds esp32 event handler for auth fail, and bumps reconnects up and adds delays, I have connect everytime, and my conx time goes to 5s unfortunately until this issue is also fixed in IDF that is what we have..
I have not worked on this issue or tested if it exists in esp8266, I will check that next
@tablatronix commented on GitHub (Jun 17, 2022):
Theres seems to be 2 conditions here with different failures, this one for reauth timeout/retry there is also a 4 way handshake timeout or assoc failure which is possibly a different issue
@dddhhhrrr commented on GitHub (Jun 20, 2022):
is there a workaround for this one? I tried the _aggressiveReconn = true fix and it connects but gives me an IP = 0.0.0.0
@tablatronix commented on GitHub (Jun 21, 2022):
Hmm it shouldnt do you have logs?
@dddhhhrrr commented on GitHub (Jun 21, 2022):
here's the output from the serial port:
mounting FS...
mounted file system
reading config file
opened config file
{"mqtt_server":"Dffssff","mqtt_port":"8083","api_token":"YOUR_API_T"}
parsed json
*wm:[2] Added Parameter: server
*wm:[2] Added Parameter: port
*wm:[2] Added Parameter: apikey
*wm:[1] AutoConnect
*wm:[2] ESP32 event handler enabled
*wm:[2] Connecting as wifi client...
*wm:[2] setSTAConfig static ip not set, skipping
*wm:[1] Connecting to SAVED AP: embeddex_2.4GHz
*wm:[1] connectTimeout not set, ESP waitForConnectResult...
E (5966) wifi:Association refused temporarily, comeback time 1048 mSec
*wm:[2] [EVENT] WIFI_REASON: 203
*wm:[2] [EVENT] WIFI_REASON: AUTH FAIL
*wm:[2] Connection result: WL_CONNECT_FAILED
*wm:[1] Connect Wifi, ATTEMPT # 2 of 5
*wm:[1] Connecting to SAVED AP: embeddex_2.4GHz
E (9614) wifi:sta is connecting, return error
*wm:[1] connectTimeout not set, ESP waitForConnectResult...
*wm:[2] Connection result: WL_CONNECT_FAILED
*wm:[1] Connect Wifi, ATTEMPT # 3 of 5
*wm:[1] Connecting to SAVED AP: embeddex_2.4GHz
*wm:[1] connectTimeout not set, ESP waitForConnectResult...
*wm:[2] Connection result: WL_CONNECTED
*wm:[1] AutoConnect: SUCCESS
*wm:[2] Connected in 7782 ms
*wm:[1] STA IP Address:
connected...yeey :)
The values in the file are:
mqtt_server : Dffssff
mqtt_port : 8083
api_token : YOUR_API_T
local ip
0.0.0.0
@tablatronix commented on GitHub (Jun 21, 2022):
hmm, that is odd, I may have seen this reported elsewhere, or as a different bug...
can you turn on esp debug level 5 or is that all its logging ?
@tablatronix commented on GitHub (Jun 21, 2022):
What eps lib version , might want to try updating it , i think I recall a bug like this, ill try to test later
@dddhhhrrr commented on GitHub (Jun 22, 2022):
I updated the ESP core version, it seems that it fixed it...
@tablatronix commented on GitHub (Jun 22, 2022):
Yeah I couldn't find the issue, but i specifically recall seeing a IDF bug with failing to set ip
@Robotto commented on GitHub (Oct 14, 2022):
I'm still experiencing this issue with ESP core version 3.0.2 (via arduino board manager) on an ESP-12E
wm version 2.0.13-beta (via arduino library manager)
Is there a different combination of core and library versions where this works?
@tablatronix commented on GitHub (Oct 14, 2022):
Can you provide logs with esp debugging on ?
The esp core should be retrying these connections itself now.
@kjyv commented on GitHub (Oct 21, 2022):
Also seeing this on ESP32 (ESP8266 works fine with same code and on latest WiFiManager commit) - AP mode works, I can choose a network. The saved credentials are then tried but no IP is received and the log says:
After the last retry, is also shows these lines:
I've tried this on multiple devices - some very rare times it did connect but pretty much all of the time it does not.
It also does not matter if I set WPA + WPA2, WPA2 only or no auth on the router.
@tablatronix commented on GitHub (Oct 22, 2022):
Ok this is a slightly different issue, have you tried the aggressive recon mod above?
@kjyv commented on GitHub (Oct 22, 2022):
It's already included by default, but also tried setting it to false
@tablatronix commented on GitHub (Oct 23, 2022):
oh yeah lol
@Robotto commented on GitHub (Oct 23, 2022):
Hm... While messing around trying to get debug output to work, i discovered that the ESP module is an ESP-12 and not an ESP-12E .. changed this and the issue seems to have vanished... (never got debug output to work)
@lyricnz commented on GitHub (Nov 24, 2024):
(Crossposting from closed issue)
FWIW I have the same symptom (connects every second boot, with 100% reliability). Adding the retries didn't help for me.
@melyux commented on GitHub (Dec 1, 2025):
This is still going on, every time the access point is rebooted. Doesn't happen on ESP8266, only ESP32. Also with UniFi APs