IoT Platform provides the over-the-air (OTA) update and management feature. Before you update devices, make sure that your devices support the OTA service. If your devices support the OTA service, you can upload an update package on the OTA Update page in the IoT Platform console and specify information about the devices that you want to update. IoT Platform pushes OTA update notifications to the devices. The devices can download the OTA update package and perform OTA updates. This topic describes the limits and procedure for OTA updates.

Prerequisites

Before you use the OTA update feature, make sure that your devices support the OTA service.
  • For more information about how to perform OTA updates by using device SDKs, see Perform OTA updates.
  • For more information about how to perform OTA updates if AliOS Things chips are installed on your devices, see OTA tutorial for AliOS Things.

Usage notes and limits

Table 1. Devices
Feature Limits
Supported protocol Only the devices that are connected to IoT Platform over Message Queuing Telemetry Transport (MQTT) support the OTA update feature.
OTA update of a distributed device After a device is distributed to the destination instance, you can perform OTA updates on the device.
Table 2. Update packages
Feature Limits
Update packages Each Alibaba Cloud account can have up to 500 update packages.
The maximum size of an update package file is 2,000 MB. The file format can be .bin, .dav, .tar, .gz, .zip, .gzip, .apk, .tar.gz, .tar.xz, or .pack.
Table 3. Update batches
Feature Usage notes and limits
Version-based updates Limits:
  • Static update: You can use an update package to create one or more static update batches for different versions to be updated.
  • Dynamic update:
    • You can use an update package to create only one dynamic update batch. If you set the Upgrade range parameter to All Devices, you can specify multiple versions for the Version number to be upgraded parameter.
    • If you set the Upgrade range parameter to All Devices and specify the versions to be updated, up to 10 updates can be performed on a device in a dynamic update batch.
    • You can use multiple update packages to create multiple dynamic update batches for the same version. In this case, only the most recent dynamic update batch takes effect.
Usage notes:
  • If you set the The device supports simultaneous updates of multiple modules parameter to No when you initiate an update batch for a device, the device can have only one ongoing update task for one module at the same time. Otherwise, an update conflict occurs. In this case, the update task can be in the To Be Pushed, Pushed, or In Upgrade state.
  • If you set the The device supports simultaneous updates of multiple modules parameter to Yes in an update batch for a device, the device can have multiple ongoing update tasks for different modules at the same time. In this case, the update tasks can be in the To Be Pushed, Pushed, or In Upgrade state.
    Notice In this case, the device must use Link SDK V4.x for C.
Group-based updates Usage notes: If you delete a device group or remove a device from the group, the existing OTA task of the group is not affected.

For more information about how to create and use a device group, see Device groups.

Table 4. Concurrent updates on multiple modules
Feature Description
Supported regions Japan (Tokyo).
Supported instances Enterprise Edition instances.
Supported Link SDKs Link SDK V4.x for C.
Update policy configurations You can set the The device supports simultaneous updates of multiple modules or Override Previous Device Update Tasks parameter to Yes.
Limits
  • You can run up to five update tasks on different modules on a device at the same time.
  • You can perform concurrent updates on multiple modules or overwrite previous updates in different update batches on the same device of a product.

    For example, you cannot use one or more update packages to set the The device supports simultaneous updates of multiple modules parameter to Yes and the Override Previous Device Update Tasks parameter to Yes for different batch updates to update the same product. If you want to update your devices, do not perform the preceding operations.

Procedure

  1. Develop the OTA update feature: Configure the remote OTA update feature for a device.
  2. Add an update package: Add an OTA module and an update package to a product.
  3. Verify an update package (Optional): Verify the update package.
    Note
    • If you set the Verify Update Package? parameter to No when you add the update package, skip this step.
    • After the tested devices are updated and the status of the update package changes to Verified, you can perform a batch update.
  4. Initiate a batch update: IoT Platform sends OTA update information to the specified devices. The information includes the URL, version, and size of the update package.
    Note When you initiate a batch update, you can set the Whether IoT Platform Actively Pushes Update Task parameter to one of the following values:
    • Yes: IoT Platform pushes OTA update information to online devices.
    • No: IoT Platform does not push OTA update information to devices. A device must send a request to IoT Platform to obtain the OTA update information.

      For more information, see Step 4 that is described in the Message formats section of the Perform OTA updates topic.

  5. Perform OTA updates: Devices obtain the OTA update information, use the URL to download the update package, and then perform OTA updates.
    Note The URL of an update package remains valid for 24 hours. A device can download the update package within the specified period. If the update package is not downloaded within 24 hours, the device can request the update information from IoT Platform and download the update package. For more information, see the following scenarios.

    Scenarios:

    • A device immediately downloads the update package and performs an OTA update. For more information, see Step 5 that is described in the Message formats section of the "Perform OTA updates" topic.
    • A device does not immediately download the update package. The device requests the update information from IoT Platform during off-peak hours and then performs an OTA update. For more information, see Step 4 that is described in the Message formats section of the "Perform OTA updates" topic.
  6. View update status: View the update status of the devices and the information about the update package.
  7. View statistics on update package versions and success rates: View the statistical information about the versions and the success rate of the update tasks after the update is completed. You can also identify the causes of update failures to improve the success rate.

References