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 --tags to find it): v5.0-dev-4257-g508661b03e
  • Build System: idf.py
  • Compiler version (run xtensa-esp32-elf-gcc --version to 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)

Commits related to this issue

Most upvoted comments

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.

I (6797) pp: pp rom version: e7ae62f
I (6797) net80211: net80211 rom version: e7ae62f
I (6807) wifi:wifi driver task: 3fca9540, prio:23, stack:6656, core=0
I (6807) system_api: Base MAC address is not set
I (6807) system_api: read default base MAC address from EFUSE
I (6807) wifi:wifi firmware version: 13c0b6c
I (6807) wifi:wifi certification version: v7.0
I (6807) wifi:config NVS flash: disabled
I (6807) wifi:config nano formating: disabled
I (6807) wifi:Init data frame dynamic rx buffer num: 32
I (6807) wifi:Init management frame dynamic rx buffer num: 32
I (6807) wifi:Init management short buffer num: 32
I (6807) wifi:Init static tx buffer num: 16
I (6807) wifi:Init tx cache buffer num: 32
I (6807) wifi:Init static tx FG buffer num: 2
I (6807) wifi:Init static rx buffer size: 1600
I (6807) wifi:Init static rx buffer num: 10
I (6807) wifi:Init dynamic rx buffer num: 32
I (6807) wifi_init: rx ba win: 6
I (6807) wifi_init: tcpip mbox: 32
I (6807) wifi_init: udp mbox: 6
I (6807) wifi_init: tcp mbox: 6
I (6807) wifi_init: tcp tx win: 5744
I (6807) wifi_init: tcp rx win: 5744
I (6807) wifi_init: tcp mss: 1440
I (6807) wifi_init: WiFi IRAM OP enabled
I (6807) wifi_init: WiFi RX IRAM OP enabled
I (6807) phy_init: phy_version 540,a5d905b,Oct 20 2022,19:36:11
I (6847) wifi:mode : sta (f4:12:fa:d7:a3:9c)
I (6847) wifi:enable tsf
I (6847) wifi:Set ps type: 0

