If youâre using thin-edge.io (>= 1.4.x), then you donât have to worry about any of this. By default thin-edge.io subscribes to the devicecontrol/notifications
topic which is the Cumulocity operations in JSON format.
On a device, you can checkout the MQTT message being received and sent to the server by just subscribing to the local MQTT broker. The exert below shows the configuration snapshot operation being received by thin-edge.io, the mapper converts the message to a thin-edge.io message, the tedge-agent processes the message (using a workflow), whilst the mapper will translate the operationâs status update back to Cumulocity.
$ tedge mqtt sub '#'
[c8y/devicecontrol/notifications] {"delivery":{"log":[],"time":"2025-01-21T16:36:33.604Z","status":"PENDING"},"agentId":"5733465816","creationTime":"2025-01-21T16:36:33.551Z","deviceId":"5733465816","id":"43639315","status":"PENDING","description":"Retrieve tedge-configuration-plugin configuration snapshot from device rpi5-d83addab8e9f","c8y_UploadConfigFile":{"type":"tedge-configuration-plugin"},"externalSource":{"externalId":"rpi5-d83addab8e9f","type":"c8y_Serial"}}
[c8y/s/ds] 526,rpi5-d83addab8e9f,tedge-configuration-plugin
[te/device/main///cmd/config_snapshot/c8y-mapper-43639315] {"status":"init","tedgeUrl":"http://127.0.0.1:8000/tedge/file-transfer/rpi5-d83addab8e9f/config_snapshot/tedge-configuration-plugin-c8y-mapper-43639315","type":"tedge-configuration-plugin"}
[te/device/main///cmd/config_snapshot/c8y-mapper-43639315] {"@version":"builtin","logPath":"/var/log/tedge/agent/workflow-config_snapshot-c8y-mapper-43639315.log","status":"scheduled","tedgeUrl":"http://127.0.0.1:8000/tedge/file-transfer/rpi5-d83addab8e9f/config_snapshot/tedge-configuration-plugin-c8y-mapper-43639315","type":"tedge-configuration-plugin"}
[te/device/main///cmd/config_snapshot/c8y-mapper-43639315] {"@version":"builtin","logPath":"/var/log/tedge/agent/workflow-config_snapshot-c8y-mapper-43639315.log","status":"executing","tedgeUrl":"http://127.0.0.1:8000/tedge/file-transfer/rpi5-d83addab8e9f/config_snapshot/tedge-configuration-plugin-c8y-mapper-43639315","type":"tedge-configuration-plugin"}
[te/device/main///cmd/config_snapshot/c8y-mapper-43639315] {"@version":"builtin","logPath":"/var/log/tedge/agent/workflow-config_snapshot-c8y-mapper-43639315.log","path":"/etc/tedge/plugins/tedge-configuration-plugin.toml","status":"successful","tedgeUrl":"http://127.0.0.1:8000/tedge/file-transfer/rpi5-d83addab8e9f/config_snapshot/tedge-configuration-plugin-c8y-mapper-43639315","type":"tedge-configuration-plugin"}
[c8y/s/us] 504,43639315
[c8y/s/us] 506,43639315,https://thin-edge-io.eu-latest.cumulocity.com/event/events/43640330/binaries
The SmartREST 2.0 static templates, 504 - 506 are used so that the operation can be updated via the operation id.
But as a thin-edge.io user you donât need to worry about the ins-and-outs of the Cumulocity interface, it does all the heavy lifting for you. And since thin-edge.io 1.4.2, you can even write a custom operation handler using the powerful workflow model. The tedge-command-plugin contains an example of this already how to map a Cumulocity json message to a thin-edge.io workflow.