About the ThingsBoard MQTT Connector Module:
The ThingsBoard Connector Module enables you to connect devices within a Niagara station to a ThingsBoard instance via MQTT using a device extension.
thingsBoardConnector-rt.jar - Version 1.6 (502.7 KB)
Note: The JAR is compiled against 4.7 meaning it can run in platforms 4.7 or greater. The module is unsigned and will require the user to sign it because it can be run in 4.9+.
How to use the ThingsBoard Connector
The installation process expects that you already have a running instance of Thingsboard and the broker is accessible from the Niagara station via the internet or local network.
Installing the service:
- Install the thingsBoardConnector-rt.jar into your Niagara platform where you will be running the service.
- Open the thingsBoardConnector pallette in workbench and add the MqttService to the stations service tree.
- Open the property sheet of the service and enter your Things Board broker details. Save, and enabled the service.
Using the Mqtt Device Extension:
Either manually or programmatically (using the program service), add the MqttDeviceExt to the devices you wish to post telemetry from to Thingsboard.
Currently there is no option to hand pick the points that will be published to the Thingsboard broker. However there are two configurable properties:
Traverse Folders
By default traverse folders is enabled. This means that the device extension will traverse all folders beneath the root “Points” folder and post the telemetry to the broker.
If traverse folders is disabled, the extension will only publish the immediate child components of the root “Points” to the broker.
Currently the thingsBoardConnector supports posting Numeric, Boolean, String & Enum types.
Key Format
In Thingboard telemetry is posted as { key: value } objects. The key format property allows you to BFormat the originator, which in our case is the point name of the telemetry.
For example:
If our point name is ZnTmp and our BFormat is %name% then our telemetry payload would become { ZnTmp: value } where value is equal to the current value of the object. There may be times where you don’t want to use the originator. In this case you can simple write the string name of the key in the key format property.
When an MqttDeviceExt is added to a device it self registers to the service. The property “Registered Device Count” on the MqttService indicates the number of registered devices.
Final Step:
Enable the MqttService, right-click the service and invoke the “Connect Broker” action. If the broker connects the status message will update the indicate “Connected”. If there is an issue connecting to the the broker, the status message will display the error. Detailed debugging can be enabled by unhiding the property “debugging” on the service and enabling it. You should then monitor the platform console for the debugging message.
If the broker connected successfully
the telemetry will begin publishing to the broker at the interval define in the “Post Telemetry Interval” property on the server. However to test the publish with immediate effect you may manually invoke the action “Post Telemetry” on the service.
If you have any issues, feature request or anything else. Please feel free to ask for help on this topic.
