Step 2: Setting up MQTT drivers and connections for JACE devices
License requirements
The abstract MQTT driver module is a licensed feature. You can check to see if your software installation is licensed for MQTT by opening the license file from the License Manager view found in Tools Local License Database. The feature name is present only if your platform is licensed for MQTT.
Figure 1 Example MQTT license with point limit attribute values set to “none”.
Setting up MQTT driver on JACE
Open the Palette side bar by selecting window Side Bars Palette from the Menu bar.
Clock on the Open Palette icon from the Palette side bar.
Using the Palette side bar controls, open the AbstractMqttDriver palette.
In Palette, open the AbstractMqttDriver palette.
If there is a current AbstractMqttDriverNetwork in Config: Drivers, this existing MQTT network can be used; otherwise drag the AbstractMqttDriverNetwork from the palette into Config: Drivers
Drag the AbstractMqttDriverDevice from the palette into Config: Drivers: AbstractMqttDriverNetwork
If the driver device will be for receiving json formatted messages, rename it to AbstractMqttDriverDevice-JSON or similar, to identify it will be for json formatted messages. Otherwise leave the name as is.
Credentials of setting up connections to DCH servers
The two-way connection on JACE devices use different methods (Writing to DCH: JSON, Reading from DCH: ASCII string). The following are the credentials to initiate these communications with the DCH servers.
Use the following details in Station: Config: Drivers: AbstractMqttDriverNetwork AbstractMqttDriverDevice. The Topic information is used later when setting up the points.
For publishing data from JACE to DCH servers
Broker IP Address
senaps.io
Username
DCH will provide. Check that this is the proper username for json formatted MQTT messages.
Password
DCH must provide
Broker Port
8883
Ssl Version
TLSv1.2 (User Login Over SSL (CA Signed Certificates))
Topic
DCH must provide
For receiving commands from DCH servers on JACE to forward to sensors
Broker IP Address
senaps.io
Username
DCH will provide. Check that this is the proper username for non-json formatted MQTT messages (i.e. ASCII).
Password
DCH must provide
Broker Port
8883
Ssl Version
TLSv1.2 (User Login Over SSL (CA Signed Certificates))
Topic
This will be provided by the app developer (the DCH application publishing the control signals).
Subscribing to MQTT topics on JACE
This is basically the subscription to receive commands from the DCH servers to be sent to end nodes connected to the JACE device.
Drag the relevant subscribe point type from the palette (in the AbstractMqttPoints palette folder) into Config: Drivers: AbstractDriverNetwork: AbstractMqttDriverDevice: Points. The different types are Boolean, Numeric, String, Enum.
For each subscription point, fill out the MQTT Proxy Ext Topic field. This must match the username and topic that Senaps.io is publishing to.
IMPORTANT: Right-click on the point Proxy Ext and select Actions Subscribe, to subscribe to the point. There is no indication in the Jace that this step is required, or that it has not been completed.
Generally, set Quality of Service (QoS) to 0 (fire and forget) as network traffic may overload with QoS 1 and 2.
Command signals may or may not be retained. Ensure that there is a default (fallback) value set in the point in the event of loss of connection.
If you require a NULL value to be sent to the Jace, request that the publisher publishes a text string, e.g. “NULL”. Numeric points in the Jace will interpret a text string as a NULL value as it does not match the point type.
Publishing to DCH servers
This section is where the MQTT driver is linked to the JSON Toolkit. You cannot publish to the Senaps MQTT broker unless the messages are in the correct JSON DCH Schema format.
As previously described in “Setting up JSON Toolkit for JACE devices” section of this document, setting up the json schema is vital because it reads point values and then publishes json formatted messages in the EngineCycleMessageQueue. It then buffers the messages to the MqttStringPublishPoint at a defined queue rate. The default EngineCycleMessageQueue size is 1000 messages, and default publish rate is 50ms pause between engine cycles.
NOTE: These settings were hidden, and we described how to make them unhidden in order to change them.
The output of the JSON Relative Json Schema and EngineCycleMessageQueue is linked to the input of a MqttStringPublishPoint.
Adding MqttStringPublishPoint
Noting that you have an AbstractMqttDriverDevice for JSON messages named AbstractMqttDriverDevice-JSON or something similar, continue with the following steps.
In the palette drag the MqttStringPublishPoint into Config: Drivers: AbstractDriverNetwork: AbstractMqttDriverDevice-JSON: Points. Rename it to MqttStringPublishPoint-JSON or similar to denote it is for JSON formatted messages.
Link the output of the EngineCycleMessageQueue into ln16 input of MqttStringPublishPoint-JSON.
In MqttStringPublishPoint-JSON: Proxy Ext, type in the required MQTT Topic. This will be advised by Data61 and will be similar to: dch/Newcastle/NewcastleEnergyCentreB001/tridium/EMS_2470Newcastle_EMSJ01
Proxy Ext Settings:
Enabled
True
Conversion
Default
Tuning Policy Name
Default
Topic
Correct Topic from DCH
QoS
Fire and Forget (0)
Retained
True
Publish Message on Change
True
Important: When the point is configured, right-click on the Proxy Ext, select Actions Publish to begin publishing.
Last Will and Testament (LWT)
Open AbstractMqttDriverDevice and select AXProperty Sheet.
Enable L W T
True
Topic For L W T
same topic for publishing to Senaps.io but with /lwt appended to the end, e.g. dch/Newcastle/NewcastleEnergyCentreB001/tridium/DCH_2470Newcastle_JACE01/lwt
Message For L W T
“JaceName” Disconnected, e.g. DCH_2470Newcastle_JACE01 Disconnected
Last updated