MQTT Transmission module

Hi, I am working on a MQTT application using the MQTT modules (Engine and Transmission) What I do is basically read some data from Node-Red, I read this data on Ignition, and then I publish it back to Node-Red. I have solved the communication stuff, I can read and write, the thing is that I need to receive periodically the data on Node-Red. What I have investigated is that MQTT Transmission module uses the Sparkplug B protocol, which doesnt publish data periodically, it uses messages types like DBIRTH, DDATA and DDEATH. On DDATA it publishes just the variable that have changed, and in the other 2 it publishes ALL the data when the connection is started or ended.

Is there a way of publishing ALL the data periodically? I need this because sometimes I lost data when I only listen to the DDATA messages. Or even if I can retain the values on the topics, that also will be great.

That's not how Sparkplug works. For Sparkplug there's a primary host ID that the listener/subscriber of the primary server publishes to that tells the transmission side that it's online and ready to receive data. It's up to the engine side to get the birth message from transmission and record all the initial values and just changes from then on. I'd have to look it up again but I believe there's a 3rd party module named HydraMQTT or something like that on Github that will do vanilla MQTT. Not sure though if it publishes data on a periodic basis or only on change though.

1 Like

Hydra MQTT is very buggy and doesn't support any authentication or encryption, I am in the middle of working on a vanilla MQTT Client with both encryption and authentication.

1 Like

I don't understand why CirrusLink hasn't implemented this yet. I would think it would be easier than Sparkplug B and would make the module more compatible with other systems that don't support SpB yet.

1 Like

I guess I will need to get the initial values on the DBIRTH message and then listen to the DDATA for every change then.

If you're using MQTT Engine, this is fine automatically for you. Does Node-Red have a Sparkplug compatible MQTT module?

Node-RED does have a Sparkplug node. I spun it up a while back and was able to get it working quite nicely.

You might find the relatively new UNS Transmitters functionality of MQTT Transmission handy for publishing to non-SpB aware entities. It publishes on-change in a more user-friendly JSON format across a hierarchical topic namespace.

2 Likes