Wifi disconnects
Posted: Thu Jan 28, 2021 7:53 pm
Hi, i'm working a project with a https webserver and some https client connections. This all seems to work fine on the v4.2 esp-idf release. But, when I'm trying to implement the OTA functionality (using the advanced_ota_https example as a basis), I consequently end up with disconnects of the wifi connection during the OTA:
I've tried this over multiple devices (lolin lite), all have the same behavior. When I flash the advanced_ota_https onto the device, I don't have the problem, so I'm probably doing something wrong here.
But even when I remove everything but the bare essentials and the OTA part, I still get this problem.
Code: Select all
I (30) boot: ESP-IDF v4.2-238-g8cd16b60f 2nd stage bootloader
I (30) boot: compile time 20:25:42
I (30) boot: chip revision: 1
I (34) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (50) boot.esp32: SPI Speed : 40MHz
I (50) boot.esp32: SPI Mode : DIO
I (50) boot.esp32: SPI Flash Size : 4MB
I (55) boot: Enabling RNG early entropy source...
I (60) boot: Partition Table:
I (64) boot: ## Label Usage Type ST Offset Length
I (71) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (79) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (86) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (94) boot: 3 factory factory app 00 00 00010000 00100000
I (101) boot: 4 ota_0 OTA app 00 10 00110000 00100000
I (109) boot: 5 ota_1 OTA app 00 11 00210000 00100000
I (116) boot: End of partition table
I (121) boot: Defaulting to factory image
I (125) boot_comm: chip revision: 1, min. application chip revision: 0
I (132) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x22abc (142012) map
I (196) esp_image: segment 1: paddr=0x00032ae4 vaddr=0x3ffb0000 size=0x033e0 ( 13280) load
I (201) esp_image: segment 2: paddr=0x00035ecc vaddr=0x40080000 size=0x00404 ( 1028) load
0x40080000: _WindowOverflow4 at /home/private/esp32/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730
I (203) esp_image: segment 3: paddr=0x000362d8 vaddr=0x40080404 size=0x09d40 ( 40256) load
I (229) esp_image: segment 4: paddr=0x00040020 vaddr=0x400d0020 size=0x9a930 (633136) map
0x400d0020: _stext at ??:?
I (470) esp_image: segment 5: paddr=0x000da958 vaddr=0x4008a144 size=0x0b560 ( 46432) load
0x4008a144: prvCopyDataFromQueue at /home/private/esp32/esp-idf/components/freertos/queue.c:1948
I (502) boot: Loaded app from partition at offset 0x10000
I (503) boot: Disabling RNG early entropy source...
I (503) cpu_start: Pro cpu up.
I (507) cpu_start: Application information:
I (511) cpu_start: Project name: smarts
I (516) cpu_start: App version: 2.0.0-3-gbd14820-dirty
I (522) cpu_start: Compile time: Jan 28 2021 20:25:37
I (529) cpu_start: ELF file SHA256: 05326fa7ce44f901...
I (535) cpu_start: ESP-IDF: v4.2-238-g8cd16b60f
I (541) cpu_start: Starting app cpu, entry point is 0x400818cc
0x400818cc: call_start_cpu1 at /home/private/esp32/esp-idf/components/esp32/cpu_start.c:287
I (0) cpu_start: App cpu up.
I (551) heap_init: Initializing. RAM available for dynamic allocation:
I (558) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (564) heap_init: At 3FFB7AD8 len 00028528 (161 KiB): DRAM
I (570) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (576) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (583) heap_init: At 400956A4 len 0000A95C (42 KiB): IRAM
I (589) cpu_start: Pro cpu start user code
I (608) spi_flash: detected chip: generic
I (608) spi_flash: flash io: dio
I (608) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (691) main: Starting Smarts
W (691) serial: No serial configured
I (691) networking: Device hostname: smarts-0000000000
I (711) wifi:wifi driver task: 3ffc00f0, prio:23, stack:6656, core=0
I (711) system_api: Base MAC address is not set
I (711) system_api: read default base MAC address from EFUSE
I (731) wifi:wifi firmware version: 25f230e
I (731) wifi:wifi certification version: v7.0
I (731) wifi:config NVS flash: enabled
I (731) wifi:config nano formating: disabled
I (741) wifi:Init data frame dynamic rx buffer num: 32
I (741) wifi:Init management frame dynamic rx buffer num: 32
I (751) wifi:Init management short buffer num: 32
I (751) wifi:Init dynamic tx buffer num: 32
I (761) wifi:Init static rx buffer size: 1600
I (761) wifi:Init static rx buffer num: 10
I (761) wifi:Init dynamic rx buffer num: 32
I (771) wifi_init: rx ba win: 6
I (771) wifi_init: tcpip mbox: 32
I (781) wifi_init: udp mbox: 6
I (781) wifi_init: tcp mbox: 6
I (781) wifi_init: tcp tx win: 5744
I (791) wifi_init: tcp rx win: 5744
I (791) wifi_init: tcp mss: 1440
I (801) wifi_init: WiFi IRAM OP enabled
I (801) wifi_init: WiFi RX IRAM OP enabled
I (811) wifi: Setting up sta mode to SSID: myssid, with password: mypassword
I (941) phy: phy_version: 4500, 0cd6843, Sep 17 2020, 15:37:07, 0, 0
I (941) wifi:mode : sta (b4:e6:2d:8e:fe:35)
I (941) wifi: sta_start
I (941) webserver: Starting htttps server!
I (941) esp_https_server: Starting server
I (951) esp_https_server: Server listening on port 443
I (951) webserver: Register new GET endpoint /device
I (961) webserver: Register new PUT endpoint /config/erase
I (971) webserver: Register new GET endpoint /config
I (971) webserver: Register new PUT endpoint /config
I (981) webserver: Register new PUT endpoint /power/reset
I (981) switches: No configuration found
I (991) webserver: Register new GET endpoint /switches_state
I (2271) wifi:new:<11,0>, old:<1,0>, ap:<255,255>, sta:<11,0>, prof:1
I (3061) wifi:state: init -> auth (b0)
I (3071) wifi:state: auth -> assoc (0)
I (3071) wifi:state: assoc -> run (10)
I (3081) wifi:connected with myssid, aid = 2, channel 11, BW20, bssid = f4:92:bf:a0:bd:20
I (3091) wifi:security: WPA2-PSK, phy: bgn, rssi: -58
I (3161) wifi:pm start, type: 1
I (3161) wifi:AP's beacon interval = 102400 us, DTIM period = 3
I (5191) network: connected
I (5191) wifi: sta_got_ip: 192.168.1.81
I (5191) esp_netif_handlers: sta ip: 192.168.1.81, mask: 255.255.255.0, gw: 192.168.1.1
I (5191) ota: check URL: https://firmware.esp32.nl/latest
I (7331) ota: version available: 2.1.0
I (7341) ota: New version available (2.1.0)
I (7341) wifi:Set ps type: 0
I (9531) esp_https_ota: Starting OTA...
I (9531) esp_https_ota: Writing to partition subtype 16 at offset 0x110000
I (9541) ota: Running firmware version: 2.0.0-3-gbd14820-dirty
I (19311) wifi:state: run -> init (3c0)
I (19311) wifi:pm stop, total sleep time: 3268041 us / 16154179 us
I (19311) wifi:new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
I (19321) network: disconnected
I (19321) wifi: wifi_disconnected
I (19331) wifi: retry connect to ap
E (19341) esp-tls-mbedtls: read error :-76:
E (19341) TRANS_SSL: esp_tls_conn_read error, errno=Software caused connection abort
W (19351) HTTP_CLIENT: esp_transport_read returned:-76 and errno:113
E (19361) TRANS_SSL: ssl_poll_read select error 113, errno = Software caused connection abort, fd = 57
E (19361) ota: Complete data was not received.
I (19371) esp_image: segment 0: paddr=0x00110020 vaddr=0x3f400020 size=0x228bc (141500) map
I (19431) esp_image: segment 1: paddr=0x001328e4 vaddr=0x3ffb0000 size=0x033e0 ( 13280)
I (19431) esp_image: segment 2: paddr=0x00135ccc vaddr=0x40080000 size=0x00404 ( 1028)
0x40080000: _WindowOverflow4 at /home/private/esp32/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730
I (19441) esp_image: segment 3: paddr=0x001360d8 vaddr=0x40080404 size=0x09f40 ( 40768)
I (19461) esp_image: segment 4: paddr=0x00140020 vaddr=0x400d0020 size=0x9a560 (632160) map
0x400d0020: _stext at ??:?
I (19461) wifi:new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
I (19471) wifi:state: init -> auth (b0)
I (19471) wifi:state: auth -> assoc (0)
I (19481) wifi:state: assoc -> run (10)
I (19491) wifi:connected with myssid, aid = 2, channel 11, BW20, bssid = f4:92:bf:a0:bd:20
I (19491) wifi:security: WPA2-PSK, phy: bgn, rssi: -57
I (19501) wifi:pm start, type: 0
I (19541) wifi:AP's beacon interval = 102400 us, DTIM period = 3
E (19691) esp_image: invalid segment length 0xffffffff
E (19691) ota: Image validation failed, image is corrupted
E (19691) ota: ESP_HTTPS_OTA upgrade failed 5379
I (19691) wifi:Set ps type: 1
I (20191) network: connected
I (20191) wifi: sta_got_ip: 192.168.1.81
I (20191) esp_netif_handlers: sta ip: 192.168.1.81, mask: 255.255.255.0, gw: 192.168.1.1
But even when I remove everything but the bare essentials and the OTA part, I still get this problem.