Updated on 2024-01-17 GMT+08:00

Gateways and Child Devices

Overview

Devices can be directly or indirectly connected to the IoT platform. Indirectly connected devices access the platform through gateways.

Devices that do not support TCP/IP cannot directly communicate with the platform, and need to use gateways as media.

Service Flow

You can use the APIs provided by the IoT Device SDK to connect gateways and child devices to the platform. API names of the SDK vary depending on the language. For details, see IoT Device SDK (Java), IoT Device SDK (C), IoT Device SDK (C#), IoT Device SDK (Android), and IoT Device SDK Tiny (C).

  1. A user uploads the product model of a gateway to the platform and registers the gateway.
  2. The gateway calls the Authentication API to go online.
  3. The user uploads the product model of a child device to the platform.
  4. After the gateway authentication is successful, an application calls the API Creating a Device. (The device information entered in the API request must be consistent with that defined in the product model). After the child device is added, you can view it on the console. For details, see Viewing a Child Device. You can also add child devices on the console. For details, see Adding a Child Device on the Platform.
  5. The status of the newly added child device is still displayed as Inactive on the console. This is because the gateway has not reported the latest status of the child device to the platform. Call the API Gateway Updating Child Device Status after the child device is added or before the child device reports data.

    The status of a child device indicates whether the child device is connected to the gateway, and the gateway reports the status to the platform for status updates. If the gateway cannot report the status of a child device, the child device status is not updated on the platform. For example, after a child device connects to the platform through a gateway, the child device status is displayed as online. If the gateway is disconnected from the platform, the gateway can no longer report the child device status and the platform will consider the child device online.

  6. The gateway calls the API Gateway Reporting Device Properties in Batches to report the data of the child device. The parameters in the API request are the information about the gateway and the child device.
  7. The gateway subscribes to a topic for command delivery and receives and processes commands delivered by the application or platform.
  8. The application calls the API Deleting a Device to command the gateway to delete the child device. The gateway deletes the device upon receiving the command.

Connecting a Gateway to the Platform

Connect a gateway to the platform by integrating the gateway with the SDK. For details, see Indirectly Connecting to the Platform.

Adding a Child Device on the Platform

Method 1

After the gateway is connected to the platform, call the API Creating a Device to connect the child device to the platform.

Method 2

Access the IoTDA service page and click Access Console. On the console, choose Devices > All Devices. In the device list, click View in the row of a gateway to access its details. In the Child Devices tab page, click Add Child Device.

Viewing a Child Device

  1. Access the IoTDA service page and click Access Console.
  2. In the navigation pane, choose Devices > All Devices. In the device list, click View in the row of a gateway to access its details.
  3. On the Child Devices tab page, view the status, device ID, and node ID of the child devices connected to the platform through the gateway.
  4. Click View in the row of a child device to view its details.