MQTT Plug-in
The following properties can be set in the configuration of the MQTT plug-in.
Up to version 5.4, the MQTT implementation could be selected in the Expert setting → Implementation area. The following options were available:
Legacy AutomaticLegacy Strider MqttLegacy MQTTnetMQTTnet(recommended) Starting with version 5.5, a migration note appears for old configurations, recommending switching to MQTT .NET V2. Starting with version 5.6, only MQTT .NET V2 is available.
Tab: Router Settings
| Field | Description |
|---|---|
| Name | Assign a unique name to the MQTT connection. |
| Cloud Profile | Select the desired profile: MQTT Standard, AWS, Azure IoT, Wago Cloud. |
| Test Connection can be used to check the current connection. |
Cloud profiles
The cloud profiles extend the standard configuration with additional tabs:
**For more information on using MQTT and the cloud profiles, please refer to our Knowledge Base: ** https://www.opc-router.de/knowledge-base/
Tab: Connection settings
Connection details
| Field | Description |
|---|---|
| Broker connection | Enter the address of the MQTT broker. |
| Port | TCP port of the broker (default: 8883). |
| MQTT version | Select the protocol version (e.g., MQTT v5 or MQTT v3.1.1). |
| Quality of Service type | Select the default QoS: 0 – maximum once, 1 – minimum once, or 2 – exactly once. |
For details on latency times, network round trips (RTT), and internal synchronization during publish operations, see [MQTT Performance] (mqtt_performance.md).
Authentication
| Field | Description |
|---|---|
| Username | Username for logging in to the broker. |
| Password | Selection of a secret. The buttons can be used to create, edit, or delete a secret. |
| Client ID | Unique client ID. Supports placeholders:${hostname}, #[INSTANCE], # [INSTANCE:<numeric value>], #[RAND:<numeric value>]. This is helpful for connection pooling or project synchronization to automatically generate different IDs per instance. Example: MyInstance-${hostname}-#[RAND:4] |
| *Buttons * | Random – generates a random ID. Client ID Template – inserts the default template into the input field. |
Enable TLS/SSL
| Field | Description |
|---|---|
| SSL protocol | Select from supported protocols (e.g., TLSv1.2, TLSv1.3). |
| Client certificate | Select a client certificate (or Without). |
| Trusted certificates | Specifies which certificates are accepted (e.g., All (unsafe), Windows, Router). |
Tab: Storage
| Field | Description |
|---|---|
| Enable MQTT Data Storage | When enabled, the last received MQTT message for each topic is stored on the hard disk. This feature is required to use the MQTT Storage Read Transfer Object. |
| Pattern | A subscription is created for each topic pattern added. Supports wildcards + and #. |
| Note | Free text to describe the purpose or origin of a topic. |
When the MQTT Data Storage function is enabled, the OPC Router creates automatic subscriptions for all entered topics. The received messages are stored persistently – only the last message per topic (old values are overwritten). These stored values can be read out again using the MQTT Storage Read transfer object.
Tab: First Will
| Field | Description |
|---|---|
| Enable First Will | Enables the sending of a First Will when establishing a connection. |
| Retain First Will | Broker stores message for later delivery. |
| Topic | Target topic for the First Will. |
| Payload | Content of the First Will message. |
| Quality of Service | Service quality (0, 1, or 2). |
Tab: Last Will
| Field | Description |
|---|---|
| Enable Last Will | Activates the sending of a message when the connection is terminated. |
| Retain Last Will | Broker stores message for later delivery. |
| Send Last Will on disconnect | Sends Last Will even when disconnecting manually. |
| Topic | Target topic for Last Will. |
| Payload | Content of Last Will message. |
| Quality of Service | Service quality (0, 1, or 2). |
Tab: Advanced
Connection Pool
| Field | Description |
|---|---|
| Enable Connection Pooling | When enabled, one connection is used for subscriptions and multiple connections are used for publish operations. Useful for high message volumes. |
| Min. connections | Minimum number of connections. |
| Max. connections | Maximum number of connections. |
| Connection idle timeout | Time in minutes after which inactive connections are closed. |
Subscription/Trigger
| Field | Description |
|---|---|
| Wait for transfer | Router only responds to the broker after the transfer has been completed or failed. |
| Enable message deduplication | Prevents multiple triggers for identical messages within a time window. |
| Deduplication time window | Time in seconds during which identical messages are ignored. |
Session options
| Field | Description |
|---|---|
| CleanSession | Starts a new session without stored messages (disable for persistent sessions). |
| Keep alive (s) | Ping interval in seconds. |
| Timeout (ms) | Waiting time in milliseconds for reconnection. |