Sub-devices do not directly connect to IoT Platform. Instead, they connect to IoT Platform by connecting to gateways and by using the communication channel between the gateways and IoT Platform. After a sub-device connects to a gateway, you can implement an Over-the-Air (OTA) update on a sub-device by using the communication channel between the gateway and IoT Platform. To update a sub-device, you must use the topics of the sub-device and specify the ProductKey and DeviceName of the sub-device in the topics. This article describes how to implement an OTA update on a sub-device by using a gateway device.

OTA update process
  1. Create a gateway device and a sub-device and obtain the ProductKeys, DeviceNames, and DeviceSecrets.
    • When you create a product, set the Node Type parameter to Gateway device. Then, create a device in the product.
    • When you create a product, set the Node Type parameter to Gateway sub-device and select a gateway protocol. Then, create a sub-device in the product.

    For more information, see Create a product and Create a device.

  2. Specify the certificate information of the gateway device and connect the gateway device to IoT Platform. The certificate information includes the ProductKey, DeviceName, and DeviceSecret.
    For more information, see What is Link SDK?.
  3. Add a topological relationship between the gateway device and the sub-device.
    For more information, see Manage sub-devices.
  4. Connect the sub-device to IoT Platform by using the gateway device.
    You can connect a sub-device to IoT Platform by using one of the following methods:
    • Unique-certificate-per-sub-device verification: The gateway obtains the certificate of the sub-device and submits the certificate to IoT Platform. The certificate information includes the ProductKey, DeviceName, and DeviceSecret.
    • Dynamic registration: You must enable dynamic registration for the sub-device in the IoT Platform console. After the gateway obtains the ProductKey and DeviceName of a sub-device, the gateway dynamically registers the sub-device in IoT Platform for authentication. After the sub-device is verified, IoT Platform dynamically assigns a DeviceSecret to the sub-device. You can use the certificate to connect the sub-device to IoT Platform. The certificate information includes the ProductKey, DeviceName, and DeviceSecret.
  5. Configure the gateway device to perform the following operations for the sub-device: initiate a request for an OTA update, report the version of the OTA module to be updated, monitor messages that are pushed from IoT Platform, report the update progress, and pull the information about the update packages.
    Note
    • If you want to implement an OTA update on a sub-device by using a gateway device, you must use the topics of the sub-device.

      For more information about the topics that are used to transmit OTA update messages and the Alink JSON format, see OTA update.

    • When you add an OTA update package, you must specify the product of the sub-device as the product to which the package belongs.
    For more information, see Overview.