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 |
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.
Development in IoT Platform
Device type | Procedure |
|
|
Cloud gateways |
|
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 |
| IoT Platform provides Link SDKs that support the following programming languages: C, Android, Python, Java, iOS. | |
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 | 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.