You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Overview

The MQTT Sparkplug B specification defines a way for subscribing clients (like MQTT Engine) to notify publishing clients (like MQTT Transmission Module) 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 main application such as a SCADA system could trigger the devices to stop transmitting any data as the main application is not available to receive the published data.

 When the server determines a disconnect between itself and the main application, it will published a retained message to all connected clients stating that the main application is offline. When the Edge Node is notified that the Main application has gone offline, the Edge Node will close its connection with the server and it will lock to the next one on the list. If there's no next on the list, it may have the ability to store that data locally in a buffer. That way, when it reconnects, the stored data can be delivered to its final destination.

The primary host ID is used for state notifications which are used to notify the Edge Node if the primary application goes offline.

If that primary host ID is not set, the Edge Node will not subscribe on these notification topics and will not receive any of these state notifications. In this case, data will only be buffered where it loses connection to the MQTT server not if the main application loses connection to the MQTT server. 


MQTT Modules

For the MQTT Transmission (Edge Node) and MQTT Engine (main application) modules, the Primary Host ID is the setting used to identify the main application that is receiving the MQTT data to guarantee that we don't lose the data and ultimately deliver it to the application.

Changes to the STATE message in the Sparkplug v3.0.0 Specification

Understanding Servers and Sets

ADD PHID per SETS

MQTT Engine

When configured, MQTT Engine will publish it's connection state on a topic that contains the Primary Host ID.

MQTT Distributor or Chariot

In the event that MQTT Engine becomes disconnected from the server, a death certificate will be published on the same topic setting the state to 'offline'.  Any connecting client that subscribes on the state topic will then be notified of the MQTT Engine state.

MQTT Transmission

When configured, MQTT Transmission will subscribe on 'state' notification topics which are published by the broker. If MQTT Transmission is notified that MQTT Engine has gone 'offline', it will close it's client connection with the MQTT server and begin to store messages locally (assuming Store and Forward is enabled) to be sent once MQTT Engine is back online.


When MQTT Transmission is notified that MQTT Engine has back 'online', it will publish all BIRTH messages along with the stored data.


If the primary host ID is not set:

  • MQTT Transmission will not subscribe on the notification topics and not receive any 'state' notifications to trigger the data storage
  • MQTT Engine tags that were set to Stale on a disconnect to the server will remain staled after a re-connect until either:
    • Data changes at the Edge which will result in a REBIRTH request from MQTT Engine
    • An MQTT Transmission refresh is performed forcing BIRTH messages to be published




  • No labels