Access Instance - Device Image

This article gives examples to introduce how to interact with device image using the MQTT.fx simulator.

MQTT Client 1.7.1 download

Preparations

  • Before uploading data points, complete the creation of products and devices, and perform device connection. Please refer to the Device Connection Instance for steps.
  • In order to get message notifications triggered by device image, the device needs to subscribe to the related system topic. In this example, wildcards are used to subscribe to all image-related topics: $sys/238322/mqtts-test-device/image/#,如下图:

Reported Device Properties

Select Publish and enter the published topic.

In this example, the published topic name is: $sys/238322/mqtts-test-device/image/update

Below is an example of the payload:

{
    "state": {
        "reported": {
            "color": "red"
        }
    }
}

Click Publish to upload data points to the platform, as shown below:

After completion, you can receive an update notification from the platform via Subscribe. If the message is received by .../accepted topic, it means that the message has been successfully processed by the platform, as shown below:

After update, you can view the updated image json by hitting the Refresh button, as shown below:

Difference Message

When there is a difference between the desired content and the reported content, the platform will send the message to the device by topic .../delta.

On the console page, the desired property is edited and updated to "color":"green", as shown below:

Click OK to save the edited image content. Due to the difference between desired and reported, delta will be automatically generated in the properties, as shown below:

When saving is completed, the simulator will receive a message from topic $sys/238322/mqtts-test-device/image/update/delta, which is used to inform the device that the reported current status is different from the desired application status, as shown below:

个搜索结果,搜索内容 “

    0 个搜索结果,搜索内容 “