This article helps you understand the basic capabilities of IoT Platform. The following capabilities are provided: connect devices with IoT Platform, send messages from devices to IoT Platform, subscribe to device messages from IoT Platform, and send commands from IoT Platform to devices.
This article describes how to connect a device with IoT Platform and use the capabilities that are provided by IoT Platform. A street lamp is used in this example.
Before you begin
Before you connect a device to IoT Platform, you must perform the following operations:
- Activate IoT Platform.
- Prepare a development environment for the C programming language. In this article, the device is developed on the Linux operating system by using Link SDK for C.
- Prepare the Java development environment. In this article, the online debugging feature
of IoT Platform is used to send downstream commands. AMQP SDK for Java is used to
receive device messages.
Message communication process
- Submit device data to IoT Platform.
- Create a product and a device: Register your device in IoT Platform and obtain a device certificate (including ProductKey, DeviceName, and DeviceSecret). Burn the device certificate to the device. When the device connects to IoT Platform, the certificate is used for authentication.
- Define a TSL model for a product: Define product features, including properties, services, and events. IoT Platform generates a Thing Specification Language (TSL) model based on the defined product features. The TSL model is used for the communication between the device and IoT Platform.
- Establish a connection between a device and IoT Platform: Develop the device SDK and pass in the device certificate to connect the device with IoT Platform.
- Subscribe to device messages from IoT Platform: Configure a server-side subscription to receive device messages. The message types include online or offline notifications, device lifecycle changes, and upstream device messages.
- Send commands from IoT Platform to devices: Use the online debugging feature of IoT Platform to send commands to the device.