OTA Commands

The three OTAOver-the-Air commands are described below.

NOTE

The Module OTA only supports the download of the Ayla Production Cellular Agent. The OTA of the Quectel SDK is not supported. Please work directly with Quectel to use FOTAFirmware-Over-the-Air with the Quectel BG96 NB-IoT module.

1. Asynchronous Notification of the Image

ADA: ”ota”,”notify”,<type>,<id>,[<size>,<ver>]
<name> The name of configuration item.
<type> This is “host” or “module.”
<id> Short string specifying the ID of the OTA command to tie together the download and status commands.
<size> Length of the image in bytes for the host OTA only
<ver> Version of the image from the cloud for the host OTA only

Example: Notification of the Host OTA

AT+ADA: “ota”,”notify”,”host”,”id4”,150224,”ver 1.3”

Example: Notification of the Module OTA

AT+ADA: “ota”,”notify”,”module”,”idm1”

2. Downloading the Host Image

AT+ADA=”ota”,”dl”,<type>,<id>[,<len>]
<type> This is “host” or “module.”
<id> Short string specifying the ID of the OTA command to tie together the download and status commands.
Response OK
Async Response +ADA: “ota”,”part”,<id>,<data-base-64>
Error Response +ADA: ”ota”,”err”,<number>[,”<explanation>”]

Example

NOTE

Notice below that the 128 bytes of the image is downloaded first to, for example, check the header or in order to allow other commands to run during the download. Random data, which was 128 bytes before base-64 encoding, is shown.

AT+ADA=”ota”,”dl”,”host”,”id4”,128

OK

+ADA: ”ota”,”part”,”id4”,”qHMvOsl52J8oad6w3LI1Jtdcrk6jC+ij5iXVyW”

+ADA: ”ota”,”part”,”id4”,”sh7w/J0pnFwT5fKFA6GaTW2g3rmCIYuMKUZkTDU”

+ADA: ”ota”,”part”,”id4”,”OKd58QLo6mh0uYDtQPcdNiQb+Kj7Tt4n9MOz7Gg”

+ADA: ”ota”,”part”,”id4”,”aUBykInk4qZtOa+vIpIYcknvC8oxmFtmgj8cqRu”

+ADA: ”ota”,”ok”,”id4”,”JdqD2RqArBzr4gs=”

3. Finishing the OTA Download

This command (shown below) indicates that the host has completed the OTA download and is ready to apply the image, or that the OTA download has failed.

+ADA=”ota”,”status”,”host”,<id>[,<status>]

AT+ADA=”ota”,”status”,”host”,<id>,<status>
<id>

Short string specifying the ID of the OTA command to tie together the download and status commands.

<status> Status code. 0 indicates success; non-zero is the patch error number.
Response OK

This command can be sent at any time during the host OTA download in case of failures.

Module OTA Examples

Start a module OTA download:

AT+ADA=”ota”,”dl”,”module”,”idm1”

OK

Send a notification when a module OTA download is complete:

+ADA: “ota”,”notify”,”module”,”idml”,”ready”

Have the MCU indicate that the module may apply the OTA and reboot:

AT+ADA=”ota”,”apply”,”module”,”idm1”

OK

Please click here to let us know how we're doing. Thank you.