Configure MQTT Driver for Publishing
The method to write messages to the MQTT broker will be different for various gateways. In general all gateway MQTT drivers will need a method of selecting the points to be uploaded, the broker address and configuration, and the MQTT topic to publish under.
In Niagara, a MQTT string publish point is required. This point is linked to the function blocks that create the JSON messages, and the point exports these messages (as they are received) to the broker under a topic defined in the string point. The general structure of the Niagara MQTT network is as follows:
An MQTT Abstract Network – This is the MQTT network and hosts all MQTT drivers and points.
Within the MQTT network are one or more MQTT abstract driver devices. The drivers connect to the MQTT broker (one driver per broker & username combination). The broker address, credentials and configuration settings are defined in the driver.
Within each of the driver devices are one or more MQTT publish points (one point per topic). These points receive the individual messages generated by the Jace and export them to the MQTT broker. The MQTT topic is defined in the publish point.
This section describes the general steps required to the gateway MQTT driver. Examples are shown from a Tridium Jace running Niagara 4.10.
1. Download the MQTT driver module(s) onto the gateway.
2. Access the MQTT function library and add a MQTT driver network.
3. Access the MQTT function library and add a MQTT driver device.
4. Configure the device with the following information:
Table 3- MQTT Broker Configuration
Broker address
broker.dataclearinghouse.org
If an IP address is required, the address is 52.64.251.183
Broker port
8883 for secure connection (strongly recommended) or 1883 for unsecure
Client ID
This must be a unique decimal or hexadecimal string. The software will probably autogenerate this. If not use a 10-16 digit numeric number. It does not need to be re-entered and can be changed as required.
Username
This is the username provided when registering the data source, and will start with "dsapi-"
Password
This is the password provided when registering the data source.
SSL/TLS
For secure connections on tcp_8883 enable SSL/TLS and use protocol TLSv1.2 and CA signed server certificate.
If the software requires manual upload of the certificate, this can be done from the senaps.io website via your internet browser. Refer to your browser documentation for instructions on how to perform this manually. Save the certificate to file and upload it to the MQTT Client software. Note that the senaps.io certificate is updated every 3 months so you will need to re-upload after an update.
Connection Timeout
Keep Alive Interval
Mqtt Version
.
.
etc.
Generally the default values will work, otherwise try:
Connection Timeout 30 (seconds)
Keep alive interval 60 (seconds)
MQTT version 3.1.1
5. Enable the MQTT device and network and check that the gateway connects to the broker.
If connection does not occur, check the following:
a. Check the datasource username and password are correct.
b. Check MQTT driver device fault status and cause.
c. Check the gateway error logs for connection errors.
d. Check your device has internet connectivity.
e. Try to ping the broker and review the results.
f. Disable and re-enable the MQTT Driver Network and Device.
g. Confirm with the network administrator that the firewall is allowing traffic through from the gateway to the broker.
h. Try an unsecure connection via tcp_1883. If this connects, there may be a certificate issue or TLS version problem with the secure connection.
NOTE: After troubleshooting using an unsecure connection is completed it is strongly recommended that you change the datasource password using the DCH portal.
i. Change Client ID and retry.
The gateway may require a topic to be entered during network/device configuration. If so, enter the topic as required. The Niagara system uses a publish point which needs to be added to the device, and this process is described in the DCH Jace section of this documentation.
Last updated