Sub-devices do not directly connect to IoT Platform. Instead, they connect to IoT Platform through gateway devices by using the communication channel between the gateway and IoT Platform.

Background information

When you develop a gateway device, you must implement the following capabilities in the gateway: manage its topological relationship with sub-devices, connect sub-devices to IoT Platform, and enable the communication between sub-devices and IoT Platform.

You can use the device SDKs provided by Alibaba Cloud to develop gateways. For more information, see Link Kit SDK.

If you develop your own SDK for gateway devices, you must encapsulate the Alink protocol data of the sub-devices in the gateway device. For more information, see the chapter: Alink protocol data related to sub-devices.

Procedure

You can use a gateway device to connect a sub-device to IoT Platform by using the following process.

  1. Connect the gateway device to IoT Platform.
  2. Connect the sub-device to the gateway device.

    A sub-device does not directly connect to IoT Platform. Therefore, you do not need to install a device SDK of IoT Platform on the sub-device. The sub-device supplier develops the sub-device.

    The gateway device supplier provides the following capabilities to the gateway device: the gateway device detects the sub-device and obtain the device certificate of the sub-device that is issued by IoT Platform, detects the sub-device going online and offline, and sends messages from IoT Platform to the sub-device. All these capabilities are achieved by the gateway device supplier or by using the protocol that is defined by the suppliers for the gateway device and sub-device.

  3. The gateway device checks whether the topological relationship with the sub-device is available.
    If the topological relationship already exists between the gateway and the sub-device, skip step 5.
  4. Optional step. The gateway device reports the ProductKey and DeviceName of the sub-device to IoT Platform to register the sub-device.

    This step is only applicable when the gateway device has not obtain the DeviceSecret of the sub-device and you have enabled dynamic registration for the sub-device in the IoT Platform console.

  5. Optional step. Add the topological relationship between the gateway and the sub-device.
    If no topological relationship exists between the gateway and the sub-device, create a topological relationship.
  6. The gateway device sends a connection request to IoT Platform on behalf of the sub-device.

For more information about sub-device management, see Link Kit SDK.

Example

For more information about how to connect a gateway device to IoT Platform, see Connect a sub-device to IoT Platform.