How to connect to an MQTT broker
No access to YouTube? Click here to view locally
Summary
- Download and install Cogent DataHub software.
- Start the DataHub.
- Connect some demo data.
- Connect to your MQTT broker.
For more details and options, see the documentation.
DataHub product used: DataHub IoT Gateway
Transcript
- How to connect to an MQTT broker.
- First download and install Cogent DataHub software.
- Start the DataHub, which opens the Properties window. To configure MQTT, we can use some demo data.
- To create demo data, start the DataPid program from the Windows Start menu or the desktop. The DataPid program is configured to automatically connect to your DataHub instance.
- Click View Data to see the DataPid data in the Data Browser. Now we have some data to send to the MQTT broker. If you already have data coming into your DataHub instance from some other source, you can use that instead.
- Back 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 MQTT 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 DataPid, PID1, and the points Mv, Pv, and Sp to send 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 DataPid messages.
- Now you are connected 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.
Connecting Cogent DataHub software to an MQTT broker is a good way to make DataHub data from supported protocols like OPC DA and UA, OPC A&E and A&C, Modbus, ODBC, and more available to MQTT applications and cloud services.
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.
