How to convert OPC UA to MQTT
No access to YouTube? Click here to view locally
Summary
- Download and install Cogent DataHub software.
- Start the DataHub.
- Connect to your OPC UA server.
- Connect to your MQTT broker.
For more details and options, see the documentation.
DataHub product used: DataHub IoT Gateway
Transcript
- How to convert OPC UA to MQTT.
- First download and install Cogent DataHub software.
- Start the DataHub, and from the Properties window, select the OPC UA option and click the Add button.
- Choose or enter a Discovery Domain.
- Choose or enter the endpoint URL for the OPC server.
- Leave the other fields at the default settings and click the Connection Test button.
- The connection should succeed. Close the window.
- Leave the Data Transfer options at the default settings.
- Manually select the nodes you want to connect to.
- Or choose Load All Nodes on Server.
- Enter a meaningful name for the data domain. Let’s call it “OPC UA server.”
- Click OK, make sure the “Act as an OPC UA Client” and the “On” button are checked, then click Apply.
- Click View Data to see your data in the Data Browser. You are now connected to the OPC UA server.
- Now we will connect the DataHub MQTT Client to the MQTT broker.
- In the DataHub Properties window, select the MQTT Client feature. Check the “Enable MQTT client connections” option to act as an MQTT client to the broker. Then click the Add button to configure an MQTT client connection.
- In the Connect to MQTT Broker configuration window we will configure standard MQTT. For Azure IoT Hub, Google IoT, AWS IoT Core, or Sparkplug connections, please see the documentation.
- Create a label for this connection. Then enter the host name or IP address for your MQTT broker. Leave the other connection options at the default settings for now.
- Select the points whose data you wish to push to the MQTT broker.
- You can add a prefix segment to every topic to help identify this connection on the MQTT broker. Leave all the other options at the default settings, and click OK.
- Back in the MQTT Client Configuration, you will see the configured connection. Click Apply, and the Status should change to Running.
- You can view your data In another MQTT client. Connect that client to the MQTT broker, and you should be able to access the OPC UA messages.
- Now you are connected. OPC UA data is being sent to the MQTT broker.
Background
MQTT is a messaging protocol used in many Industrial IoT (IIoT) applications. It allows clients to connect using a publish/subscribe mechanism over TCP/IP. It can support low bandwidth and low latency connections, and can scale up or down as needed.
OPC is a widely-used protocol for connecting industrial hardware and devices with HMIs and other software. It supports communications for thousands of diverse products, keeping costs down for plant owners and hardware suppliers alike. OPC UA is the latest protocol from the OPC Foundation.
Learning how to convert OPC UA to MQTT using Cogent DataHub software is a good way to integrate these two protocols, and seamlessly connect production data to cloud services and other MQTT applications.
Skkynet provides Cogent DataHub secure-by-design software and services to let you acquire, aggregate, monitor, control visualize, and network live process data in-plant or over insecure external networks, making it ideal for OT to IT and cloud connections. You can isolate control networks from cyber attacks and integrate industrial data under a unified namespace, all without compromising the plant.
