How to convert MQTT to OPC UA
No access to YouTube? Click here to view locally
Summary
- Download and install Cogent DataHub software.
- Start the DataHub.
- Configure security.
- Connect your MQTT device.
- Connect your OPC UA client.
For more details and options, see the documentation.
DataHub product used: DataHub Smart MQTT Broker, OPC UA
Transcript
- How to convert MQTT to OPC UA.
- First, download and install Cogent DataHub software.
- Start the DataHub, and from the Properties window, select the Security option to configure secure remote connections. Click the Configure button.
- Under Users, click the Add button to add a Built-In User.
- Enter a username and password.
- Uncheck the Require TOTP Authentication box because this is a non-interactive connection. Then click OK.
- In the Roles, check the All Data Full Access box. This enables secure remote connections. Then click OK and Apply.
- In the Properties window, select the MQTT Broker. Ensure the Enable MQTT Broker option is checked, and that “Listen for connections on port 1883” is enabled.
- In Message Content, select “Interpret messages as JSON data point values” and the Simple message format. Then click the Edit button.
- In the Configure Parser dialog window, delete all values in the Per-Point Format entry field.
- Type {value}. This will assign the entire content of each MQTT message to be the value of a DataHub point. See the documentation for other options.
- Click OK to close this window.
- Back in the main configuration, in Options, make sure “Require authentication” and “Use per-topic permissions” are not selected. This will simplify your security requirements for now. See the documentation for enabling security later on. You can keep “Mark data as Not Connected” selected.
- Leave all the other options at the default settings, and click Apply.
- Connect your device to your DataHub MQTT Broker. We are using an MQTT demo program to simulate a device.
- In our simulator, we create an MQTT topic name as a two-part string separated by a slash, like Device1/Msg1. The first part of the string is for the DataHub domain and the second part is the point name. Your device may use a different naming convention.
- Publish a test message to the DataHub MQTT Broker.
- Back in your DataHub instance, click View Data to see your data in the Data Browser. The device is now connected.
- Back in the Properties window, select the OPC UA option. Make sure the box for Act as an OPC UA Server is checked, and the protocols you need are also checked. Then click Apply.
- In your OPC UA client, add the Cogent DataHub server. Then select your nodes. You should see your data.
- Now you are connected.
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 MQTT to OPC UA with Cogent DataHub software is a good way to integrate these two protocols, and make them available to all of the other supported protocols, like OPC DA, OPC A&E, A&C, Modbus, ODBC, and more.
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.
