AWS IoT Over-the-air Update  v3.1.0
Client library for AWS IoT OTA
AWS IoT Over-the-air Update Documentation

AWS IoT Over-the-air Update Library.

AWS IoT Over-the-air Update library enables you to manage the notification of a newly available update, download the update, and perform cryptographic verification of the firmware update. Using the Over-the-air (OTA) client library, you can logically separate firmware updates from the application running on your devices. The Over-the-air (OTA) client library can share a network connection with the application, saving memory in resource-constrained devices. In addition, the OTA library lets you define application-specific logic for testing, committing, or rolling back a firmware update. The library supports different application protocols like Message Queuing Telemetry Transport (MQTT) and Hypertext Transfer Protocol (HTTP) and provides various configuration options you can fine tune depending on network type and conditions.

The major functions that this library’s APIs provide are –

  • Register for notifications or poll for new update requests that are available.
  • Receive, parse and validate the update request.
  • Download and verify the file according to the information in the update request.
  • Run a self-test before activating the received update to ensure the functional validity of the update.
  • Update the status of the device.
See also
Functions for more information.

AWS services can be used with this library to manage various cloud related topics such as sending firmware updates, monitoring large numbers of devices across multiple regions, reducing the blast radius of faulty deployments, and verifying the security of updates.

NOTE: Handling OTA and custom jobs in your application
If your application will process both OTA and custom types of jobs from AWS IoT, we recommend using the feature support for custom jobs in OTA library through the OtaJobEventParseCustomJob event notification in the registered OtaAppCallback_t callback.
However, if your application chooses to use the AWS IoT Jobs library (for handling custom jobs) and the OTA library (for handling OTA jobs) to communicate with AWS IoT through a shared MQTT connection, we suggest that you keep the application logic that uses these libraries within a single task/thread. As the OTA agent also makes calls to the AWS IoT Jobs service, keeping the use of libraries within the same thread context will avoid complexity of synchronizing communication with AWS IoT Jobs topics between multiple tasks/threads. However, if you choose to use different tasks/threads for calling these libraries, please be aware that the OTA library will subscribe and configurably, unsubscribe from AWS IoT Jobs topics, and also attempt to send status updates for incoming non-OTA jobs, if your application configures the OTA library to handle custom jobs.

OTA Dependencies

dot_inline_dotgraph_1.png
OTA Dependencies

Currently, the OTA library has the following direct dependencies:

  • coreJSON: To parse the JSON Job document received for the update.
  • tinyCBOR: To decode the encoded data stream which contains the file blocks.

Memory Requirements

Memory requirements of the OTA library.

Code Size of AWS IoT OTA (example generated with GCC for ARM Cortex-M)
File
With -O1 Optimization
With -Os Optimization
ota.c
8.0K
7.1K
ota_interface.c
0.1K
0.1K
ota_base64.c
0.6K
0.6K
ota_mqtt.c
2.3K
2.2K
ota_cbor.c
0.8K
0.6K
ota_http.c
0.3K
0.3K
Total estimates
12.1K
10.9K