espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
431 stars 145 forks source link

Rainmaker OTA fails - ESP HTTPS OTA Begin failed (MEGH-5052) #287

Open miroslavpetrov opened 7 months ago

miroslavpetrov commented 7 months ago

Answers checklist.

General issue report

We run rainmaker in a private AWS instance. OTA was working fine a few months ago. Now i am trying to update a few nodes and in the console i get the following:

10:15:59.070 -> I (535478) esp_rmaker_ota_using_topics: Upgrade Handler got:{"url":"xxx","fw_version":"2.0","ota_job_id":"ZRhABWWP2GC6DN6yWvvSoK","file_size":1577600}
10:15:59.166 ->  on node/Bx3LawREvwzSiBqN6TCRXP/otaurl topic
10:15:59.198 -> I (535578) esp_rmaker_ota_using_topics: OTA Job ID: ZRhABWWP2GC6DN6yWvvSoK
10:15:59.198 -> I (535588) esp_rmaker_ota_using_topics: URL: xxx
10:15:59.293 -> I (535688) esp_rmaker_ota_using_topics: File Size: 1577600
10:15:59.293 -> I (535698) esp_rmaker_ota: Reporting in-progress: Starting OTA Upgrade
10:15:59.293 -> I (535698) esp_rmaker_ota_using_topics: {"ota_job_id":"ZRhABWWP2GC6DN6yWvvSoK","status":"in-progress","additional_info":"Starting OTA Upgrade"}
10:15:59.327 -> W (535718) esp_rmaker_ota: Starting OTA. This may take time.
10:16:01.272 -> I (537688) esp-x509-crt-bundle: Certificate validated
10:16:06.680 -> W (543098) esp-tls: Failed to open new connection in specified timeout
10:16:06.680 -> E (543098) TRANSPORT_BASE: Failed to open a new connection
10:16:06.712 -> E (543098) HTTP_CLIENT: Connection failed, sock < 0
10:16:06.712 -> E (543098) esp_https_ota: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
10:16:06.712 -> E (543108) esp_https_ota: Failed to establish HTTP connection
10:16:06.712 -> E (543118) esp_rmaker_ota: ESP HTTPS OTA Begin failed
10:16:06.712 -> I (543118) esp_rmaker_ota: Reporting failed: ESP HTTPS OTA Begin failed
10:16:06.746 -> I (543128) esp_rmaker_ota_using_topics: {"ota_job_id":"ZRhABWWP2GC6DN6yWvvSoK","status":"failed","additional_info":"ESP HTTPS OTA Begin failed"}

Any ideas on how to dig deeper in the problem and fix the issue?

shahpiyushv commented 7 months ago

Can you try initialising the console commands using esp_rmaker_console_init() and check memory available after you see this error using mem-dump command on the serial terminal?

Also, please check if you can download the OTA image using the url from a host machine connected to the same network.