Device connection overview

Updated at:

Link SDK is a device-side software development kit (SDK) provided by Alibaba Cloud IoT Platform. It simplifies the development process and allows devices to quickly connect to Alibaba Cloud IoT Platform. After device manufacturers obtain the SDK, they can select and port the required features to quickly integrate Link SDK and connect their devices.

Prerequisites

Before you start device-side development, you must complete the required operations in the IoT Platform console to obtain the information required for the development stage. This information includes device details and topic information. For more information, see Device connection guide.

Background information

IoT Platform supports the connection of a massive number of heterogeneous devices. Alibaba Cloud IoT Platform provides the device-side Link SDK and the standard Alink protocol.

  • To develop using the Alink protocol, see Develop on your own based on the Alink protocol.

  • We recommend that you use Link SDK to quickly develop and connect devices to IoT Platform. The following figure shows the development process for a device that uses Link SDK.

For an explanation of related terms, see Terms.

image

Integration methods

The method for integrating Link SDK varies depending on the device type:

  • IP devices: These devices, such as Wi-Fi devices, support the TCP/IP protocol stack. You can directly integrate Link SDK with them.WiFi Device

  • Non-IP devices: These devices, such as ZigBee, BT, KNX, and ModBus devices, do not support the TCP/IP protocol stack. They must connect to Alibaba Cloud IoT Platform through a gateway device that has Link SDK integrated. Sub-devices establish a connection through this gateway proxy. The communication method between the sub-device and the gateway is user-defined. For more information about connecting sub-devices using C Link SDK, see Overview.GW Device

Select a Link SDK

Link SDK is available in multiple languages, including C, Java, Python, Node.js, Android, and iOS. You can select the SDK in the language that suits your product.

SDK type

Scenario

Configuration link

Example

C Link SDK

Suitable for resource-constrained devices in an embedded C environment.

Get C Link SDK

MQTT connection

C Link SDK Extended

Suitable for resource-rich devices in a general C environment.

Get SDK

Authentication and connection

Android Link SDK

Suitable for Android devices.

Environment requirements and configuration

Authentication and connection

Python Link SDK

Suitable for devices developed in Python. Not applicable for Python lightweight application development.

Environment requirements and configuration

Authentication and connection

Java Link SDK

Suitable for devices developed in Java.

Environment requirements and configuration

Authentication and connection

Node.js Link SDK

Suitable for devices developed in Node.js.

Environment requirements and configuration

Authentication and connection

iOS Link SDK

Suitable for iOS devices.

Environment requirements and configuration

Authentication and connection

C SDK version

Features

Notes

References

C Link SDK Extended

  • Simpler API encapsulation.

  • More features.

  • Performance optimization.

  • Long-term iterative updates.

  • Recommended for resource-rich devices, such as PCs and gateways.

  • Device runtime memory (RAM) is greater than 1 MB.

C Link SDK 4.x

  • Lower resource consumption.

  • Fine-grained clipping capability.

  • Easy to port to different systems, including RTOS.

  • Provides an online clipping tool.

  • Long-term iterative updates.

  • Recommended for resource-constrained devices, such as microcontrollers and modules.

  • Device runtime memory (RAM) is less than 1 MB.

C Link SDK 3.x

Provides a code extraction tool for easier feature clipping.

No longer updated. Not recommended for new users.

C Link SDK 1.x/2.x

Initial version.

Not recommended.

None.

Note

Adapt and port Link SDK

Important
  • Porting is required only when you use C Link SDK for embedded devices. Other Link SDKs do not require porting and can be directly integrated.

  • C Link SDK supports visual custom clipping. Before you port the SDK, you must clip and download it based on your device requirements.

  • C Link SDK is written in the C99 standard. Its system interface implementation varies by environment and must be ported. For porting instructions, see Porting example.

  • The default implementation of the C Link SDK system interface is POSIX(Linux). Therefore, Linux devices can use it directly without porting.

Hardware environment

Operating system

Description

References

PC/SoC

Linux

If it is an embedded device, configure cross compilation.

Integrate the SDK in a Linux development environment

Windows

No reference implementation is provided. You need to port it yourself.

Porting example

MCU + communication module

RTOS

The MCU and the communication module use AT commands to connect the device to the network.

Connect using the AT+TCP/TLS driver framework

noneOS

The MCU connects through bare machine development.

Connect a device with no operating system

Module OpenCPU

RTOS

Integrate Link SDK based on the ESP-IDF framework.

Port to an Espressif ESP32 development board

Device development: Connection and messaging

To meet different device connection requirements, IoT Platform supports multiple protocols and authentication methods. The following sections describe several solutions for connecting devices to IoT Platform.

