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?

asked 2 years ago267 views
1 Answer
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
EXPERT
Greg_B
answered 2 years ago
profile picture
SUPPORT ENGINEER
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions