IoT Platform provides the over-the-air (OTA) update and management feature. To update devices, make sure that your devices support the OTA service. Then, you can upload an update package to the IoT Platform console and push OTA update notifications to the devices. This article describes how to add an update package, verify the update package, and push the update package to multiple devices by using the IoT Platform console.
Prerequisites
- For more information about how to configure OTA updates by using device SDKs, see Update devices by using OTA.
- For more information about how to configure OTA updates if your devices are installed with AliOS Things chips, see OTA tutorial for AliOS Things.
Background information
Take note of the following limits of OTA updates:
- Each Alibaba Cloud account can have a maximum of 500 update packages.
- The maximum size of an update package file is 1,000 MB. The file format can only be .bin, .tar, .gz, .tar.gz, .zip, or .gzip.
- Take note of the following limits of update batches:
Update batches: IoT Platform shows created update tasks as different update batches. You can go to the Update Package Details page and view the update batch of the update package on the Batch Management tab.
- You can use an update package to create one or more update batches for different firmware versions to be updated.
- You can use an update package to create only one dynamic update batch for a firmware version to be updated.
- You can use different update packages to create multiple dynamic update batches for a firmware version to be updated.
- Each device can have only one ongoing update batch. A device that has an ongoing update batch is in the To Be Pushed, Pushed, or In Upgrade state.
- Only devices that are connected to IoT Platform by using the Message Queuing Telemetry Transport (MQTT) protocol support the OTA update feature.
- If devices are online, these devices can immediately receive update notifications. If devices are offline, IoT Platform pushes update notifications when devices go online.
Procedure
Result
Find the required firmware and click View in the Actions column. On the Batch Management tab, you can perform the following operations:
- View the status of an update batch.
Click View next to the required update batch. On the Batch Details page, you can view devices in different update statuses on the Device List tab.
State Description To Be Pushed The OTA update notification has not been pushed to the device. This state may appear due to the following three causes: 1. The device is offline. 2. The notification is scheduled to be pushed. 3. The pushing rate exceeds the limit. The following states that correspond to these three causes are displayed:
- To Be Pushed (Device Offline)
- To Be Pushed (Timing: 2020/XX/XX XX:XX:XX)
- To Be Pushed
Pushed The device has received the OTA update notification but has not submitted the progress. In Upgrade The device has received the OTA update notification and submitted the update progress. Updated The device has submitted a valid version number after the update. Note After a device is updated, make sure that the device submits a valid version number at the earliest opportunity. Otherwise, the update may fail due to a timeout issue.Updated Failed OTA updates may fail due to the following causes: - You initiate a new batch update for a device. However, you do not overwrite the previous
update task that is not completed on the device.
You can use one of the following methods to fix the issue:
- After the previous update task is completed, you can initiate a new update.
- Before you initiate a new update for a device, overwrite the previous task that is
still running on the device.
Note If the device is in the In Upgrade state, an update task that is running on the device cannot be overwritten.
- During the update process, an update package may fail to be downloaded, extracted, or verified. The device submits one of the following values when using a specified topic to submit the update progress to IoT Platform: -1, -2, -3, and -4.
- During a device update, the update period starts from the first time the device submits the update progress. The device fails to submit the destination version before the update reaches the end of the specified timeout period.
- The device in the In Upgrade state submits a version that is not the source version or destination version.
If you specify the number of a version to be updated and automatic update retries when you initiate a batch update, the retries are performed after the update fails. An update may fail due to one of the following causes:
- The device in the In Upgrade state submits a version that is not the source version or destination version.
- The device submits one of the following values when using a specified topic to submit the update progress to IoT Platform: -1, -2, -3, and -4.
During automatic retries, the update status of a device in IoT Platform remains unchanged. For example, if a retry occurs on a device that is in the Pushed state, the device status is still displayed as Pushed in the IoT Platform console. If a retry occurs on a device that is in the In Upgrade state, the device status is still displayed as In Upgrade in the IoT Platform console.
NoteIoT Platform does not perform update retries if an update fails due to one of the following causes:
- The update
times out
. - The update is canceled.
Canceled The update for the device is canceled. - Cancel all update tasks of an update batch.
Click Cancel next to the required update batch.
- For a static update batch, only scheduled update tasks are canceled by default. You can cancel all ongoing update tasks that are in the To Be Pushed, Pushed, and In Upgrade states.
- For a dynamic update batch, the dynamic update policy is canceled by default. You can cancel all ongoing update tasks that are in the To Be Pushed, Pushed, and In Upgrade states.