Feature

Description

References

Multi-protocol connection

Supports connection over protocols such as MQTT, CoAP, and HTTP. Most devices use the MQTT protocol.

Connect on your own using protocols

Unique-certificate-per-device

Each device uses a unique key for authentication.

Unique-certificate-per-device

Unique-certificate-per-product

Each product model uses a shared key, which simplifies the device provisioning process.

Note

Unique-certificate-per-product and unique-certificate-per-device authentication can be used together. When a device connects to IoT Platform for the first time, it can use unique-certificate-per-product authentication (dynamic registration) to obtain a unique key. Subsequent connections can then use unique-certificate-per-device authentication.

Unique-certificate-per-product

X.509 certificate-based authentication

Each device has an independent certificate. Device authentication can be completed during the TLS phase, which provides higher security.

Use X.509 certificate-based authentication

Gateway and sub-devices

A gateway acts as a proxy for sub-devices to connect to IoT Platform. After a sub-device is connected, it can use its own topic to communicate with the cloud platform.

Create a gateway and a sub-device

Feature

C Link SDK Extended

C (v4.x)

C (v3.x)

Android

Java

Python

Node.js

Device connection and messaging

Unique-certificate-per-device authentication

Authentication and connection

Device authentication

Authentication and connection

Authentication and connection

Authentication and connection

Authentication and connection

Unique-certificate-per-product authentication

Unique-certificate-per-product

Use MQTT for dynamic registration

Device authentication

Device authentication

Device authentication

Device authentication

Device authentication

X.509 certificate-based authentication

Authentication and connection

X.509 certificate

X.509 certificate

Not supported

Message communication

Authentication and connection

Communication based on MQTT topics

Communication based on MQTT topics

Gateway and sub-devices

Sub-device authentication and connection

Gateway and sub-devices

Sub-device management

Gateway and sub-devices

Gateway and sub-devices

Gateway and sub-devices

Not supported

Device development: Business features

After a device is connected to IoT Platform, it can send and receive messages through the platform. Devices can report business data to IoT Platform in the following ways:

  • Custom: You can define the topic and payload for custom messages. For more information, see Use custom topics for communication.

  • Thing Specification Language (TSL) model: You can define device properties, events, and services based on a TSL model. You can also report and receive data in the TSL model format. For more information, see What is a TSL model? and Use a TSL model for device communication. The TSL model is a core feature of IoT Platform. The advantages of using a TSL model are as follows:

    • Structured data storage: This simplifies subsequent data development processes.

    • State caching (device shadow): The device or server-side can query the device status or data at any time.

    • Data visualization: You can view data on the IoT Platform page.

    • Online debugging: You can debug devices online.

Feature

C Link SDK Extended

C (v4.x)

C (v3.x)

Android

Java

Python

Node.js

iOS

Device management

TSL model

TSL model development

Instructions

TSL model programming

TSL model development

TSL model development

TSL model communication

TSL model development

Not supported

Device tag

Device tag

Device tag

Tag

Device tag

Device tag

Device tag

Device tag

Not supported

File management

Not supported

File upload

File upload

File upload

Not supported

Device distribution

Device distribution

Device distribution

Device distribution

Not supported

Device shadow

Device shadow

Device shadow

Device shadow

Device shadow

Device shadow

Device shadow

Device shadow

Not supported

Device task

Not supported

Device task

Not supported

Device development: O&M features

After you finish developing business features and before you start mass production, you should add O&M features. This helps with future device iterations, configurations, and troubleshooting. IoT Platform provides the following main O&M capabilities:

Feature

Description

References

OTA

Device upgrade. Provides the ability to remotely upgrade device firmware.

OTA update overview

Remote logon

Based on a secure tunnel, it provides the ability to remotely log on to a device from the console using the Secure Shell (SSH) protocol.

Remote logon

Log reporting

Devices report operational logs to IoT Platform. You can use these logs to troubleshoot device issues.

Device log reporting

Remote Configuration

Remotely configure devices.

Remote Configuration

NTP service

Provides the ability for device time synchronization.

NTP service

Feature

C Link SDK Extended

C (v4.x)

C (v3.x)

Android

Java

Python

Node.js

Monitoring and O&M

OTA

Device OTA development

OTA update

Device OTA development

Device OTA update

Not supported

Device OTA update

Not supported

Remote logon

Remote logon

Remote logon

Not supported

Log reporting

Log reporting

Log reporting

Not supported

Authentication and connection

Not supported

Remote Configuration

Remote Configuration

Remote Configuration

Remote Configuration

Remote Configuration

Remote Configuration

Not supported

NTP service

NTP service

NTP service

NTP service

Not supported