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.
- Create a gateway device and a sub-device and obtain the ProductKeys, DeviceNames,
- 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.
- 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 Link SDK documentation.
- Add a topological relationship between the gateway device and the sub-device.For more information, see Manage sub-devices.
- 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-device authentication. After the gateway retrieves a certificate of the sub-device, it sends the certificate to IoT Platform. The certificate includes the ProductKey, DeviceName, and DeviceSecret.
- Dynamic sub-device registration. You must enable dynamic sub-device registration in the IoT Platform console. After the gateway retrieves the ProductKey and DeviceName from a sub-device, the gateway registers the sub-device in IoT Platform to verify the identity of the sub-device. After the sub-device passes the authentication, a DeviceSecret is assigned to the device. Then, the sub-device uses its certificate to connect to IoT Platform. The certificate includes the ProductKey, DeviceName, and DeviceSecret.
- 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.
- 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.