Getting Started MQTT
If you want interface OAS with another MQTT Client please see the Getting Started MQTT Broker guide.
Tags can be defined to connect to MQTT devices and software brokers with the built in MQTT Driver Interface. The following steps can be used to setup direct communications with MQTT.
Step 1
Start Configure OAS application from the program group Open Automation Software.
Step 2
Select Configure-License and verify that MQTT is one of the available Drivers in the lower left of the form. If you do not see the MQTT driver available contact support@openautomationsoftware.com to update your license.
Note: You will need to be running Open Automation Software Version 8.26 or greater to support MQTT communications. You can download the latest version at www.openautomationsoftware.com/downloads/open-automation-software/
Step 3
Select Configure-Drivers.
Step 4
Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.
Note: Optionally select the Live Data Cloud node if you are hosting Allen Bradley data over the Internet with a standard Internet connection.
Step 5
Enter a meaningful Driver Interface Name that you will refer to this physical connection when defining Tags with MQTT Source.
Define the properties for the desired physical connection.
Note: You may need to Set Default Network Adapter for Driver Interfaces of the operating system.
Set the driver to MQTT. Enter the IP Address of the broker. The default port is 1883.
Enter the User Name and Password if required.
Keep Alive Time – Default is 60 Seconds.
Reconnect Time – Default 10 Seconds. If the connection to the broker is lost the Reconnect Time determines how long to wait before attempting to reconnect.
Optionally define a secondary failover MQTT Broker if the primary MQTT Broker fails with the property Enable Failover.
If both the primary and secondary broker are offline the Return to Online settings determines the retry frequency.
View Driver Interface Failover for more information and and video demonstrating communications failover.
Step 6
Select the Add button in the lower part of the form to add the Driver Interface as an available selection when defining Tags in the next step.
Note: If you need to define several Driver Interfaces you can use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.
Step 7
Select Configure-Tags.
Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.
Note: Optionally select the Live Data Cloud node if you are hosting Allen Bradley data over the Internet with a standard Internet connection.
Step 8
Select to Add a Tag.
Note: You can also add organizational Groups as many levels deep as you prefer and add tags to groups. To do this first add a Group to Tags Group at the root level, then right click on the Group in the right window to add additional Groups or Tags.
Step 9
Change the Data Source Tag property to MQTT.
Step 10
Select the correct Driver Interface from the Driver Interface pull down list.
Step 11
Enter the topic.
Step 12
Select the Quality of Service.
Step 13
Set the Topic Timeout – 0 = Topic will never timeout. Any number greater than 0 will cause the data to be Bad Data Quality if the broker does not publish within the time frame specified.
Step 14
Select to include Timestamp and or Data Quality to the topic.
This will publish to the specified topic above OAS/Items Sent/Timestamp and or OAS/ItemsSent/Quality.
Configuring the Default Network Adapter
If the communications for the MQTT driver is not working at all you may need to set the default network adapter priority in the operating system.
Step 15
To setup automated data transfer of any OAS Tag to any MQTT Broker see Getting-Started – Data Route and set the Target Destination to MQTT.
Step 16
To define multiple tags use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.
Note: You can also programmatically define Tags using the free to use OASConfig .NET Standard assembly, OPCSystems .NET Framework 4 assembly, or REST API.
Step 17
Select the Save button on the toolbar at the top.
Step 18
Create a directory on the local C: drive with the name OASDemo.
Save the file DemoTags.tags in the directory C:\OASDemo. Of course use the correct path for Linux.
Step 19
Under Configure – Options set the Default Tag Configuration File so when the computer restarts the tag file will automatically be loaded.