OTA example procedure takes too long

sameer
Posts: 6
Joined: Thu Jun 08, 2017 12:57 am

OTA example procedure takes too long

Postby sameer » Fri Aug 04, 2017 12:31 am

Hello there,

I'm trying to understand why the OTA process halts for roughly 60 seconds after it successfully downloads a new binary. And, if possible, can I reduce this halting time? Below is a snippet of my terminal output, and the point at which the program halts for a literal minute. Thank you!

Code: Select all

I (21411) ota: Connected to server
I (21411) ota: Connected to http server
I (21421) ota: Send GET request to server succeeded
I (21421) ota: Writing to partition subtype 16 at offset 0x110000
I (21421) ota: esp_ota_begin succeeded
I (21421) ota: esp_ota_write header OK
I (21431) ota: Have written image length 1827
I (21431) ota: Have written image length 2851
// ... several similar lines later ...
I (22991) ota: Have written image length 567611
I (22991) ota: Have written image length 568272
I (24881) wifi: pm start, type:0
At this point everything seems to pause for a minute, then everything resumes with no issues as indicated below

Code: Select all

I (87671) ota: Connection closed, all packets received
I (87671) ota: Total Write binary data length : 568272
I (88181) ota: Prepare to restart system!
I (88181) wifi: state: run -> init (0)
I (88181) wifi: pm stop, total sleep time: 0/63848744
I tried going through the IDF source code to locate the process responsible for LOGI output with a "wifi" TAG, but couldn't find anything.

Thanks for your time.
-Sameer

sameer
Posts: 6
Joined: Thu Jun 08, 2017 12:57 am

Re: OTA example procedure takes too long

Postby sameer » Fri Aug 04, 2017 9:40 pm

It seems to be a HTTP/1.1 vs HTTP/1.0 issue.

In this example file, modifying this line of code:

Code: Select all

sprintf(http_request, "GET %s HTTP/1.1\r\nHost: %s:%s \r\n\r\n", EXAMPLE_FILENAME, EXAMPLE_SERVER_IP, EXAMPLE_SERVER_PORT);
to

Code: Select all

sprintf(http_request, "GET %s HTTP/1.0\r\nHost: %s:%s \r\n\r\n", EXAMPLE_FILENAME, EXAMPLE_SERVER_IP, EXAMPLE_SERVER_PORT);
solved my problem.

Who is online

Users browsing this forum: cdollar and 109 guests