Send industrial data to an MQTT Broker
A quick tutorial for sending field data via MQTT with TLS Security to a designated Broker using the nodeG5 edge IIoT gateway.
Send industrial data to an MQTT Broker
How to send field data using MQTT (with TLS Security) to a designated Broker
The built in MQTT client on our IIoT gateways have been tested to work with Mosquitto broker. For ease of concept testing, test.mosquitto.org:8883 broker with TLS security has been configured by default.
The nodeG5 edge IIoT gateway aggregates data using REST API from the following devices into a JSON string that users can be process on board (using Python or Docker) and send to a cloud service or server.
-
CAN bus (J1939 or OBD2)
-
OPC UA
-
Modbus (TCP or RTU)
-
Serial RS485
-
Bluetooth (BLE)
-
WiFi
Before you continue, please note the following:
-
The steps in this tutorial will assume that you are already reading your device data in the gateway. For detailed guides in connecting to different types of devices see our device tutorial library.
-
Mosquitto test broker server is a convenient free service, we do not recommend using it to deploy your application. We have integrated it for ease of testing before you configure it for your intended MQTT broker/back-end.
-
Our web configuration will not be able to cater to all variations of setting requirements. If you require assistance to modify the client python script please contact us at support@amplified.com.au
Begin by logging in to the gateway web configuration menu.
In the "IoT Client" tab add in the information for your "Broker Host" & your choice of a "Message Topic".
For testing, you can use 'test.mosquitto.org' as the Broker Host.
For a port 8883 encrypted connection
If you are connecting to your own or other 3rd party MQTT broker, please update your ca.crt, certificate and key files (if required) as "ca.crt", "client.crt" & "client.key" respectively into the \user\mqtt folder.
For this test setup you can download the CA server certificate from http://test.mosquitto.org/ssl/mosquitto.org.crt
For unsecured connection using port 1883
If your broker requires username/password please update them into the fields.
Or else leave it clear.
Testing the connection
If your nodeG5 already is configured and reading some data, you can test if data is being successfully sent to the Mosquitto test server with following command:
mosquitto_sub -h test.mosquitto.org -t "nodeG5