Skip to content

OTA Upgrade Commands

OTA Upgrade Command Overview

These AT commands enable configuring OTA upgrade and reading OTA upgrade data features.

AT CommandDescription
AT+QIOTOTAREQRequest OTA Upgrade Plan
AT+QIOTUPDATEConfigure OTA Upgrade Operations
AT+QIOTOTARDRead SOTA Data by Blocks

AT Command Description

AT+QIOTOTAREQ (Request OTA Upgrade Plan)

  • Description: This command requests an OTA upgrade plan from Developer Center.
  • Maximum Response Time: 300 ms.
  • Characteristics: The command takes effect immediately.

Test Command

  • Issue

    c
    AT+QIOTOTAREQ=?
  • Response

    Return the parameter range supported to be set.

    c
    +QIOTOTAREQ: <info>
    
    OK

Write/Execution Command

  • Issue

    c
    AT+QIOTOTAREQ[=<info>]
  • Response

    Successful execution. Any upgrade plan will be reported by event +QIOTEVT: 7.

    c
    OK

    If there is any error:

    c
    ERROR

Parameter

  • <info> : Integer type. Whether SHA256 is needed to verify the file.
    • 0 : No
    • 1 : Yes

NOTE

  • This command is supported in SDK versions 2.1.2 and above.

Example

Note: This command is valid only if the OTA upgrade plan request has been initiated on Developer Center.

Example 1 (Initiate OTA upgrade plan request)

i. Configure and enable SHA256 to verify the file.

ii. Initiate the OTA upgrade plan request.

c
AT+QIOTOTAREQ=1

OK
AT+QIOTOTAREQ

OK

AT+QIOTUPDATE (Configure OTA Upgrade Operations)

  • Description: This command configures OTA upgrade operations.
  • Maximum Response Time: 300 ms.
  • Characteristics: The command takes effect immediately.

Test Command

  • Issue

    c
    AT+QIOTUPDATE=?
  • Response

    Return the parameter range supported to be configured.

    c
    +QIOTUPDATE: (range of supported <update_action>s)
    
    OK

Write Command

  • Issue

    c
    AT+QIOTUPDATE=<update_action>
  • Response

    If OTA upgrade operations are configured successfully:

    c
    OK

    If there is any error:

    c
    ERROR

Parameter

  • <update_action> Integer type. OTA upgrade operations.
    • 0 Refuse the upgrade
    • 1 Confirm the upgrade
    • 2 MCU requests to download the next block of firmware data
    • 3 MCU reports the upgrade status

NOTE

  • This command is supported in SDK version 2.1.2 and above.

Example

Note: This command is valid only if the OTA upgrade plan request has been activated on Developer Center.

Example 1 (Respond to OTA upgrade plan and confirm the upgrade.)

c
AT+QIOTUPDATE=1

OK

AT+QIOTOTARD (Read SOTA Data by Blocks)

  • Description: This command reads SOTA data by blocks.
  • Maximum Response Time: 300 ms.
  • Characteristics: The command takes effect immediately.

Test Command

  • Issue

    c
    AT+QIOTOTARD=?
  • Response

    Return the parameter supported range.

    c
    +QIOTOTARD: <start>,(range of supported <max_length>s)
    
    OK

Write Command

  • Issue

    c
    AT+QIOTOTARD=<start>,<length>
  • Response

    If the command is executed successfully:

    c
    +QIOTOTARD: <start>,<length>
    <data>
    
    OK

    If there is any error:

    c
    ERROR

Parameter

  • <start> Integer type. Start position for reading data. Unit: byte.
  • Note: The first packet of data is read from 0, and the subsequent packets are read from the end address of the previous packet.
  • <max_length> Integer type. Maximum length of data to be read. The length range is subject to the value returned by Test Command.
  • <length> Integer type.Length of actually returned data.
  • <data>: Byte stream type. Firmware data.

NOTE

  • This command is supported in SDK version 2.1.2 and above.

Example

Note: This command is valid only if the OTA upgrade plan request has been initiated on Developer Center.

Example 1 (Read SOTA data by blocks) SOTA data is read by blocks until it is completely read.

c
AT+QIOTOTARD=0,1024
data...

OK
AT+QIOTOTARD=1024,1024
data...

OK
AT+QIOTOTARD=2048,1024
data...

OK
......