97. How to know the HMI loses the connection with the MQTT broker?
If HMI is a MQTT publisher, how can the subscriber know when does the HMI lose the connection with the broker? When the HMI connects with the broker for the first time, it will send an initial topic, which is the HMI’s connection status. The subscriber can then subscribe to this topic to know whether the connection is lost.
Subscribe the following topic:
iot-2/type/mt/id//evt/status/fmt/json
The is the [Registration ID] of each HMI. Use MQTT.fx as the subscriber example:
By subscribing this topic, the subscriber will receive the following text message:
When the HMI loses the connection with the MQTT broker, the subscriber will receive the “last will” message as follows:



No comments to display
No comments to display