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?

preguntada hace 2 años294 visualizaciones
1 Respuesta
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
EXPERTO
Greg_B
respondido hace 2 años
profile picture
INGENIERO DE SOPORTE
revisado hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas