MQTT
MQTT is an open M2M protocol that is used to transfer notifications and is primarily applied to monitoring and control technical processes with SCADA systems. The device will operate as a client that will send data on a customizable topic to a broker. Other clients can subscribe to this topic, in order to receive the data sent by the device for further processing.
This is used for the notification feature of the peripherals (sensors, digital I/Os, watchdogs). Notifications have to be enabled and configured there to be sent by MQTT.
Configuration
Enable
Tick the checkbox to fill out the configuration details and enable the interface.
Send changes after reboot
Tick the checkbox to make the device send saved data for all peripherals with enabled MQTT notifications at startup.
Broker settings
Host
The IP or hostname of the MQTT broker
Port
The TCP Port of the MQTT broker
TLS
Tick the checkbox to make requests to the broker use TLS
Client ID
The ID to identify this client on the broker
User, Password
User name, if access to the broker is gated
User, Password
User password, if access to the broker is gated
Topic Prefix
A text (string) that is prepended in front of the MQTT topic of messages sent to the broker.
This can be used to group multiple devices and interfaces.
The full topic name will have a path like structure depending on the peripheral, e.g.:
prefix/output/0/value
prefix/input/0/value
prefix/watchdog/0/value
prefix/sensor/a60000042000006c00/value
Interval
The regular time interval in which sensor values are transmitted via MQTT
This field is only relevant for sensors. MQTT notifications for digital IOs and watchdogs are sent, when an event occurs.
Keep Alive
MQTT keep alive is the maximum interval the client and broker expect between control packets to know the other side is still connected.
The client must send a packet (or a PINGREQ if idle) within the specified number in seconds. The broker may drop the connection if no packet is received within ~1.5 times that value.
Retain
Retained messages (messages including a Retain Flag) tell the broker to store the message and its QoS. Every topic has one retained message. When a client subscribes to a topic, the broker immediately delivers the retained message.
Retain for * messages
Where *
- sensor
- input
- output
- watchdog
Check one or multiple checkboxes to include the Retain Flag in the respective messages.
Last Will
The broker uses the keep alive timeout to detect unexpected disconnects. If a client is considered dead and a Last Will was provided in CONNECT, the broker will publish that Will.
Last Will Topic
The MQTT topic name the broker will publish to if the client disconnects unexpectedly
Last Will Message
The payload the broker will publish to the Last Will topic
Connect Message
The Connect message is sent for the Last Will topic when the content is not empty, so that other clients are notified when this client connects or loses the connection.
Retain
Signal the broker to include a Retain flag to the Last Will
Save the configuration
After filling in the form, click on at the bottom of the page, to persist the configuration.