Platform Overview

Understanding the Platform

IoT Device Access (IoTDA) is a basic service of the HUAWEI CLOUD IoT platform. IoTDA provides functions such as device fleet access, bidirectional communications between devices and the cloud, batch device management, remote control and monitoring, Over-the-Air (OTA) upgrades, and device linkage rules. It can flexibly transfer device data to other HUAWEI CLOUD services. Using IoTDA, you can quickly connect devices to the platform and integrate your applications. IoTDA integrates the functions of the original IoT Device Access and IoT Device Management services.

In short, IoTDA connects devices and applications to the platform for data interaction. You can manage applications and devices on the IoTDA console.

Documentation

What's New: Learn about the new features and updates of the HUAWEI CLOUD IoT platform.

Service Overview: Understand the platform, product advantages, pricing details, and terms.

Getting Started: Understand the capabilities of the platform, how to use the platform, and how to learn and develop applications with the documentation. If you are a developer, you will understand how to call APIs to quickly connect your applications or devices to the platform.

Developer Guide: Download the SDKs, certificates, and development guides required for development on the application or device side. You can learn how to develop product models and how to develop codecs to enable interaction between devices that use binary code streams and the platform.

User Guide: Understand the functions and usage of the IoTDA console, and learn how to manage products and devices, subscribe to notifications, and configure rules. In addition, you will understand what is a product model and what are the differences between message and property reporting and the differences between command, property, and message delivery.

Best Practices: Learn about typical application scenarios of the platform.

API Reference: Learn about application and device APIs provided by the platform and how to call these APIs to manage your applications and devices.

FAQs: Seek solutions to common problems that may occur when you connect devices or applications to the platform.

Role Guides

  • If you are a beginner of the IoT platform, read Service Overview to learn the platform architecture and capabilities, read User Guide to understand how to subscribe to the IoTDA service, and then read Best Practices and consider what value the service can create for you and your users.
  • If you are a developer and have a basic understanding of the platform, subscribe to IoTDA and connect applications and devices to the platform, download and integrate required SDKs and certificates by following the instructions in Developer Guide, and then explore more access modes and service scenarios by referring to Rules, Best Practices, and API Reference.
  • If you are a module manufacturer and have a basic understanding of the platform, read Product Development in Developer Guide to understand how to develop and debug codecs, read IoT Device SDK to know how to connect modules to the platform by integrating SDKs, and read Best Practices to understand how to use the compilation tools provided by the platform for integration development and code hardcoding with development boards.
  • If you are an experienced user and are familiar with the platform, learn how to use different product models (messages/properties/commands/shadows/events) for different access purposes through message communications, understand the platform advantages (for example, topic customization, device shadows, software/firmware upgrades, storage management, and monitoring and O&M), and consider whether you need to purchase dedicated instances to improve throughput.
  • If you have already connected devices to the platform before we merge the IoT Device Access and IoT Device Management functions, read the evolution guide and differences between old and new SDKs and consider whether to switch to the new platform and APIs for better experience.

Concepts

The platform provides a console for application and device access.

Console: Before you get to know "console", you need to understand what is a "tenant". After you register an account in HUAWEI CLOUD and subscribe to the IoTDA service, you become a customer and can use the IoT platform as a tenant. The console is an operation platform provided by IoTDA for tenants. On the IoTDA console, you can view and manage your products and devices, develop product models and codecs, configure data forwarding rules, and perform O&M and monitoring. Most functions provided by the console (such as product management and device registration and management) have been encapsulated into application APIs. You can call these APIs during application development. For details, see Developing Products on the Console.

Device side: Devices are objects that can be powered on and connected to networks, such as smartphones, smart street lamps integrated with an NB-IoT chip, water meters integrated with a module, and refrigerators that can connect to Wi-Fi. If you are a device manufacturer module manufacturer, you can connect devices to the platform using device-side APIs provided by the platform. Device instructions and data can be transmitted over the IoT network. For details, see Development on the Device Side.

