Help Center>
IoT Device Access>
User Guide>
Message Communications>
Data Reporting>
Device Reporting Properties>
Property Reporting Usage
Updated on 2023-10-18 GMT+08:00
Property Reporting Usage
Description
Figure 1 Process of device property reporting
- Product and device creation and product model definition: For details, see Creating a Product, Registering an Individual Device, and Product Model Definition.
- Device authentication: The platform checks whether the device has the access permission.
- Device property reporting: Devices report property data using protocols such as MQTT, HTTP, and LwM2M.
Use different APIs for different protocols.
- MQTT: Use the property reporting APIs for MQTT devices. The following is an example of reporting MQTT device property.
Topic: $oc/devices/{device_id}/sys/properties/report Data format example: { "services": [ { "service_id": "Temperature", "properties": { "value": 57, "value2": 60 } } ] }
- HTTPS: Use the property reporting APIs for HTTP devices. To obtain access_token for HTTP devices, see Authenticating a Device. The following is an example of reporting HTTPS device property.
POST https://{endpoint}/v5/devices/{device_id}/sys/properties/report Content-Type: application/json access_token: d144a524-1997-4b99-94bf-f27128da8a34 { "services": [ { "service_id": "serviceId", "properties": { "Height": 124, "Speed": 23.24 } } ] }
- LwM2M/CoAP: Use the property reporting APIs for devices using LwM2M over CoAP. The following is an example of property reporting for devices using LwM2M over CoAP.
// Assume that the data content (value) reported by the device is c4 0d 5a 6e 96 0b c3 0e 2b 30 37. NON-2.05 MID=48590, Token=2cb6a673cba24c04, OptionSet={"Observe":22, "Content-Format":"application/octet-stream"}, c4 0d 5a 6e 96 0b c3 0e 2b 30 37
- The reported device properties must match the properties defined in the product model.
- For details about devices using different protocols, see MQTT Device Reporting Properties, HTTP Device Reporting Properties, and LwM2M/CoAP Device Reporting Properties.
- MQTT: Use the property reporting APIs for MQTT devices. The following is an example of reporting MQTT device property.
- The platform stores the latest data snapshot. If the reported data complies with the product model definition, log in to the IoTDA console, choose Devices > All Devices, and select a device to access its details page. The latest data snapshot is displayed on the Device Info tab page.
Figure 2 Platform receiving and parsing the reported device properties
- Data forwarding: With the data forwarding function, data can be forwarded to applications or other Huawei Cloud services for storage and processing.
Parent topic: Device Reporting Properties
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot