KubeEdge uses MQTT for communication between deviceTwin and devices/apps. EventBus can be started in multiple MQTT modes and acts as an interface for sending/receiving messages on relevant MQTT topics.
The purpose of this document is to describe the topics which KubeEdge uses for communication. Please read Beehive documentation for understanding about message format used by KubeEdge.
On starting EventBus, it subscribes to these 5 topics:
If the message is received on first 3 topics, the message is sent to deviceTwin, else the message is sent to cloud via edgeHub.
We will focus on the message expected on the first 3 topics.
"$hw/events/node/+/membership/get": This topic is used to get membership details of a node i.e the devices that are associated with the node. The response of the message is published on
"$hw/events/device/+/state/update": This topic is used to update the state of the device. + symbol can be replaced with ID of the device whose state is to be updated.
"$hw/events/device/+/twin/+": The two + symbols can be replaced by the deviceID on whose twin the operation is to be performed and any one of(update,cloud_updated,get) respectively.
"$ke/events/device/+/data/update"This topic is add in KubeEdge v1.4, and used for delivering time-serial data. This topic is not processed by edgecore, instead, they should be processed by third-party component on edge node such as EMQ Kuiper.
The content of data topic should conform to following format
"timestamp": 1597213444, //+optional
Following is the explanation of the three suffix used:
update: this suffix is used to update the twin for the deviceID.
cloud_updated: this suffix is used to sync the twin status between edge and cloud.
get: is used to get twin status of a device. The response is published on