IoT

Got a MODBUS device that you want to publish its data to the cloud?  Use the JNIOR and the MODBUS to MQTT application.

MODBUS is a protocol that many legacy systems use.  MQTT is new and works very well to publish data to any MQTT broker whether in the cloud or hosted locally.  The JNIOR can fill the gap and get that older equipment’s data from the equipment to where you need it for analysis.

Set up the MQTT broker

There are several free brokers that you can use to test with.  You can find that list here: https://github.com/mqtt/mqtt.github.io/wiki/public_brokers

Define your slaves and the tags

If your slave is RS485 then you will need to use the model 410 and set up the serial settings to match your device.

Once your setup is complete you will the the data update on the MODBUS to MQTT page.  A message will be sent around the message pump the the MQTT application to publish the data.  The data will be sent to the topic as follows with spaces in the slave name or data tag simply removed.

This application is still a work in progress so please register to leave a comment below!

What is MQTT?

This is what MQTT.org says:

MQTT is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.

Here is a great intro to MQTT.  NOTE:  This application is in development and screenshot may appear different when released.  You can download the latest release here.

  MQTT v2.0 [ Apr 11 2019, 645 KB, MD5: 629238afd7cab9754bd166a1a141075a ]

Use MQTT with the JNIOR

Currently the MQTT functionality is limited but we are always looking for suggestions.  Currently will publish IO status by default.  When the JNIOR boots up and successfully connects to a broker we will report the current status of the digital IO.  Digital inputs will report state, usage meter and counter values.  Relay outputs will report just state and usage meter values.

To successfully connect to a broker you will need to have selected a broker and entered its information.  Information such as the Host URL, port number and whether the connection should be encrypted.  The JNIOR implements MQTT across a TCP connection.  The default port number for MQTT is 1883 when non-secure connection while it is 8883 when using a secured connection.  There are several public test brokers out there.  Do not use any free broker for sensitive information.  Brokers that require sign up will most likely provide a user name and password.

Groups!

There are two types of groups, Device Groups and Relay Output Groups.  Both of these concepts are in BETA as of version 1.2 and we are looking for feedback.

Device Groups allow JNIORs to subscribe to topics that contain the Device Group name instead of the Serial Number.  A JNIOR can be part of one or many Device Groups.  By default a JNIOR will subscribe to topics that are meant for it by Serial Number, for instance, jnior/618010001/set/...  The JNIOR may want to be part of the pump stations group for example the JNIOR will subscribe to jnior/pumpstations/set/... topics.

Relay Output Groups allow the specification of more than one relay to be affected at once.  To set relay channel 1 you can publish the jnior/SERIAL_NUMBER/set/digital/outputs/1/state = true.  But maybe you want channels 1 – 3 to be affected at once.  To do this you will define a named Relay Output Group, “lights”, for example.  Then, when the JNIOR receives the jnior/SERIAL_NUMBER/set/digital/outputs/lights/state topic all defined relays will change at once.

Enhance the MQTT implementation!

You can enhance the MQTT implementation on the JNIOR with a custom application.  Any topic that the JNIOR receives that is not part of our native implementation will be posted to the message pump for the consumption by another application.  A custom application may also put topics with payload data to the message pump to be published by the MQTT application.  This way the MQTT application performs the protocol logic while the custom application can worry about the logic.