esp-idf: wifi connection failed with message "Association refused temporarily, comeback time 205824 mSec" (IDFGH-7909)
Environment
- Development Kit: esp-idf + esp_rainmaker
- Kit version : esp-idf the main branch after v5.0-dev
- Module or chip used: ESP32C3
- IDF version (run
git describe --tagsto find it): v5.0-dev-4257-g508661b03e - Build System: idf.py
- Compiler version (run
xtensa-esp32-elf-gcc --versionto find it): riscv32-esp-elf-gcc (crosstool-NG esp-2022r1-RC1) 11.2.0 - Operating System: [Linux]
- Using an IDE?: [No]
- Power Supply: [USB]
Problem Description
after I flash and reboot, I some time get reported wifi failure:
Association refused temporarily, comeback time 205824 mSec
20 seconds seem too long, how can I avoid it?
Full log looks like:
I (689) phy_init: phy_version 912,d001756,Jun 2 2022,16:28:07
I (719) wifi:mode : sta (60:55:f9:79:7e:84)
I (719) wifi:enable tsf
I (729) wifi:new:<2,0>, old:<1,0>, ap:<255,255>, sta:<2,0>, prof:1
I (729) wifi:state: init -> auth (b0)
I (759) wifi:state: auth -> assoc (0)
E (759) wifi:Association refused temporarily, comeback time 205824 mSec
Expected Behavior
Actual Behavior
Steps to reproduce
download esp-idf and build it, source the export.sh like:
source path/to/esp-idf/export.sh
download esp-rainmaker
cd examples/temperature_sensor
idf.py set-target esp32c3
idf.py build
idf.py /dev/ttyACM0 flash monitor
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 33 (3 by maintainers)
Hi ! I have ESP32C3 and this problem too. However I added WiFi.disconnect() just before trying to start WiFi, that message disappeared from the serial monitor, and now it takes about 10 sec to start Wifi !
Hi @sforconi @AxelLin , work is in progress to make this wifi fix availbale for v4.4 and v4.3 branches. Will be available soon.
Thanks @sarveshb14, updating the to the latest commit has solved the problem, I can now see that the maximum allowed reconnection time is 5000ms.
@MaxwellAlan Does it matter to call esp_wifi_disconnect() before reset?
People usually just unplug usb cable (power-off) and replug usb cable (power-on). i.e. esp_wifi_disconnect() is not called in a very common use case. If reset without calling esp_wifi_disconnect() can cause issue, this is a big problem.