I (6857) MAIN: wifi started
I (6867) MAIN: wait for network up (00000002)...
I (9267) MAIN: wifi scan done: status 0, number 14
I (9267) MAIN: Total APs scanned = 14
I (9267) MAIN: 0 - blueup-guest [10] (-54) DE 
I (9267) MAIN: 1 - Terrecablate_2.4Ghz_8941 [10] (-55) DE 
I (9267) MAIN: 2 - NAVEL_93C564 [1] (-65) CN
I (9267) MAIN: 3 - BOCCONBACCO [1] (-66) 
I (9267) MAIN: 4 - TIM-93898011 [1] (-68) 
I (9267) MAIN: 5 - Terrecablate_2.4Ghz_91E1 [4] (-68) DE 
I (9267) MAIN: 6 - GL-AR150-344 [11] (-69) 
I (9267) MAIN: 7 - AGRISOLVING [2] (-70) 
I (9267) MAIN: 8 - DIRECT-F6-HP DesignJet T630 [6] (-73) 
I (9267) MAIN: 9 - B910_1990531478 [12] (-74) CN 
I (9267) MAIN: 10 - Loggini WiFi [7] (-83) 
I (9267) MAIN: 11 - Zyxel_1401 [7] (-85) DE 
I (9267) MAIN: 12 - 1e6180df [1] (-88) CN
I (9267) MAIN: 13 - 1e617fd1 [1] (-89) CN
I (9267) MAIN: WiFi try connecting to Terrecablate_2.4Ghz_8941
I (11677) wifi:new:<10,0>, old:<1,0>, ap:<255,255>, sta:<10,0>, prof:1
I (12967) wifi:state: init -> auth (b0)
I (12977) wifi:state: auth -> assoc (0)
E (12977) wifi:Association refused temporarily, comeback time 268435 mSec
E (12987) wifi:Association comeback time (268435) mSec too long. max allowed 5000 mSec
I (12987) wifi:state: assoc -> init (d000)
I (12987) wifi:new:<10,0>, old:<10,0>, ap:<255,255>, sta:<10,0>, prof:1
I (12987) MAIN: wifi disconnected: Terrecablate_2.4Ghz_8941, reason 208
I (15387) MAIN: wifi scan done: status 0, number 14
I (15397) MAIN: Total APs scanned = 14
I (15397) MAIN: 0 - Terrecablate_2.4Ghz_8941 [10] (-55) DE 
I (15397) MAIN: 1 - blueup-guest [10] (-55) DE 
I (15397) MAIN: 2 - NAVEL_93C564 [1] (-64) CN
I (15397) MAIN: 3 - TIM-93898011 [1] (-67) 
I (15397) MAIN: 4 - BOCCONBACCO [1] (-67) 
I (15397) MAIN: 5 - Terrecablate_2.4Ghz_91E1 [4] (-67) DE 
I (15397) MAIN: 6 - GL-AR150-344 [11] (-68) 
I (15397) MAIN: 7 - DIRECT-F6-HP DesignJet T630 [6] (-72) 
I (15397) MAIN: 8 - B910_1990531478 [12] (-74) CN 
I (15397) MAIN: 9 - 1e617fc8 [1] (-80) CN
I (15397) MAIN: 10 - Loggini WiFi [7] (-83) 
I (15397) MAIN: 11 - 1e6180b0 [1] (-86) CN
I (15397) MAIN: 12 - Zyxel_1401 [7] (-86) DE 
I (15397) MAIN: 13 - DIRECT-F5-HP DeskJet 2600 series [6] (-88) 
I (15397) MAIN: WiFi try connecting to Terrecablate_2.4Ghz_8941
I (17807) MAIN: wifi disconnected: Terrecablate_2.4Ghz_8941, reason 205
I (20217) MAIN: wifi scan done: status 0, number 11
I (20217) MAIN: Total APs scanned = 11
I (20217) MAIN: 0 - blueup-guest [10] (-52) DE 
I (20217) MAIN: 1 - Terrecablate_2.4Ghz_8941 [10] (-54) DE 
I (20217) MAIN: 2 - BOCCONBACCO [1] (-65) 
I (20217) MAIN: 3 - Terrecablate_2.4Ghz_91E1 [4] (-67) DE 
I (20217) MAIN: 4 - TIM-93898011 [1] (-68) 
I (20217) MAIN: 5 - AGRISOLVING [2] (-69) 
I (20217) MAIN: 6 - GL-AR150-344 [11] (-71) 
I (20217) MAIN: 7 - DIRECT-F6-HP DesignJet T630 [6] (-72) 
I (20217) MAIN: 8 - B910_1990531478 [12] (-74) CN 
I (20217) MAIN: 9 - Zyxel_1401 [7] (-85) DE 
I (20217) MAIN: 10 - 1e6180df [1] (-88) CN
I (20217) MAIN: WiFi try connecting to Terrecablate_2.4Ghz_8941
I (22627) wifi:new:<10,0>, old:<10,0>, ap:<255,255>, sta:<10,0>, prof:1
I (22627) wifi:state: init -> auth (b0)
I (22627) wifi:state: auth -> assoc (0)
I (22637) wifi:state: assoc -> run (10)
I (22747) wifi:connected with Terrecablate_2.4Ghz_8941, aid = 11, channel 10, BW20, bssid = 88:ac:c0:7e:89:41
I (22747) wifi:security: WPA2-PSK, phy: bgn, rssi: -53
I (22747) wifi:pm start, type: 0

I (22747) wifi:set rx beacon pti, rx_bcn_pti: 0, bcn_timeout: 0, mt_pti: 25000, mt_time: 10000
I (22757) MAIN: wifi connected: Terrecablate_2.4Ghz_8941, channel 10, authmode = 3
I (22807) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (24257) esp_netif_handlers: sta ip: 192.168.1.149, mask: 255.255.255.0, gw: 192.168.1.1

Hi @MaxwellAlan what should I do in order to disconnect from the AP? I already configured reset before flash and after, should I send any additional command to perform the disconnect?

Call esp_wifi_disconnect(); this api before reset.

@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.