What is the Primary Host ID functionality of the MQTT Sparkplug Spec?

Feb 10, 2020 11:26:57 AM / by Josh Wolf

Following a meeting with an end user and a question regarding MQTT Primary Host ID, I decided to write up a brief summary on the Sparkplug B Primary Host ID.

The MQTT Sparkplug B specification defines a way for subscribing clients (like our Canary Collector) to notify publishing clients (Cirrus Link's Ignition Transmission Module or PLCs) when they are online or offline. The publishing clients can then key off of a particular subscriber’s status to do different things when the subscriber’s status changes either online or offline.

One example would be that the disconnection of a SCADA system could trigger the devices to stop transmitting any data as there may not be a need for any data to be published if the SCADA system is not online.

Cirrus Link's MQTT Transmission Module for Ignition keys off of a Primary Host ID to enable the store and forward of tag changes within the module. Our Canary Collector can be enabled to take advantage of this functionality utilizing two configuration settings in the Canary MQTT Collector database.

The first is the MQTTClientId field. This field is used to identify the Canary Collector within the MQTT broker. The second is the IsPrimaryApplication setting. The Cirrus Link Transmission Module for Ignition is then configured to look for the ‘Canary’ Primary Host ID. If this setting is true, the Canary Collector will identify itself as the primary SCADA application in the MQTT broker and when the Canary Collector is shutdown or becomes disconnected from the broker, the MQTT Transmission Module will detect the offline state of the collector and begin to store data changes.

Then when the Canary Collector reconnects to the broker, the Transmission Module will flush the tag changes to the Canary Collector.

This feature is currently being used at several large upstream oil and gas companies to prevent data loss if the MQTT Collector is shut down.

Topics: industry 4.0, Canary Collectors

Josh Wolf

Written by Josh Wolf