WiFi connection works only after router reboot
Posted: Mon Dec 10, 2018 8:12 pm
Hardware: ESP-WROOM-32
ESP-IDF commit hash: 12b2268ee56dac79988b75dbb49a453629ed8022
When running the example esp-idf/examples/protocols/https_request, the code will connect to my WiFi network the first time, but it won't connect again. Even if I power off the ESP-WROOM-32 board and power it back on, it won't connect a second time. In order to connect a second time, I must reboot my WiFi router or hotspot. Once I do that, it connects exactly once again, then fails.
Here's the log output when it fails to connect, and below that is the log output when it succeeds in connecting. Note in the failed example it gets part way through the connection process, but it never gets a event: sta log line. Why won't it connect without rebooting my router?
Fail:
Success:
ESP-IDF commit hash: 12b2268ee56dac79988b75dbb49a453629ed8022
When running the example esp-idf/examples/protocols/https_request, the code will connect to my WiFi network the first time, but it won't connect again. Even if I power off the ESP-WROOM-32 board and power it back on, it won't connect a second time. In order to connect a second time, I must reboot my WiFi router or hotspot. Once I do that, it connects exactly once again, then fails.
Here's the log output when it fails to connect, and below that is the log output when it succeeds in connecting. Note in the failed example it gets part way through the connection process, but it never gets a event: sta log line. Why won't it connect without rebooting my router?
Fail:
Code: Select all
I (0) cpu_start: App cpu up.
I (439) heap_init: Initializing. RAM available for dynamic allocation:
I (446) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (452) heap_init: At 3FFB91B8 len 00026E48 (155 KiB): DRAM
I (458) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (464) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (471) heap_init: At 400914E0 len 0000EB20 (58 KiB): IRAM
I (477) cpu_start: Pro cpu start user code
I (159) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (242) wifi: wifi driver task: 3ffc0e08, prio:23, stack:3584, core=0
I (242) wifi: wifi firmware version: a85ca5e
I (242) wifi: config NVS flash: enabled
I (242) wifi: config nano formating: disabled
I (242) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (252) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (292) wifi: Init dynamic tx buffer num: 32
I (292) wifi: Init data frame dynamic rx buffer num: 32
I (292) wifi: Init management frame dynamic rx buffer num: 32
I (292) wifi: Init static rx buffer size: 1600
I (292) wifi: Init static rx buffer num: 10
I (302) wifi: Init dynamic rx buffer num: 32
I (302) example: Setting WiFi configuration SSID libertariandictator...
I (372) phy: phy_version: 4000, b6198fa, Sep 3 2018, 15:11:06, 0, 0
I (372) wifi: mode : sta (24:0a:c4:1d:27:b0)
I (1702) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (2692) wifi: state: init -> auth (b0)
I (2692) wifi: state: auth -> assoc (0)
I (3692) wifi: state: assoc -> init (400)
I (3692) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
I (6232) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
I (6232) wifi: state: init -> auth (b0)
I (7232) wifi: state: auth -> init (200)
I (7232) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
I (9772) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
I (9772) wifi: state: init -> auth (b0)
I (10772) wifi: state: auth -> init (200)
I (10772) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
I (13302) wifi: n:11 0, o:11 0, ap:255 255, sta:11 0, prof:1
Code: Select all
I (0) cpu_start: App cpu up.
I (439) heap_init: Initializing. RAM available for dynamic allocation:
I (446) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (452) heap_init: At 3FFB91B8 len 00026E48 (155 KiB): DRAM
I (458) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (464) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (471) heap_init: At 400914E0 len 0000EB20 (58 KiB): IRAM
I (477) cpu_start: Pro cpu start user code
I (159) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (242) wifi: wifi driver task: 3ffc0e08, prio:23, stack:3584, core=0
I (242) wifi: wifi firmware version: a85ca5e
I (242) wifi: config NVS flash: enabled
I (242) wifi: config nano formating: disabled
I (242) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (252) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (292) wifi: Init dynamic tx buffer num: 32
I (292) wifi: Init data frame dynamic rx buffer num: 32
I (292) wifi: Init management frame dynamic rx buffer num: 32
I (292) wifi: Init static rx buffer size: 1600
I (292) wifi: Init static rx buffer num: 10
I (302) wifi: Init dynamic rx buffer num: 32
I (302) example: Setting WiFi configuration SSID libertariandictator...
I (372) phy: phy_version: 4000, b6198fa, Sep 3 2018, 15:11:06, 0, 0
I (372) wifi: mode : sta (24:0a:c4:1d:27:b0)
I (21012) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (21992) wifi: state: init -> auth (b0)
I (22002) wifi: state: auth -> assoc (0)
I (22012) wifi: state: assoc -> run (10)
I (22042) wifi: connected with libertariandictator, channel 11
I (22042) wifi: pm start, type: 1
I (22742) event: sta ip: 192.168.43.248, mask: 255.255.255.0, gw: 192.168.43.152
I (22742) example: Connected to AP
I (25652) example: Connection established...
I (25652) example: 106 bytes written
I (25652) example: Reading HTTP response...