Appearance
OTA Upgrade Commands
OTA Upgrade Command Overview
These AT commands enable configuring OTA upgrade and reading OTA upgrade data features.
AT Command | Description |
---|---|
AT+QIOTOTAREQ | Request OTA Upgrade Plan |
AT+QIOTUPDATE | Configure OTA Upgrade Operations |
AT+QIOTOTARD | Read 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
cAT+QIOTOTAREQ=?
Response
Return the parameter range supported to be set.
c+QIOTOTAREQ: <info> OK
Write/Execution Command
Issue
cAT+QIOTOTAREQ[=<info>]
Response
Successful execution. Any upgrade plan will be reported by event +QIOTEVT: 7.
cOK
If there is any error:
cERROR
Parameter
<info>
: Integer type. Whether SHA256 is needed to verify the file.0
: No1
: 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
cAT+QIOTUPDATE=?
Response
Return the parameter range supported to be configured.
c+QIOTUPDATE: (range of supported <update_action>s) OK
Write Command
Issue
cAT+QIOTUPDATE=<update_action>
Response
If OTA upgrade operations are configured successfully:
cOK
If there is any error:
cERROR
Parameter
<update_action>
Integer type. OTA upgrade operations.0
Refuse the upgrade1
Confirm the upgrade2
MCU requests to download the next block of firmware data3
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
cAT+QIOTOTARD=?
Response
Return the parameter supported range.
c+QIOTOTARD: <start>,(range of supported <max_length>s) OK
Write Command
Issue
cAT+QIOTOTARD=<start>,<length>
Response
If the command is executed successfully:
c+QIOTOTARD: <start>,<length> <data> OK
If there is any error:
cERROR
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
......