Configure an MQTT Publisher
- Last UpdatedAug 19, 2024
- 3 minute read
The MQTT protocol allows the Communication Driver and associated software to communicate with edge devices that have published MQTT data to an MQTT broker. The publisher functionality allows the Communication Driver to expose, and publish only the specific references that are configured for publishing purposes. Hence, the user can then select a specific set of references whose data will be published to the MQTT broker.
The MQTT publisher can be configured with all the Communication Driver data sources, such as ArchestrA, DDE, SuiteLink, OPC and OPC UA. To configure an MQTT publisher, create and configure the hierarchy of the data source and groups. Use the proper item naming conventions in its client(s). It is highly recommended to set up an MQTT Broker connection before configuring the MQTT Publisher. Refer Configure an MQTT data source connection section for steps to configure the MQTT Broker.
Ensure the following steps are completed before attempting to configure the MQTT publisher.
-
Connecting to Data Sources
-
Connecting to Data Sources
-
Configuring an MQTT Data Source Connection
-
Configuring an MQTT Group Connection
Workflow to configure an MQTT Publisher
Follow the workflow given below to configure an MQTT publisher.
-
Add a Data Source Object to your Gateway Communication Driver Hierarchy.
-
Add a Data Source Group Object
-
Add an MQTT Group Connection
-
Add an MQTT Reference Item
-
Publish MQTT Information
Example:
The example below describes the procedure to configure the OPC data source to publish data using the MQTT publisher. To use other data sources such as ArchestrA, DDE, SuiteLink or OPC UA, follow the configuration procedure for the respective connection.
Add an OPC Data Source Object to your Gateway Communication Driver Hierarchy
See Configure an OPC data source object.
Add an OPC Data Source Group Object
See Configure an OPC group object.
Add an MQTT Group Connection
See Configure an MQTT group connection.
Note: Multiple groups can be added to a single MQTT broker.
Add an MQTT Reference Item
-
In the OPCGroup Object parameter, select the MQTT Publish Items tab.
-
Publish User Group: From the list of broker groups, select a broker group (BROKER_01.Group_1).
-
Unique Item ID: A unique item ID (UID) for the selected user group is automatically generated by the system. Rename it, if desired. The UID has been renamed to MB-1 in this example.
Note: The characters + and # are considered invalid and cannot be used in the Unique Item ID.
-
-
To add a reference item, right-click anywhere on the tabular space, and select the Add command from the shortcut menu.
-
A device item is created, and it is numerically named by default. For example, Item_0, Item_1, and so on.
-
-
To change the default name, double-click it and enter the new name.
-
Enter a unique name for the new device item (i1 in this example).
-
-
The MQTT Syntax column is automatically populated with the syntax of the format:
<Unique Item ID>/<Reference Item>
In this example, we have MB-1/i1.
-
Multiple reference items can be added for the selected Publish User Group.

-
Save the configuration.
Publish MQTT Information
-
To activate, right-click OI.Gateway.3 and click Activate Server.
Note: In this example, the Simulation Communication Driver is configured and hence, is activated automatically.
-
The MQTT information for the reference items is published and can be viewed in the following paths
-
OI.GATEWAY.3 > Diagnostics > Client Groups > MQTT Plugin
-
Wonderware – SIM > OI.SIM.1 > Diagnostics > Client group > OPC_001.OPCGroup_1
-
-
Double-click the row to display the Diagnostic info pop-up window showing the following parameters: Name, Client Value, Client Time, Quality, Location, Subscription Message and Device Group.