After restarting the ESP32, it fails to reconnect to the Android AP.

mensbufo
Posts: 1
Joined: Sat Sep 28, 2024 7:32 pm

After restarting the ESP32, it fails to reconnect to the Android AP.

Postby mensbufo » Sat Sep 28, 2024 8:49 pm

I am a novice in ESP32 development. While trying to get started with ESP32-C3 SuperMini, I discovered some strange behavior. After the first successful connection to my Xiaomi Poco X3 Pro AP and following plugging off my ESP32 power(just plugging off the USB-C cable), next time ESP32 refuses to connect to my phone's AP.

I am using example from "esp-idf\examples\wifi\getting_started\station" to connect to my Wi-Fi station. I had double checked that SSID and password are correct, and I had entered these settings through menuconfig. Using "esp-idf\examples\wifi\scan\" example I still see my AP showing in the list. For all this time period I was able to connect to my AP twice. One time I was able to reconnect after power off, but I am still not sure what caused it, as I was restarting everything, reuploading code, and changing settings at the same time.

I have searched this problem in ESP-IDF documentation, as well as in this forum. I found similar topics, but either there was no solution or it didn't work for me. From my understanding, if I power off my ESP32 just by plugging off the cable it is unable to properly send some deauthentification info to AP, but I cannot come up with the solution of how to prevent this. Restarting AP on my phone by turning it off and on didn't help, as well as completely rebooting the phone. I rebooted and restarted ESP32 countless times, still nothing.

Similar topics:
viewtopic.php?f=13&t=8769
viewtopic.php?t=16715
https://esp32.com/viewtopic.php?t=8396

Logs from ESP32:

Code: Select all

