Sub-device development

更新时间:
复制 MD 格式

This topic describes how to develop sub-devices that connect to the IoT Platform using the IoT Platform SDK.

Glossary

  • Gateway device: Also known as a primary device. A gateway is a directly connected device that can attach sub-devices. It has a sub-device management module, maintains the topology of sub-devices, and can sync the topology to the cloud.
  • Sub-device: A device that cannot connect directly to the cloud. A sub-device must attach to a gateway to connect to the cloud indirectly. An example is a device that uses the Zigbee protocol for networking.
  • Device ID: A device handle that is used in the gateway SDK to identify a specific device.
  • Device certificate: The ProductKey, DeviceName, and DeviceSecret of a device. They are used to uniquely identify the device.
  • Topology: The association between a sub-device and a gateway. After a sub-device establishes a topology with a gateway, it can reuse the gateway's pchannel for data communication.
  • Dynamic registration of sub-devices: A sub-device is flashed with a ProductKey and ProductSecret instead of a unique device certificate. The sub-device's unique identifier, such as its serial number (SN), is used as the DeviceName. The gateway SDK then dynamically registers the sub-device with the cloud to obtain a DeviceSecret. This process creates a complete device certificate. The sub-device can then use this certificate for identity authentication with the cloud and be centrally managed.
  • TSL: Thing Specification Language. TSL is based on the JSON format and describes the features and capabilities of a device. For more information, see TSL model overview.

Sub-device product development

The following figure shows the development flow for a sub-device product.

Sub-device development flow

Create a product for the sub-device in the IoT Platform and set the parameters as follows.

  • Set Node Type to Device
  • Set Connect to Gateway to Yes
  • Select a Networking Method
Note You must also create a product for each sub-device in the IoT Platform and define the properties, events, and services that the product supports. The registration method for sub-device products is "Dynamic Registration". Each sub-device requires a valid and unique Alibaba Cloud IoT activation code. Currently, this activation code does not need to be flashed onto the sub-device. However, the sub-device manufacturer must request an activation code for each product. The sub-device manufacturer must specify the DeviceName for the sub-device's activation code and upload it to the IoT Platform. For the steps, see Mass-produce devices.