Application side: In a narrow sense, the application side refers to web application servers. You can connect your web application servers to the platform and use application-side APIs provided by the platform to manage the servers. In a broad sense, the application side includes objects that can interact with the platform through HTTP/HTTPS. For example, smartphones can be considered as both applications and devices. The application side works with the device side to exchange commands and data with the platform in different scenarios. For example, smart water meters report data to the platform through device-side APIs, and the platform then pushes the data to the application side. This reduces the workload of manual meter reading. For details, see Development on the Application Side.

On the application side, the platform supports access over HTTP(S) and AMQP.

On the device side, the platform supports access over LwM2M, CoAP, MQTT(S), HTTP2, LoRa, and Modbus. It also supports SDK-based access over generic protocols (TCP/UDP).

Message communications are designed based on the product model. Devices can report properties and messages to the platform, and the platform can deliver commands, messages, and properties to the devices. Properties, commands, and events are defined in the product model, whereas messages are not defined in the product model.

Table 1 Bidirectional communications

Data Type

Message Type

Differences

Similarities

Upstream data

Property reporting

Dependent on the product model. The properties reported must match those defined in the product model. You can view the latest device shadow on the device details page of the IoTDA console, push the data to the subscribed-to applications, and view historical data through IoT Analytics.

Both properties and messages can be reported to the platform by calling device-side APIs, and forwarded to other HUAWEI CLOUD services using rules.

Message reporting

Independent from the product model. The platform does not verify the message content. The latest reported device shadow data cannot be viewed on the device details page of the IoTDA console. Historical data cannot be viewed through IoT Analytics.

Downstream data

Command delivery

Dependent on the product model. The commands delivered must match those defined in the product model. The command delivery is synchronous. (After a command is delivered, the platform waits for a response from the device. If no response is returned, the command delivery times out.) Commands can be delivered on the IoTDA console.

Commands, properties, and messages can be delivered by calling application-side APIs.

Property delivery (for modification purposes)

Dependent on the product model. The properties delivered must match those defined in the product model. Property delivery is synchronous. (After a property is delivered, the platform waits for a response from the device. If no response is returned, the modification times out.) The platform supports property configuration (device shadow) on the IoTDA console. Device properties can be modified through the device shadow to implement asynchronous mode.

Message delivery

Independent from the product model. The platform delivers messages to the device. Message delivery is asynchronous. (After a message is delivered, the platform does not need to wait for a response from the device.) Messages cannot be delivered from the IoTDA console.

Now, you must have had a basic understanding of the IoT platform. You may wonder how the platform can create value for you, in which business scenarios the platform can be used, and how you can access the platform. The following sample business scenarios are used to describe the service process and product model as well as the platform functions and benefits.

