Closed astorun closed 7 months ago
hi and thanks for your feedback 👍
first call
Free internal heap before TLS 123043
....
Free internal heap after TLS 91859
second call
Free internal heap before TLS 122927 <<< 116 bytes lost
!! stack overflow when Verifying peer X.509 certificate... !!
116 bytes mem leak doesn't seem much; but it's still a strong sign of memory fragmentation
the issue can probably be solved by freeing around 10KB or heap or by using an esp32 with psram
there's not much esp32FOTA library can do since it happens while x509 is being verified by the espressif core, maybe try it with an older core version?
Thanks for pointing that out!
We actually realized SPI-RAM was not properly initialized for our ESP32-S3 and fixed it. Diverted some resources to external memory to open space in internal memory.
Now we have a ton of free internal memory.
However the issue still persists even there is a more than 180kb free internal memory available. It happens only after tcp connection is lost and trying to connect again on the third tryout.
12:44:51:102 -> =======================================================
12:44:51:102 ->
12:44:51:102 -> Machine Name:
12:44:51:108 -> GR-PRO-R3
12:44:51:108 -> Machine Version:
12:44:51:108 -> GR PRO R3
12:44:51:108 -> Firmware version: 9.9.9-DEV
12:44:51:113 ->
12:44:51:113 -> MCU: ESP32-S3 Rev 0
12:44:51:113 -> This chip has 2 cores
12:44:51:113 -> Board ID: 48:27:E2:8F:2A:D8
12:44:51:119 ->
12:44:51:119 -> CPU Freq: 240 MHz
12:44:51:119 -> XTAL Freq: 40 MHz
12:44:51:126 -> APB Freq: 80000000 Hz
12:44:51:126 -> Free heap memory: 296063 bytes
12:44:51:132 -> Free PSRAM: 2094851 bytes
12:44:52:479 -> [ 1798][D][esp32fota.cpp:140] setString(): Assigned value: redacted <= redacted
12:44:52:485 -> [ 1798][D][esp32fota.cpp:140] setString(): Assigned value: redacted <= redacted
12:44:52:515 -> Free PSRAM: 1898043 bytes
12:45:07:470 -> [ 16789][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 0 - WIFI_READY
12:45:07:507 -> [ 16826][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
12:45:07:513 -> [ 16827][V][WiFiGeneric.cpp:340] _arduino_event_cb(): STA Started
12:45:07:518 -> [ 16832][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 2 - STA_START
12:45:11:922 -> [ 21240][V][WiFiGeneric.cpp:362] _arduino_event_cb(): STA Disconnected: SSID: redacted , BSSID: redacted , Reason: 2
12:45:11:927 -> [ 21242][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
12:45:11:938 -> [ 21248][W][WiFiGeneric.cpp:1061] _eventCallback(): Reason: 2 - AUTH_EXPIRE
12:45:11:944 -> [ 21255][D][WiFiGeneric.cpp:1081] _eventCallback(): WiFi Reconnect Running
12:45:11:949 -> [ 21263][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
12:45:16:342 -> [ 25660][V][WiFiGeneric.cpp:362] _arduino_event_cb(): STA Disconnected: SSID: ASTRN, BSSID: 80:cc:9c:3e:d6:04, Reason: 2
12:45:16:347 -> [ 25662][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
12:45:16:358 -> [ 25668][W][WiFiGeneric.cpp:1061] _eventCallback(): Reason: 2 - AUTH_EXPIRE
12:45:16:364 -> [ 25675][D][WiFiGeneric.cpp:1085] _eventCallback(): WiFi AutoReconnect Running
12:45:16:369 -> [ 25684][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
12:45:20:776 -> [ 30095][V][WiFiGeneric.cpp:362] _arduino_event_cb(): STA Disconnected: SSID: redacted , BSSID: redacted , Reason: 2
12:45:20:782 -> [ 30097][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
12:45:20:793 -> [ 30103][W][WiFiGeneric.cpp:1061] _eventCallback(): Reason: 2 - AUTH_EXPIRE
12:45:20:798 -> [ 30110][D][WiFiGeneric.cpp:1085] _eventCallback(): WiFi AutoReconnect Running
12:45:20:804 -> [ 30118][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
12:45:22:456 -> [ 31775][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
12:45:22:461 -> [ 31776][V][WiFiGeneric.cpp:362] _arduino_event_cb(): STA Disconnected: SSID: ASTRN, BSSID: 80:cc:9c:3e:d6:04, Reason: 202
12:45:22:792 -> [ 32106][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
12:45:22:797 -> [ 32109][W][WiFiGeneric.cpp:1061] _eventCallback(): Reason: 202 - AUTH_FAIL
12:45:22:803 -> [ 32118][V][WiFiGeneric.cpp:362] _arduino_event_cb(): STA Disconnected: SSID: ASTRN, BSSID: 80:cc:9c:3e:d6:04, Reason: 202
12:45:22:814 -> [ 32126][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
12:45:22:825 -> [ 32134][W][WiFiGeneric.cpp:1061] _eventCallback(): Reason: 202 - AUTH_FAIL
12:45:25:229 -> [ 34548][V][WiFiGeneric.cpp:362] _arduino_event_cb(): STA Disconnected: SSID: ASTRN, BSSID: 00:00:00:00:00:00, Reason: 205
12:45:25:234 -> [ 34549][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
12:45:25:246 -> [ 34556][W][WiFiGeneric.cpp:1061] _eventCallback(): Reason: 205 - CONNECTION_FAIL
12:45:25:251 -> [ 34563][D][WiFiGeneric.cpp:1085] _eventCallback(): WiFi AutoReconnect Running
12:45:25:256 -> [ 34572][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
12:45:29:723 -> [ 39041][V][WiFiGeneric.cpp:362] _arduino_event_cb(): STA Disconnected: SSID: ASTRN, BSSID: 80:cc:9c:3e:d6:04, Reason: 2
12:45:29:729 -> [ 39044][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
12:45:29:740 -> [ 39050][W][WiFiGeneric.cpp:1061] _eventCallback(): Reason: 2 - AUTH_EXPIRE
12:45:29:745 -> [ 39057][D][WiFiGeneric.cpp:1085] _eventCallback(): WiFi AutoReconnect Running
12:45:29:751 -> [ 39065][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
12:45:30:676 -> [ 39996][V][WiFiGeneric.cpp:355] _arduino_event_cb(): STA Connected: SSID: ASTRN, BSSID: 80:cc:9c:3e:d6:04, Channel: 7, Auth: WPA2_WPA3_PSK
12:45:30:687 -> [ 39997][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
12:45:31:679 -> [ 40998][V][WiFiGeneric.cpp:369] _arduino_event_cb(): STA Got New IP:192.168.1.50
12:45:31:684 -> [ 40999][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 7 - STA_GOT_IP
12:45:31:689 -> [ 41002][D][WiFiGeneric.cpp:1102] _eventCallback(): STA IP: 192.168.1.50, MASK: 255.255.255.0, GW: 192.168.1.1
12:45:55:453 -> [ 64773][I][esp32fota.cpp:815] execHTTPcheck(): Getting HTTP: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:45:55:459 -> [ 64773][I][esp32fota.cpp:360] setupHTTP(): Connecting to: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:45:55:470 -> [ 64784][V][HTTPClient.cpp:252] beginInternal(): url: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:45:55:481 -> [ 64794][D][HTTPClient.cpp:303] beginInternal(): protocol: https, host: polystruder.com port: 443 url: /ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:45:55:492 -> [ 64806][D][HTTPClient.cpp:598] sendRequest(): request type: 'GET' redirCount: 0
12:45:55:501 ->
12:45:55:521 -> [ 64841][V][ssl_client.cpp:62] start_ssl_client(): Free internal heap before TLS 256643
12:45:55:527 -> [ 64842][V][ssl_client.cpp:68] start_ssl_client(): Starting socket
12:45:55:545 -> [ 64865][V][ssl_client.cpp:146] start_ssl_client(): Seeding the random number generator
12:45:55:550 -> [ 64867][V][ssl_client.cpp:155] start_ssl_client(): Setting up the SSL/TLS structure...
12:45:55:556 -> [ 64870][D][ssl_client.cpp:176] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
12:45:55:567 -> [ 64878][V][ssl_client.cpp:254] start_ssl_client(): Setting hostname for TLS session...
12:45:55:572 -> [ 64886][V][ssl_client.cpp:269] start_ssl_client(): Performing the SSL/TLS handshake...
12:45:56:105 -> [ 65414][V][ssl_client.cpp:290] start_ssl_client(): Verifying peer X.509 certificate...
12:45:56:105 -> [ 65414][V][ssl_client.cpp:298] start_ssl_client(): Certificate verified.
12:45:56:105 -> [ 65417][V][ssl_client.cpp:313] start_ssl_client(): Free internal heap after TLS 254451
12:45:56:111 -> [ 65425][D][HTTPClient.cpp:1170] connect(): connected to polystruder.com:443
12:45:56:122 -> [ 65432][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 182 bytes...
12:45:56:217 -> [ 65536][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'HTTP/1.1 200 OK'
12:45:56:222 -> [ 65537][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Date: Tue, 23 Apr 2024 19:45:57 GMT'
12:45:56:228 -> [ 65542][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Content-Type: application/json'
12:45:56:239 -> [ 65550][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Content-Length: 132'
12:45:56:244 -> [ 65557][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Connection: keep-alive'
12:45:56:250 -> [ 65565][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'last-modified: Mon, 22 Apr 2024 19:23:09 GMT'
12:45:56:261 -> [ 65574][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'etag: "6626b91d-84"'
12:45:56:267 -> [ 65582][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'expires: Thu, 31 Dec 2037 23:55:55 GMT'
12:45:56:278 -> [ 65590][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Cache-Control: max-age=315360000'
12:45:56:289 -> [ 65599][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Cache-Control: public'
12:45:56:294 -> [ 65606][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'accept-ranges: bytes'
12:45:56:300 -> [ 65614][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'CF-Cache-Status: DYNAMIC'
12:45:56:311 -> [ 65622][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=8Ux2L%2B61xFYypv%2F976y3hh5pnulGJvoYl3FDcymBlKT6MBKz%2FBCoVa4XpKJxdCZ1oNNSge0MZ%2FpfSogeEdjz8LuM0eNDaAnZL2B1xDmQ9qHCGkKB9pjKuE12P3u7zKV4K1A%3D"}],"group":"cf-nel","max_age":604800}'
12:45:56:339 -> [ 65650][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
12:45:56:350 -> [ 65661][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Server: cloudflare'
12:45:56:355 -> [ 65668][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'CF-RAY: 87905b5c6d372ac3-LAX'
12:45:56:367 -> [ 65676][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'alt-svc: h3=":443"; ma=86400'
12:45:56:372 -> [ 65684][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: ''
12:45:56:377 -> [ 65690][D][HTTPClient.cpp:1321] handleHeaderResponse(): code: 200
12:45:56:383 -> [ 65695][D][HTTPClient.cpp:1324] handleHeaderResponse(): size: 132
12:45:56:389 -> [ 65701][D][HTTPClient.cpp:642] sendRequest(): sendRequest code=200
12:45:56:394 ->
12:45:56:394 -> [ 65708][D][HTTPClient.cpp:393] disconnect(): tcp keep open for reuse
12:45:56:400 -> [ 65714][I][esp32fota.cpp:702] checkJSONManifest(): Payload type in manifest GR-PRO-R3 matches current firmware GR-PRO-R3
12:45:56:411 -> [ 65724][D][esp32fota.cpp:714] checkJSONManifest(): JSON version: 9.9.9 (semver)
12:45:56:422 -> [ 65731][I][esp32fota.cpp:944] debugSemVer(): Payload firmware version: 9.9.9
12:45:56:427 -> [ 65738][I][esp32fota.cpp:753] checkJSONManifest(): JSON manifest provided keys: url=true, host: false, port: false, bin: false, fs: []
12:49:55:161 -> [304486][I][esp32fota.cpp:815] execHTTPcheck(): Getting HTTP: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:49:55:167 -> [304486][I][esp32fota.cpp:360] setupHTTP(): Connecting to: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:49:55:178 -> [304496][V][HTTPClient.cpp:252] beginInternal(): url: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:49:55:189 -> [304506][D][HTTPClient.cpp:303] beginInternal(): protocol: https, host: polystruder.com port: 443 url: /ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:49:55:200 -> [304519][D][HTTPClient.cpp:598] sendRequest(): request type: 'GET' redirCount: 0
12:49:55:211 ->
12:49:55:211 -> [304526][D][HTTPClient.cpp:1130] connect(): already connected, reusing connection
12:49:55:217 -> [304534][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 182 bytes...
12:49:55:312 -> [304637][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'HTTP/1.1 200 OK'
12:49:55:318 -> [304637][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Date: Tue, 23 Apr 2024 19:49:56 GMT'
12:49:55:323 -> [304642][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Content-Type: application/json'
12:49:55:334 -> [304650][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Content-Length: 132'
12:49:55:340 -> [304657][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Connection: keep-alive'
12:49:55:346 -> [304665][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'last-modified: Mon, 22 Apr 2024 19:23:09 GMT'
12:49:55:357 -> [304674][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'etag: "6626b91d-84"'
12:49:55:362 -> [304682][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'expires: Thu, 31 Dec 2037 23:55:55 GMT'
12:49:55:373 -> [304691][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Cache-Control: max-age=315360000'
12:49:55:384 -> [304699][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Cache-Control: public'
12:49:55:390 -> [304707][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'accept-ranges: bytes'
12:49:55:396 -> [304714][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'CF-Cache-Status: DYNAMIC'
12:49:55:407 -> [304723][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=q6I5Gom8x%2FQQenawpGvrY4NTvXgjh8I%2B6ApUZhQlKH7jw%2FTUcQA8lVpntEVTSJoCtIfMwk%2BpH9Bg2eyH8Bx3lwXTlLAgyvRQAwy3v6u9VUKGuit1XTKg%2BAdZSmtVBSrUV5g%3D"}],"group":"cf-nel","max_age":604800}'
12:49:55:434 -> [304750][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
12:49:55:446 -> [304761][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Server: cloudflare'
12:49:55:451 -> [304768][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'CF-RAY: 87906132b9632ac3-LAX'
12:49:55:462 -> [304776][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'alt-svc: h3=":443"; ma=86400'
12:49:55:468 -> [304784][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: ''
12:49:55:473 -> [304790][D][HTTPClient.cpp:1321] handleHeaderResponse(): code: 200
12:49:55:479 -> [304796][D][HTTPClient.cpp:1324] handleHeaderResponse(): size: 132
12:49:55:484 -> [304802][D][HTTPClient.cpp:642] sendRequest(): sendRequest code=200
12:49:55:490 ->
12:49:55:490 -> [304809][D][HTTPClient.cpp:393] disconnect(): tcp keep open for reuse
12:49:55:496 -> [304814][I][esp32fota.cpp:702] checkJSONManifest(): Payload type in manifest GR-PRO-R3 matches current firmware GR-PRO-R3
12:49:55:506 -> [304825][D][esp32fota.cpp:714] checkJSONManifest(): JSON version: 9.9.9 (semver)
12:49:55:518 -> [304832][I][esp32fota.cpp:944] debugSemVer(): Payload firmware version: 9.9.9
12:49:55:523 -> [304839][I][esp32fota.cpp:753] checkJSONManifest(): JSON manifest provided keys: url=true, host: false, port: false, bin: false, fs: []
12:50:48:064 -> [357390][I][esp32fota.cpp:815] execHTTPcheck(): Getting HTTP: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:50:48:070 -> [357390][I][esp32fota.cpp:360] setupHTTP(): Connecting to: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:50:48:081 -> [357401][V][HTTPClient.cpp:252] beginInternal(): url: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:50:48:092 -> [357411][D][HTTPClient.cpp:303] beginInternal(): protocol: https, host: polystruder.com port: 443 url: /ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
12:50:48:103 -> [357423][D][HTTPClient.cpp:598] sendRequest(): request type: 'GET' redirCount: 0
12:50:48:114 ->
12:50:48:114 -> [357431][D][HTTPClient.cpp:1130] connect(): already connected, reusing connection
12:50:48:120 -> [357438][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 182 bytes...
12:50:48:176 -> [357501][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'HTTP/1.1 200 OK'
12:50:48:181 -> [357502][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Date: Tue, 23 Apr 2024 19:50:49 GMT'
12:50:48:187 -> [357506][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Content-Type: application/json'
12:50:48:198 -> [357514][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Content-Length: 132'
12:50:48:203 -> [357522][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Connection: keep-alive'
12:50:48:209 -> [357530][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'last-modified: Mon, 22 Apr 2024 19:23:09 GMT'
12:50:48:220 -> [357539][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'etag: "6626b91d-84"'
12:50:48:226 -> [357546][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'expires: Thu, 31 Dec 2037 23:55:55 GMT'
12:50:48:237 -> [357555][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Cache-Control: max-age=315360000'
12:50:48:248 -> [357563][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Cache-Control: public'
12:50:48:253 -> [357571][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'accept-ranges: bytes'
12:50:48:259 -> [357578][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'CF-Cache-Status: DYNAMIC'
12:50:48:270 -> [357587][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=eAqPCwpi1MOhz7QZ6cepbXpdCK6gdBGrAE28pIWqC7G05bNQ0GXzGr3H5RGssJYGogAgau0I6K%2FqISGdM%2FO9Qgt03gGoi1z%2BSskSddmwmp51KE3Bj4iCUaKdDgNLCSLso1Q%3D"}],"group":"cf-nel","max_age":604800}'
12:50:48:301 -> [357614][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}'
12:50:48:309 -> [357625][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'Server: cloudflare'
12:50:48:314 -> [357632][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'CF-RAY: 8790627d6b5a2ac3-LAX'
12:50:48:320 -> [357640][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: 'alt-svc: h3=":443"; ma=86400'
12:50:48:331 -> [357648][V][HTTPClient.cpp:1264] handleHeaderResponse(): RX: ''
12:50:48:337 -> [357654][D][HTTPClient.cpp:1321] handleHeaderResponse(): code: 200
12:50:48:342 -> [357660][D][HTTPClient.cpp:1324] handleHeaderResponse(): size: 132
12:50:48:348 -> [357666][D][HTTPClient.cpp:642] sendRequest(): sendRequest code=200
12:50:48:353 ->
12:50:48:353 -> [357673][D][HTTPClient.cpp:393] disconnect(): tcp keep open for reuse
12:50:48:359 -> [357678][I][esp32fota.cpp:702] checkJSONManifest(): Payload type in manifest GR-PRO-R3 matches current firmware GR-PRO-R3
12:50:48:370 -> [357689][D][esp32fota.cpp:714] checkJSONManifest(): JSON version: 9.9.9 (semver)
12:50:48:376 -> [357696][I][esp32fota.cpp:944] debugSemVer(): Payload firmware version: 9.9.9
12:50:48:387 -> [357703][I][esp32fota.cpp:753] checkJSONManifest(): JSON manifest provided keys: url=true, host: false, port: false, bin: false, fs: []
13:32:42:970 -> [2872343][I][esp32fota.cpp:815] execHTTPcheck(): Getting HTTP: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
13:32:42:976 -> [2872343][I][esp32fota.cpp:360] setupHTTP(): Connecting to: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
13:32:42:987 -> [2872354][V][HTTPClient.cpp:252] beginInternal(): url: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
13:32:42:998 -> [2872364][D][HTTPClient.cpp:303] beginInternal(): protocol: https, host: polystruder.com port: 443 url: /ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
13:32:43:009 -> [2872376][D][HTTPClient.cpp:598] sendRequest(): request type: 'GET' redirCount: 0
13:32:43:020 ->
13:32:43:020 -> [2872384][D][HTTPClient.cpp:1130] connect(): already connected, reusing connection
13:32:43:026 -> [2872392][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 182 bytes...
13:32:43:058 -> [2872431][E][ssl_client.cpp:37] _handle_error(): [data_to_read():361]: (-80) UNKNOWN ERROR CODE (0050)
13:32:43:064 -> [2872431][V][ssl_client.cpp:321] stop_ssl_socket(): Cleaning SSL connection.
13:32:43:069 -> [2872436][D][HTTPClient.cpp:642] sendRequest(): sendRequest code=-5
13:32:43:075 ->
13:32:43:075 -> [2872442][W][HTTPClient.cpp:1483] returnError(): error(-5): connection lost
13:32:43:086 -> [2872449][D][esp32fota.cpp:831] execHTTPcheck(): Unknown HTTP response
13:32:43:091 -> [2872455][D][HTTPClient.cpp:408] disconnect(): tcp is closed
13:32:43:095 ->
13:32:49:509 -> [2878882][I][esp32fota.cpp:815] execHTTPcheck(): Getting HTTP: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
13:32:49:514 -> [2878882][I][esp32fota.cpp:360] setupHTTP(): Connecting to: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
13:32:49:526 -> [2878893][V][HTTPClient.cpp:252] beginInternal(): url: https://polystruder.com/ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
13:32:49:537 -> [2878903][D][HTTPClient.cpp:303] beginInternal(): protocol: https, host: polystruder.com port: 443 url: /ps_fupd/conf/gr_pro/r3Dev/fwDesc.json
13:32:49:548 -> [2878915][D][HTTPClient.cpp:598] sendRequest(): request type: 'GET' redirCount: 0
13:32:49:557 ->
13:32:49:573 -> [2878946][V][ssl_client.cpp:62] start_ssl_client(): Free internal heap before TLS 256047
13:32:49:579 -> [2878946][V][ssl_client.cpp:68] start_ssl_client(): Starting socket
13:32:49:584 -> [2878958][V][ssl_client.cpp:146] start_ssl_client(): Seeding the random number generator
13:32:49:590 -> [2878960][V][ssl_client.cpp:155] start_ssl_client(): Setting up the SSL/TLS structure...
13:32:49:601 -> [2878964][D][ssl_client.cpp:176] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
13:32:49:606 -> [2878973][V][ssl_client.cpp:254] start_ssl_client(): Setting hostname for TLS session...
13:32:49:617 -> [2878981][V][ssl_client.cpp:269] start_ssl_client(): Performing the SSL/TLS handshake...
13:32:49:785 ->
13:32:49:785 -> ***ERROR*** A stack overflow in task esp_timer has been detected.
13:32:49:790 ->
13:32:49:790 ->
13:32:49:790 -> Backtrace: 0x40377979:0x3fcf2b40 0x4037ea61:0x3fcf2b60 0x4038202a:0x3fcf2b80 0x40380a49:0x3fcf2bf0 0x4037eb18:0x3fcf2c10 0x4037eb0e:0x4209ba03 |<-CORRUPTED
13:32:49:811 ->
13:32:49:811 ->
13:32:49:811 ->
13:32:49:811 ->
13:32:49:811 -> ELF file SHA256: 81e14bd6e6889240
13:32:49:811 ->
13:32:49:811 -> Rebooting...
13:32:49:816 -> ESP-ROM:esp32s3-20210327
13:32:49:816 -> Build:Mar 27 2021
13:32:49:816 -> rst:0xc (RTC_SW_CPU_RST),boot:0xb (SPI_FAST_FLASH_BOOT)
13:32:49:821 -> Saved PC:0x403774e1
13:32:49:821 -> SPIWP:0xee
13:32:49:827 -> mode:DIO, clock div:1
13:32:49:827 -> load:0x3fce3808,len:0x470
13:32:49:827 -> load:0x403c9700,len:0xc3c
13:32:49:832 -> load:0x403cc700,len:0x2e80
13:32:49:832 -> entry 0x403c98e8
13:32:50:186 -> [ 374][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
13:32:50:220 -> [ 410][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=2 scl=1 freq=400000
13:32:50:231 ->
13:32:50:231 -> =======================================================
ESP-IDF (6.5.0)
have you tried idf menuconfig and extend the value of CONFIG_ESP_TIMER_TASK_STACK_SIZE ?
I tried to increase it before fixing the issue with psram but with no success a day ago.
However, now per your suggestion, I increased it again from the default value and it appears it is working for now.
I did also some additional tweaks, which I suspect that might have some effect to other numerous settings in menuconfig.
CONFIG_ESP_TIMER_TASK_STACK_SIZE=8192
CONFIG_ARDUINO_LOOP_STACK_SIZE=16384
CONFIG_ASIO_SSL_SUPPORT=y
CONFIG_ASIO_USE_ESP_OPENSSL=y
CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS=y
CONFIG_ESP_TLS_PSK_VERIFICATION=y
CONFIG_ESP_TLS_INSECURE=y
CONFIG_ESP_TLS_SKIP_SERVER_CERT_VERIFY=y
CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH=y
CONFIG_MBEDTLS_PSK_MODES=y
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK=y
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK=y
CONFIG_TIMER_TASK_STACK_SIZE=8192
I will test it further and report back if the issue persists.
It seems it is solved now. No more random restarts due to timer errors. Closing this issue.
Hi Im having simillar issues: abort() was called at PC 0x40376bfa on core 1.
`This server supports resume! Begin Firmware OTA. This may take 2 - 5 mins to complete. Things might be quiet for a while.. Patience! I believe I have a Task using this core, need to investigate further.
abort() was called at PC 0x40376bfa on core 1
Backtrace: 0x40378032:0x3fceb9d0 0x4037df55:0x3fceb9f0 0x403843f5:0x3fceba10 0x40376bfa:0x3fceba90 0x4204fea3:0x3fcebae0 0x42045565:0x3fcebb00 0x420c8576:0x3fcebb20 0x420c87e3:0x3fcebb40 0x42042299:0x3fcebb60 0x4204292b:0x3fcebde0 0x4200b035:0x3fcebe30 0x4200b08f:0x3fcebeb0 0x42048909:0x3fcebf40`
ESP-ROM:esp32s3-20210327 Build:Mar 27 2021 rst:0xc (RTC_SW_CPU_RST),boot:0x18 (SPI_FAST_FLASH_BOOT) Saved PC:0x420e2682 SPIWP:0xee mode:DIO, clock div:1 load:0x3fce3808,len:0x44c load:0x403c9700,len:0xbe4 load:0x403cc700,len:0x2a68 entry 0x403c98d4 [ 303][D][esp32FOTA.cpp:141] setString(): Assigned value: esp32-fota-http <= esp32-fota-http [ 303][I][esp32FOTA.cpp:901] debugSemVer(): Current firmware version: 1.0.6 [ 324][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
Any pointers would be appreciated.
Hi all,
I am getting an error with our esp32 FOTA code.
Here is portion of the code that we are using below. We are calling in another part of the program.
The problem related with stack overflow does happens randomly. Here is the information how we call the code in background.
Board boots without any issue. After 20 seconds, it will automatically connects to wifi. After 60 seconds it will start checking if there is a firmware update and only if wifi connection is established. Everything works fine here.
If we request another firmware update as soon as the initial firmware check it works normal.
However, after around a few minutes, if we request another software update check via user interface, everytime it results the esp32 halt just before the
[871411][V][ssl_client.cpp:269] start_ssl_client(): Performing the SSL/TLS handshake...
It seems like it is happening only after TCP connection is lost.
Not sure how to fix this issue.