Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
spdodd
Level 1
Level 1
5 sign-ins First reply posted First question asked

I am currently working a project that requires OTA functionality.  I am currently at a point where I have increased the sizes of the following buffers to account for the length of presigned URLs:

- WICED_OTA2_HTTP_QUERY_SIZE
- WICED_OTA2_HOST_NAME
- WICED_OTA2_FILE_PATH

Updating via OTA 2 has been tested via a locally hosted web server (non HTTPS) with long (2k) URLs.  This works as intended and ensures that the length itself is not resulting in any issues downloading the image.

The device has been loaded with the Starfield signer used to generate the signing information used in the presigned URLs using wiced_tls_init_root_ca_certificates(starfield_cert) prior to initializing OTA2, which should be significant for verifying the URLs.  However, when attempting to download via a presigned url, I get the following output (private info redacted):

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

0047 00:02:20.488 OTA2: OTA2_EVENT_WORKER_START_DOWNLOAD!
0048 00:02:20.493 wiced_ota2_service_get_the_update() start!
0049 00:02:20.499 wiced_ota2_service_get_the_update() Use the ota2 list count:5!
0050 00:02:20.506 wiced_ota2_service_network_switchto_ota2_ap() already connected to: XXXXXXXX
OTA access point connect success!
0051 00:02:20.517 Connect to: host:XXXXXXXXXXXXX.s3.us-east-2.amazonaws.com path:/OTA2_image_file.bin?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEAEaCXVzLWVhc3QtMiJHMEUCIQCcDTpP%2FgiQLzTjrRDDB5IkgekIXi7oeuWgpNXEpsiqtAIgcoNPiTDJ2weMhjX1eYsGpM9ZpN%2FLRqUCvJMtYz%2BqnbEq3QIIehACGgw2MTY0MTg2NjAwMTMiDOjAPtjf54GP2Krxzyq6Apn64H88uzj%2FaXhrHfYYrzs7VdgN%2F1zj6eEk%2F61p2j0RXtu83VzwNnMQOYA4Wh3JfBrpAqMfLeM3UvgFdSyU8ORikTjWcdL5Jcewa%2Bh0Ekse%2BQcLSPSYYUdNNloHds5Sewxd3Ib1PJW5frXwV1bp0A9%2FLjGlAeS5MMaQAPODeM0cpmKsvefG6Z9CR7pqjFXGyRPMpmROxZqqzq7qB7sile%2BHihl7pMWzJIosEsW4vUyDUpq2dRC3lK%2FB8IaVbhHGJ7Lg0h6ZGJ2olz5RsvNLylxlwyz0qI5JemrkGM02tBkTFYmLzJRRC1zGwW63CQTITQRNSjWhcabgnJglXuGHK%2FHyRZwjpDSBNGFugH3aaQj8WJp1hCGotJ439owjqy3BPTCvWcMV2VDKMvwk32rCvGA9r3KOI71Ti4dxMPTDq4QGOr8BsY2EB7Gi3qQ4NuORTmtjH3wTT5FC1cXr8RvrXRitUjOFA5QxtFkVvb4UVkP3AL3hOSGvVJZOBZQAiyGNrqSMl%2Bw9xcqbq6PKkjBJzMKo3f4sD9tat4JE1JFI6WeG87sX7fbnaExSb9sHvbPxQOJCNNpcU%2Bo%2BR9vkIPtD71RCU4fSdjP10BNezdo0kmMcsqs5KeKiUEbwyHdgFYfaVV95C2xS96xyL339eZn2W004mKAnqoae3fOcav3YJvptkVA%0052 00:02:20.616 Try 0 Connecting to XXXXXXXXXXXXX.s3.us-east-2.amazonaws.com 52.219.97.146 : 443 !
0053 00:02:20.653 Connected to 52.219.97.146 : 443 !
OTA server connect success!
0054 00:02:20.662 Send query for OTA file: [GET /OTA2_image_file.bin?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEAEaCXVzLWVhc3QtMiJHMEUCIQCcDTpP%2FgiQLzTjrRDDB5IkgekIXi7oeuWgpNXEpsiqtAIgcoNPiTDJ2weMhjX1eYsGpM9ZpN%2FLRqUCvJMtYz%2BqnbEq3QIIehACGgw2MTY0MTg2NjAwMTMiDOjAPtjf54GP2Krxzyq6Apn64H88uzj%2FaXhrHfYYrzs7VdgN%2F1zj6eEk%2F61p2j0RXtu83VzwNnMQOYA4Wh3JfBrpAqMfLeM3UvgFdSyU8ORikTjWcdL5Jcewa%2Bh0Ekse%2BQcLSPSYYUdNNloHds5Sewxd3Ib1PJW5frXwV1bp0A9%2FLjGlAeS5MMaQAPODeM0cpmKsvefG6Z9CR7pqjFXGyRPMpmROxZqqzq7qB7sile%2BHihl7pMWzJIosEsW4vUyDUpq2dRC3lK%2FB8IaVbhHGJ7Lg0h6ZGJ2olz5RsvNLylxlwyz0qI5JemrkGM02tBkTFYmLzJRRC1zGwW63CQTITQRNSjWhcabgnJglXuGHK%2FHyRZwjpDSBNGFugH3aaQj8WJp1hCGotJ439owjqy3BPTCvWcMV2VDKMvwk32rCvGA9r3KOI71Ti4dxMPTDq4QGOr8BsY2EB7Gi3qQ4NuORTmtjH3wTT5FC1cXr8RvrXRitUjOFA5QxtFkVvb4UVkP3AL3hOSGvVJZOBZQAiyGNrqSMl%2Bw9xcqbq6PKkjBJzMKo3f4sD9tat4JE1JFI6WeG87sX7fbnaExSb9sHvbPxQOJCNNpcU%2Bo%2BR9vkIPtD71RCU4fSdjP10BNezdo0kmMcsqs5KeKiUEbwyHdgFYfaVV95C2xS96xyL339eZn2W004mKAnqoae3fOcav3YJvptkVA%3D&X-Amz-Algorithm=AWS4-HMAC-SHA2560055 00:02:21.750 ota2_get_OTA_file() wiced_tcp_receive() 2 timeout!
0056 00:02:22.755 ota2_get_OTA_file() wiced_tcp_receive() 2 timeout!
0057 00:02:23.760 ota2_get_OTA_file() wiced_tcp_receive() 2 timeout!
0058 00:02:24.765 ota2_get_OTA_file() wiced_tcp_receive() 2 timeout!
0059 00:02:24.770 ota2_get_OTA() wiced_ota2_write_data() Timed out received:0 of 0!
0060 00:02:24.778
ota2_get_OTA_file() Exiting 2
0061 00:02:24.782 wiced_ota2_service_get_the_update() wiced_ota2_service_wget_update(header) failed!
OTA update error!
0062 00:02:24.821 wiced_ota2_service_get_the_update() ota2_service_connect() failed (list)!
OTA server connect error!
0063 00:02:24.832 wiced_ota2_service_network_switchto_default_ap() already connected to: XXXXXXXX
OTA update complete!
0064 00:02:24.842 OTA2: wiced_ota2_service_get_the_update() FAILED check if timers started!
0065 00:02:24.850 OTA2: wiced_ota2_service_get_the_update() FAILED set flag START_RETRY_TIMER!
OTA update check!

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

It seems to me that verification of the presigned URL is failing at some level, but I am struggling to see where.  This issue holds true with the standard OTA2 example, with the prementioned buffers increased to accommodate the URL in wiced_ota2_service.h .  Wondering if anyone has any ideas here, or any previous experience using AWS presigned URLs on the WICED platform.  Any ideas are greatly apprecieated.

0 Likes
1 Solution
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

The problem is with the receive first as the timeout is being observed in the logs. Even in the previous response, I see socket being closed

0025 00:03:14.815 ota2_get_OTA_file() wiced_tcp_receive() 7014 socket_closed!

Can you check if you see the same issue with LwIP?

Thanks

Aditi

 

View solution in original post

0 Likes
3 Replies