How does OTA agent work? How does it interface with OTA PAL? What is a file context?

0

I would like to know in more details, how OTA update works. Specifically, what is the role of OTA agent, and how does it initiate an update? What does it send to the device? What is a file context?

已提问 2 年前294 查看次数
1 回答
3

Hi. If you didn't already find it, please review the OTA design documentation. This explains the software architecture in detail.

The AWS IoT OTA library is the at the centre of all this. It's a highly portable pure ANSI C library, free of any operating system dependencies. And it is the OTA agent implementation. It offers a public API consisting of only a handful of functions. You call these from your application firmware. An example implementation (on FreeRTOS) can be found here: https://github.com/aws/amazon-freertos/blob/main/demos/ota/ota_demo_core_mqtt/ota_demo_core_mqtt.c

The AWS IoT OTA mechanism is built on top of AWS IoT Core Jobs. OTA is a job with a special pre-defined job document. The AWS IoT OTA library processes incoming jobs, and specifically the OTA job document.

An OTA update is initiated on the cloud side from the console or from a CLI or SDK call of the relevant API. This creates a job with an OTA job document. The OTA agent on the device polls the job queue and sees when the job, with OTA job document, has been made available.

The OTA PAL (Platform Abstraction Layer) is a layer you need to develop (to match a pre-defined API) to port the OTA library to your device. It abstracts the storage of the new binary file in your device, amongst other things. You can find some reference implementations here:

Finally, the file context is just a data structure used by the OTA agent to remember the current state of its processing of a particular file. The OTA update contains one or more files (and very often just one file, being a single firmware binary image file).

profile pictureAWS
专家
Greg_B
已回答 2 年前
profile picture
支持工程师
已审核 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则