Devices can directly connect to IoT Platform. Devices can also connect to IoT Platform by attaching to a gateway as sub-devices.

Scenarios

Gateways are required if devices cannot directly connect to IoT Platform or you need to manage topological relationships. Gateways include Wi-Fi gateways, Bluetooth gateways, and ZigBee gateways.

Benefits

IoT Platform allows you to maintain and monitor the sub-devices of a gateway. IoT Platform also allows you to manage the topological relationships between the sub-devices and the gateway. Your business system can communicate with sub-devices without considering topological relationships.

Gateways and devices

When you create a product in IoT Platform, you must specify the Node Type parameter. Valid values:

  • Directly Connected Device: Devices can directly connect to IoT Platform but cannot be attached to sub-devices.
  • Gateway sub-device: Devices can connect to IoT Platform only by attaching to a gateway as sub-devices.
  • Gateway device: Devices can directly connect to IoT Platform and be attached to sub-devices. A gateway can manage sub-devices, maintain the topological relationships with the sub-devices, and synchronize the topology information to IoT Platform.

The following figure shows the topological relationships between a gateway and its sub-devices.

Gateways and sub-devices

Connect sub-devices to IoT Platform

After a gateway is connected to IoT Platform, the gateway synchronizes the topology information to IoT Platform. The gateway represents its sub-devices to complete the authentication, send upstream messages, and receive downstream commands.

  • The method of connecting a gateway to IoT Platform is the same as that of connecting a common device to IoT Platform. For more information, see the Link SDK documentation.
  • You can connect a sub-device to IoT Platform by using one of the following methods:
    • Unique-certificate-per-device authentication: 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 passes the authentication, IoT Platform issues a DeviceSecret to the sub-device. Then, the sub-device uses the certificate to connect with IoT Platform. The certificate information includes the ProductKey, DeviceName, and DeviceSecret.