I (24) boot: ESP-IDF v5.3.1 2nd stage bootloader
I (24) boot: compile time Sep 26 2024 21:49:17
I (25) boot: chip revision: v0.4
I (27) boot.esp32c3: SPI Speed      : 40MHz
I (32) boot.esp32c3: SPI Mode       : DIO
I (37) boot.esp32c3: SPI Flash Size : 4MB
I (42) boot: Enabling RNG early entropy source...
I (47) boot: Partition Table:
I (51) boot: ## Label            Usage          Type ST Offset   Length
I (58) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (65) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (73) boot:  2 factory          factory app      00 00 00010000 00100000
I (80) boot:  3 storage          Unknown data     01 82 00110000 00100000
I (88) boot: End of partition table
I (92) esp_image: segment 0: paddr=00010020 vaddr=3c0b0020 size=226cch (141004) map
I (131) esp_image: segment 1: paddr=000326f4 vaddr=3fc93000 size=02e38h ( 11832) load
I (134) esp_image: segment 2: paddr=00035534 vaddr=40380000 size=0aae4h ( 43748) load
I (147) esp_image: segment 3: paddr=00040020 vaddr=42000020 size=a0ad0h (658128) map
I (290) esp_image: segment 4: paddr=000e0af8 vaddr=4038aae4 size=08358h ( 33624) load
I (304) boot: Loaded app from partition at offset 0x10000
I (304) boot: Disabling RNG early entropy source...
I (316) cpu_start: Unicore app
I (325) cpu_start: Pro cpu start user code
I (325) cpu_start: cpu freq: 160000000 Hz
I (325) app_init: Application information:
I (328) app_init: Project name:     hello_world
I (333) app_init: App version:      1
I (338) app_init: Compile time:     Sep 28 2024 23:31:54
I (344) app_init: ELF file SHA256:  3a8c5df27...
I (349) app_init: ESP-IDF:          v5.3.1
I (354) efuse_init: Min chip rev:     v0.3
I (358) efuse_init: Max chip rev:     v1.99
I (363) efuse_init: Chip rev:         v0.4
I (368) heap_init: Initializing. RAM available for dynamic allocation:
I (376) heap_init: At 3FC9C080 len 00023F80 (143 KiB): RAM
I (382) heap_init: At 3FCC0000 len 0001C710 (113 KiB): Retention RAM
I (389) heap_init: At 3FCDC710 len 00002950 (10 KiB): Retention RAM
I (396) heap_init: At 50000200 len 00001DE8 (7 KiB): RTCRAM
I (403) spi_flash: detected chip: generic
I (406) spi_flash: flash io: dio
I (411) sleep: Configure to isolate all GPIO pins in sleep state
I (417) sleep: Enable automatic switching of GPIO sleep configuration
I (425) main_task: Started on CPU0
I (425) main_task: Calling app_main()
I (435) WIFI: ESP_WIFI_MODE_STA
I (435) pp: pp rom version: 9387209
I (435) net80211: net80211 rom version: 9387209
I (455) wifi:wifi driver task: 3fca4cb4, prio:23, stack:6656, core=0
I (455) wifi:wifi firmware version: ccaebfa
I (455) wifi:wifi certification version: v7.0
I (455) wifi:config NVS flash: enabled
I (455) wifi:config nano formating: disabled
I (465) wifi:Init data frame dynamic rx buffer num: 32
I (465) wifi:Init static rx mgmt buffer num: 5
I (475) wifi:Init management short buffer num: 32
I (475) wifi:Init dynamic tx buffer num: 32
I (485) wifi:Init static tx FG buffer num: 2
I (485) wifi:Init static rx buffer size: 1600
I (485) wifi:Init static rx buffer num: 10
I (495) wifi:Init dynamic rx buffer num: 32
I (495) wifi_init: rx ba win: 6
I (495) wifi_init: accept mbox: 6
I (505) wifi_init: tcpip mbox: 32
I (505) wifi_init: udp mbox: 6
I (515) wifi_init: tcp mbox: 6
I (515) wifi_init: tcp tx win: 5760
I (515) wifi_init: tcp rx win: 5760
I (525) wifi_init: tcp mss: 1440
I (525) wifi_init: WiFi IRAM OP enabled
I (535) wifi_init: WiFi RX IRAM OP enabled
I (545) phy_init: phy_version 1180,01f2a49,Jun  4 2024,16:34:25
I (585) wifi:mode : sta (dc:da:0c:dd:9f:fc)
I (585) wifi:enable tsf
I (585) WIFI: wifi_init_sta finished.
I (1585) wifi:new:<9,0>, old:<1,0>, ap:<255,255>, sta:<9,0>, prof:1, snd_ch_cfg:0x0
I (1585) wifi:state: init -> auth (0xb0)
I (2595) wifi:state: auth -> init (0x200)
I (2605) wifi:new:<9,0>, old:<9,0>, ap:<255,255>, sta:<9,0>, prof:1, snd_ch_cfg:0x0
I (2605) WIFI: retry to connect to the AP
I (2605) WIFI: connect to the AP fail
I (5015) WIFI: retry to connect to the AP
I (5015) WIFI: connect to the AP fail
I (5055) wifi:new:<9,0>, old:<9,0>, ap:<255,255>, sta:<9,0>, prof:1, snd_ch_cfg:0x0
I (5065) wifi:state: init -> auth (0xb0)
I (6075) wifi:state: auth -> init (0x200)
I (6085) wifi:new:<9,0>, old:<9,0>, ap:<255,255>, sta:<9,0>, prof:1, snd_ch_cfg:0x0
I (6085) WIFI: retry to connect to the AP
I (6085) WIFI: connect to the AP fail
I (8495) WIFI: retry to connect to the AP
I (8495) WIFI: connect to the AP fail
I (8535) wifi:new:<9,0>, old:<9,0>, ap:<255,255>, sta:<9,0>, prof:1, snd_ch_cfg:0x0
I (8545) wifi:state: init -> auth (0xb0)
I (8545) wifi:state: init -> auth (0xb0)
I (9555) wifi:state: auth -> init (0x200)
I (9565) wifi:new:<9,0>, old:<9,0>, ap:<255,255>, sta:<9,0>, prof:1, snd_ch_cfg:0x0
I (9565) WIFI: retry to connect to the AP
I (9565) WIFI: connect to the AP fail
I (11975) WIFI: connect to the AP fail
I (11975) WIFI: Failed to connect to SSID:MySSID, password:MyPassword
Any help will be much appreciated, as I really struggle to find some solution for this :oops:

Who is online

Users browsing this forum: Bing [Bot] and 429 guests