Example Business Scenarios

  1. Smart Street Lamp

    The street lamp management system connects to the platform to monitor street lamps that are integrated with the NB-IoT module and turn on/off these street lamps.

    Process description:

    • Creating a product for street lamps: The platform manages devices by product. You can create products by calling a specific API or using the IoTDA console.
    • Uploading a product model and codec: A product model defines the basic properties and commands for a specific type of devices. You can develop product models on the console, upload local product models to the console, or import preset models from the common product library.

      Because NB-IoT devices communicate with the platform over LwM2M and the platform uses JSON data, a codec is required to convert the data format so that the platform and devices can communicate with each other. You can develop a codec on the console or upload a local codec to the console.

    • Registering street lamps: You can register multiple devices using a specific application API or the IoTDA console. The device ID generated upon registration is the unique identifier of a device for communicating with the platform.
    • Creating a subscription to receive notifications about street lamp status changes: You can create a subscription for the street lamp management system to receive notifications about street lamp status changes from the platform. When creating a subscription, specify the callback URL for receiving notifications.
    • Reporting street lamp brightness: The NB-IoT module on devices has been integrated with Huawei IoT Tiny SDK and can transmit street lamp brightness messages to the platform in binary code streams. The platform uses the codec to decode binary code streams into JSON data that the platform can understand.
    • Pushing a notification about street lamp brightness changes: The platform pushes the subscribed-to notifications to the specified callback URL through HTTP/HTTPS.
    • Delivering a command for turning off street lamps: The street lamp management system can deliver a command for turning off street lamps to a specific device or multiple devices. NB-IoT devices require low power consumption and have non-persistent connections. Therefore, and NB-IoT device commands are often cached and then delivered asynchronously.
    • Delivering a command for turning off street lamps: The platform invokes the codec to encode the command into binary code streams and then sends the streams to specific devices.
    • Querying the command execution result: The street lamp management system uses an application API provided by the platform to query the execution result of a specific command. V5 API commands of the platform are delivered synchronously, and you cannot and do not need to query the execution results of these commands. You can query the execution results of only V3 API commands because they are delivered asynchronously.

    For details about this scenario, see Developing a Smart Street Lamp Using BearPi.

    In this scenario, devices interact with the platform using LwM2M. The application side can subscribe to device change notifications on the platform and deliver commands to devices.

    Key points: product model, codec, subscription and push, property reporting, and command delivery

  2. Vending Machine

    The platform enables you to collect sales data from a sales management system and analyze the sales data using EI services.

    Process description:

    • Creating a product for vending machines: The platform manages devices by product. You can create products by calling an application API or using the IoTDA console.

    • Uploading a product model: A product model defines the basic properties and commands for a specific type of devices. You can develop product models on the console, upload local product models to the console, or import preset models from the common product library. In this scenario, devices are developed in the Android OS and can interact with the platform using MQTT. Therefore, no codec is required.

    • Registering vending machines: You can register multiple devices using a specific application API or the IoTDA console. The device ID generated upon registration is the unique identifier of a device for communicating with the platform.

    • Creating a subscription to receive notifications about vending machine status changes: You can create a subscription for the sales management system to receive notifications about vending machine status changes from the platform. When creating a subscription, specify the callback URL for receiving notifications.

    • Establishing connections: MQTT devices are connected to the platform through native MQTT or by integrating Huawei IoT Device SDKs. The platform can identify any JSON data transmitted from these devices without using a codec. If these devices transmit binary code streams to the platform, you need to develop a codec for the platform to decode the streams into JSON data. MQTT uses persistent connections, which must be established before data transfer. You can connect MQTT devices to the platform over port 8883 (recommended) or port 1883.

    • Pushing a notification about vending machine activation: The platform pushes the subscribed-to notifications to the specified callback URL through HTTP/HTTPS.

    • Creating data forwarding rules: You can create rules using an API or the console for the sales management system to forward data to specific streams.

    • Subscribing to Data Ingestion Service (DIS) and MapReduce Service (MRS): HUAWEI CLOUD provides a wide range of SaaS and PaaS services, which you can combine to meet business requirements. DIS provides efficient collection, transmission, and distribution capabilities and supports multiple IoT protocols. After subscribing to this service, you can use rules created on the platform to forward the sales data of vending machines to DIS, and use MRS to analyze the sales data.

    • Reporting vending machine properties: Devices can connect to the platform by integrating the SDK or through the native MQTT protocol to report sales data. In this scenario, devices report data in the form of properties, and the content and format of properties must be consistent with those defined in the product model. For details, see Table 1.

    • Rule-based data forwarding: After receiving properties or messages reported by devices, the platform filters the properties and messages based on rules, and forwards filtered properties to specific DIS streams. MRS then consumes the sales data in DIS for analysis.

    In this scenario, devices interact with the platform using MQTT, and the application side can subscribe to device change notifications on the platform. You can create data forwarding rules using the console or application APIs to forward device properties to other HUAWEI CLOUD services.

    Key points: product model, codec, subscription and push, property reporting, MQTT, and data forwarding rules

  3. Smart Gateway

    Using gateways, you can manage existing devices under the gateways without migration and add new devices to the gateways.

    Process description:

    • Creating a product for gateways: The platform manages gateways by product. You can create and manage products by calling a specific API or using the IoTDA console.
    • Customizing topics: You can customize topics on the product details page so that all devices under the product can use the customized topics to exchange data with the platform.
    • Registering gateways: You can register a gateway using a specific application API or the IoTDA console. The device ID generated upon registration is the unique identifier of a gateway for communicating with the platform. In this scenario, a gateway application is used to call application APIs to register gateways. You can also use a web server instead.
    • Creating data forwarding rules: You can create rules using an API or the console for the gateway application to forward data to specific streams.
    • Subscribing to DIS and Object Storage Service (OBS): HUAWEI CLOUD provides a wide range of SaaS and PaaS services, which you can combine to meet business requirements. DIS offers key capabilities to collect, transmit, and distribute real-time data ingested from IoT and Internet. It supports multiple IoT protocols. OBS provides secure, reliable, and cost-effective storage of massive data. You can subscribe to either of these services or both of them and use IoTDA rules to forward gateway data to the services.
    • Establishing connections: MQTT devices (gateways) are connected to the platform through native MQTT or by integrating Huawei IoT Device SDKs. The platform can identify any JSON data transmitted from these gateways without using a codec. If these gateways transmit binary code streams to the platform, you need to develop a codec for the platform to decode the streams into JSON data. MQTT uses persistent connections, which must be established before data transfer. You can connect gateways to the platform over port 8883 (recommended) or port 1883.
    • Subscribing to a message delivery topic: After connecting MQTT devices (gateways) to the platform, you can subscribe to a downstream topic of the platform to receive messages related to the gateways.
    • Reporting messages: Gateways transparently transmit data to the platform, and the platform then directly forwards the data to storage channels, such as DIS and OBS, based on rules. The main difference between messages and properties is that messages are independent from product models. The platform does not process reported messages (no storage or device shadow) but only forwards messages.
    • Forward data based on rules: The platform filters properties and messages based on rules and forwards properties and messages to specific DIS streams for queuing or to OBS for storage.
    • Consuming message data: The platform only transparently transmits messages, and no callback URL can be configured for the gateway application for receiving notifications. In this scenario, the platform dumps device data to DIS or OBS, and the gateway application then calls DIS and OBS APIs or integrates with SDKs to consume device data.
    • Delivering messages: The gateway application delivers messages using application APIs to the platform in asynchronous mode.
    • Delivering messages: The platform uses the downstream topic to transparently forward messages to gateways. Ensure that the gateways have subscribed to the message delivery topic. Otherwise, the gateways cannot receive messages from the platform.

    For details about this scenario, see Communicating Using a Custom Topic.

    In this scenario, devices (gateways) interact with the platform using the MQTT protocol. You can create topics on the product details page of the console and create data forwarding rules using application APIs or the console to forward device messages to other HUAWEI CLOUD services for consumption.

    Key points: product model, message reporting, message delivery, MQTT, data forwarding rules, and topic customization

  4. Smart Home Gas Detection

    If a gas detector detects excessive gas, the wireless window opener associated with the gas detector automatically opens the window for ventilation.

    Process description:

    • Creating a product for gas detectors: The platform manages devices by product. You can create and manage products by calling a specific API or using the IoTDA console.
    • Uploading a product model and codec: NB-IoT devices use LwM2M to transmit binary streams to the platform, and the platform requires a codec to communicate with NB-IoT devices. A product model defines the basic properties and commands of a specific type of devices. You can develop product models and codecs on the console, upload local product models and codecs to the console, or import preset models from the common product library.
    • Registering gas detectors and window openers: You can register a device using a specific application API or the IoTDA console. The device ID generated upon registration is the unique identifier of a device for communicating with the platform. In this scenario, you need to register two types of devices: gas detectors and window openers.
    • Creating a device linkage rule: You can create a device linkage rule with trigger conditions and actions on the console to forward data to specific devices.
    • Reporting gas detection properties: The NB-IoT module on NB-IoT devices has been integrated with Huawei IoT Tiny SDK and can transmit binary streams to the platform. The platform then decodes the binary streams using a codec.
    • Rule-based device linkage: The platform uses the device linkage rule to filter property values reported by gas detectors, converts property values into commands, and delivers the commands to the wireless window openers.
    • Delivering commands to open windows: The platform delivers commands to the wireless window openers to open the windows for ventilation.

    For details about this scenario, see Automatically Opening the Window upon High Gas Concentration.

    In this scenario, devices interact with the platform over LwM2M to report properties. You can create device linkage rules on the console or by calling APIs to convert the reported properties into commands and deliver the commands to other specific devices.

    Key points: product model, codec, property reporting, command delivery, MQTT, and device linkage rules

  5. Constant-Temperature Air Conditioner

    You can adjust the default temperature of air conditioners (regardless of whether they are powered on) by using a constant-temperature control system. After being powered on, the air conditioners automatically run at the default temperature.

    Process description:

    • Creating a product for constant-temperature air conditioners: The platform manages devices by product. You can create products by calling a specific API or using the IoTDA console.
    • Uploading a product model and codec: A product model defines the basic properties and commands of a specific type of devices. You can develop product models on the console, upload local product models to the console, or import preset models from the common product library. No codec is required if devices report JSON data rather than binary code streams to the platform.
    • Registering constant-temperature air conditioners: You can register a device using a specific application API or register multiple devices using the console. The device ID generated upon registration is the unique identifier of a device for communicating with the platform.
    • Configuring the expected constant temperature: Before the configuration, you need to understand what is a device shadow. The platform caches the desired device shadow configurations from the application side for offline devices. After the devices go online, the platform synchronizes properties to the devices until the reported properties and the desired values are consistent. The desired configurations contain the default temperature that the constant-temperature control system adjusts for different seasons. For example, the default temperature is 28°C in winter and 24°C in summer.

      To configure a device shadow on the IoTDA console, choose Device Shadow on the device details page and click Configure Property. If you cannot configure a device shadow, add a product model first. The device shadow depends on device properties, and device properties depend on the product model. Therefore, you must define the properties of the product model before using the device shadow.

    • Caching desired values in the device shadow: The device shadow stores a copy of device data on the platform and provides the modification and synchronization of cached properties. Properties of offline devices can be modified and then synchronized after the devices go online.
    • Powering on air conditioners: After being powered on, air conditioners establish connections with the platform by reporting binary code streams or JSON data. Then the desired values cached on the platform are delivered to the air conditioners through device property delivery for modification purposes.
    • Reporting the current temperature values: The air conditioners report the current temperature to the platform.
    • Updating property values in the device shadow: If the expected temperature is 28°C but the temperature reported by an air conditioner is 26°C, the platform delivers the property modification command again to adjust the air conditioner to 28°C. If the temperature reported by the air conditioner is 28°C, the platform does not deliver the property modification command.
    • Reporting air conditioner temperature values: After the air conditioner temperature is adjusted as expected, the platform forwards the reported temperature value to the constant-temperature control system. Both the application side and console can proactively query the device shadow and determine whether to adjust the expected temperature.

    For details about this scenario, see Constant-Temperature Air Conditioner.

    In this scenario, the application or console delivers property pending commands to offline devices. If devices go online and report different properties, the console automatically delivers commands to modify device properties until they are the same as the desired values.

    Key points: product model, codec, device shadow, property reporting, and property modification

Quick Start

The following sections provide guidance for you to experience the platform APIs using open-source simulators. These APIs simplify the development on both the application and device sides. After reading these sections, you will understand the access modes of the platform and how to connect devices to the platform as a developer.

  • Quick Application Access

    IoTDA provides application APIs that enable applications to connect to the platform. You can call application APIs to create and manage products and devices. You can also view product and device details and manage products and devices on the IoTDA console.

    For details about how to perform authentication, access the platform, and create products and devices, see Postman.

  • Quick Device Access

    IoTDA provides device APIs that enable you to perform authentication, report data or messages, and subscribe to messages. You can also view data reported by devices and manually deliver commands on the IoTDA console.

    For details about how to connect devices and report data, see Mqtt.fx.

For more functions, see IoTDA Developer Guide.