-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First couple of Wi-Fi connection attempt fails (IDFGH-11148) #12315
Comments
Looking into this issue more, this seems to happen when the ESP doesn't disconnect from AP cleanly. For example, using the wifi/getting_started/station: If the reset button on the ESP32-S3 devkit is pressed after connection succeeded, the next 1 or 2 attempt after reboot will fail with WIFI_REASON_ASSOC_FAIL, reason 203 but eventually succeed. If, however the example is modified to have |
Some more details in reproducing this issue. The wifi/getting_started/station example
pre-stop-reset: post-stop-reset: Here are the verbose logs for each case: |
This might be because the router takes some time to realize that the device has disconnected, possibly due to the device not sending a 'deauth' signal before rebooting. I think using esp_wifi_disconnect should work like esp_wifi_stop. It will be fixed upcoming versions. |
More information for you @Xiehanxin. It seems this behavior is not reproducible depending on the access point. But on my personal router running same version of OpenWRT but with MT7621A-based wifi (GL.iNet GL-MT1300), it doesn't happen at all. |
I don't quite understand your reply. |
No, my previous comment is for @Xiehanxin |
hi @AxelLin , In fact, it was later discovered that there was no need for a fix because it was a compatibility issue with certain special routers. Simply disconnecting before stopping resolved the issue. |
Hi @Xiehanxin, so is this issue not going to be fixed? I'm asking because "disconnecting before stopping" isn't exactly always doable, especially with embedded where power can be removed by user at any time. |
@mhdong |
@mhdong |
I don't understand why this fix is related to this issue, could you explain why it fixed below failure? @mhdong
|
Hi @AxelLin |
@mhdong |
Hello, since there seems to be activity on this issue recently and a supposed fix - I'd like to try it out! What branch should I build with? |
Answers checklist.
General issue report
Using https://github.com/espressif/esp-idf/tree/master/examples/wifi/getting_started/station.
Logs indicate first couple of attempts of connecting to a network fails. Access point is an RPi 4 with OpenWRT 22.03.5.
IDF version.
v5.2-dev-3065-g272b4091f1
Operating System used.
PopOS 22.04
How did you build your project?
idf.py
What is the expected behavior?
Connection to WiFi (WPA2-PSK) with correct credentials succeeds on first try.
What is the actual behavior?
First couple of attempts fail, then eventually succeeds.
The text was updated successfully, but these errors were encountered: