All Products
Search
Document Center

IoT Platform:Overview of device connection

Last Updated:Nov 16, 2023

IoT provides device management features to allow you to implement IoT solutions that involve large numbers of devices. This topic describes the procedure for connecting devices to IoT Platform.

Prerequisites

IoT Platform is activated.

Preparation

Before you connect a device to IoT Platform, perform the following operations:

Operation

Description

Development in IoT Platform

In the IoT Platform console, you can perform the following operations in sequence to configure the device: create a product, add Thing Specification Language (TSL) features, add custom topics, create a device, configure business features for the device (such as tags, shadows, and over-the-air or OTA updates), define the verification method, develop product features, and register the device.

Device-side development

Obtain the device certificate and connect the device to IoT Platform by using SDKs, such as Link SDKs, AT modules, IoT as Bridge SDK, and self-developed SDKs that use open protocols.

The protocols, SDKs, and procedures for connecting devices vary based on the device type. The following table describes the protocols for connecting different types of devices. For information about the corresponding SDKs and procedures, see the Procedure section of this topic.

Device type

Supported protocol

Directly connected devices

Message Queuing Telemetry Transport (MQTT), CoAP, or HTTPS

Directly connected gateways and gateway sub-devices that are not directly connected

MQTT

China Mobile and China Unicom NB-IoT devices

MQTT or CoAP

Devices that cannot be connected to IoT Platform over a protocol supported by IoT Platform

Proprietary protocols supported by IoT as Bridge SDK

Cloud gateways

MQTT, JT/T 808, GB/T 32960, or China Telecom NB-IoT

Note

Comparison between gateways and cloud gateways:

  • Gateways: devices that are directly connected to IoT Platform over MQTT and can have sub-devices. Gateways are verified based on DeviceSecrets before the gateways can connect to IoT Platform.

  • Cloud gateways: devices that are connected to IoT Platform over the MQTT, JT/T 808, GB/T 32960, or China Telecom NB-IoT protocol.

    • Cloud gateways that are connected to IoT Platform over MQTT, JT/T 808, or GB/T 32960 are verified based on custom certificates before the cloud gateways can connect to IoT Platform.

      • MQTT gateways allow you to connect your existing devices to IoT Platform without the need to modify the devices.

      • JT/T 808 gateways are suitable for establishing communication between GPS devices on vehicles and IoT Platform.

      • GB/T 32960 gateways are suitable for establishing communication between devices on electric vehicles and IoT Platform.

    • China Telecom NB-IoT gateways are directly connected to the application enablement platform (AEP) of China Telecom.

Procedure

The following figure shows the procedure for connecting a device to IoT Platform. The procedure consists of two parts: development in IoT Platform and device-side development.

image

Development in IoT Platform

Device type

Procedure

  • Directly connected devices

  • Gateways

  • Sub-devices that are not directly connected

  • China Mobile and China Unicom NB-IoT devices

  • Devices that use proprietary protocols

  1. Purchase an Enterprise Edition instance: The public IoT Platform instance provides limited resources and device connection and communication features.

    We recommend that you purchase Enterprise Edition instances for commercial use. For information about the instance types and features of Enterprise Edition instances, see Types of Enterprise Edition instances.

  2. Create a product: Configure the Node Type and Authentication Mode parameters of the product that you want to create. The Node Type parameter specifies the devices that belong to the product, and the Authentication Mode parameter specifies how to verify the device that attempts to connect to IoT Platform.

    For information about the authentication modes, see Overview of device verification.

  3. (Optional) Configure product features: Configure product features based on your business requirements.

    • Define TSL features: If the device uses TSL topics to communicate with IoT Platform, you must define TSL features for the product to which the device belongs.

    • Define topics for communication: If the device uses custom topics to communicate with IoT Platform, you must define custom topics for the product to which the device belongs.

      For information about the procedure, see Use custom topics for communication.

    • Configure a message parsing script: IoT Platform defines the Alink JSON format as the standard message format. If the device transfers raw data to IoT Platform, you must configure a message parsing script that converts data from the custom format of the device to the Alink JSON format.

  4. Register the device: Add the device to the product in the IoT Platform console.

    For more information, see Create a device, Create multiple devices at a time, and Manage sub-devices.

    Note

    If the device uses the unique-certificate-per-product verification method, you do not need to register the device in the IoT Platform console.

  5. (Optional) Configure business features: If your device uses features such as tags, shadows, remote configuration, and OTA updates, you must configure the features in the IoT Platform console and develop the features on the device.

    Note

    Devices that are connected to IoT Platform by using IoT as Bridge SDK over proprietary protocols can be updated only by using the OTA method.

Cloud gateways

  1. Purchase an Exclusive instance: Only Enterprise Edition instances of the Exclusive type support gateways. For information about how to purchase an instance, see Purchase Enterprise Edition instances.

  2. Select the connection method based on the protocol of the device:

    • If the device uses China Telecom NB-IoT, you can directly connect the device to the AEP of China Telecom.

    • If the device uses MQTT, you can use features such as custom certificates, custom device verification methods, and custom topics to connect the device to IoT Platform without the need to modify the device.

    • If the device uses JT/T 808, you can connect the device to IoT Platform over TLS. This way, you can enable features such as server-side one-way verification, Online Certificate Status Protocol (OCSP), and two-way secure connections between devices and servers. The JT/T 808 protocol is suitable for establishing communication between GPS devices on vehicles and IoT Platform.

    • If the device uses GB/T 32960, we recommend that you connect the device to IoT Platform over TLS. This way, you can enable features such as server-side one-way verification, OCSP, and two-way secure connections between devices and servers. The GB/T 32960 protocol is suitable for establishing communication between devices on electric vehicles and IoT Platform.

  3. Connect the device based on the following topics:

Note

You can also call IoT Platform API operations to implement features such as product management, device management, topic management, server-side subscription, data forwarding, and messaging.

For more information, see List of operations by function and IoT Platform SDK reference.

Device-side development

Device type

Connection method

Description

  • Directly connected devices

  • Gateways

  • Sub-devices that are not directly connected

  • China Mobile and China Unicom NB-IoT devices

Device connection by using Link SDK

IoT Platform provides Link SDKs that support the following programming languages: C, Android, Python, Java, iOS.

Open protocols

If the available device SDK does not meet your business requirements, you can develop a custom SDK. For example, you can use an open source MQTT client to access IoT Platform.

For information about how to connect a Paho MQTT client to IoT Platform by using different programming languages, see the following examples: Android, Java, C (for embedded applications), C, C#, Python, Rust, and Go.

You can develop features on the device based on the Alink protocol. This way, your device can work with IoT Platform.

AT modules

You can use AT modules that support MQTT and HTTPS commands or general-purpose TCP-based AT modules to connect the device to IoT Platform.

For more information, see Integrate a Link SDK into an MQTT-based module and Integrate a Link SDK into a TCP-based WAN module.

Devices that use proprietary protocols

IoT as Bridge SDK

You can use IoT as Bridge SDK to transfer data from IoT platforms of other cloud service providers to Alibaba Cloud IoT Platform.

Cloud gateways

MQTT

You can configure a custom certificate for device verification. This way, you can connect your existing device to IoT Platform without the need to modify the device.

For examples on how to connect MQTT gateways in C and Java, see C and Java.

JT/T 808

You can configure a custom certificate for device verification to connect GPS devices on vehicles to IoT Platform.

For examples on how to connect JT/T 808 gateways in C, see C

GB/T 32960

You can configure a custom certificate for device authentication to connect devices on electric vehicles to IoT Platform.

For examples on how to connect GB/T 32960 gateways to IoT Platform by using an open source GitHub project, see Connect a device to IoT Platform by using the one-party verification method.

What to do next

After you connect your device to IoT Platform, you can manage the data of the device by using features such as message forwarding and O&M features.

  • Message forwarding: You can use features such as server-side subscription and data forwarding to forward device messages. This way, you can establish communication between devices and services, and forward and store device data.

  • Monitoring and O&M: You can monitor and manage the metrics of the device by using features such as real-time monitoring, log service, and online debugging.

For more information, see Features.