Enhancing MQTT Sparkplug B for Industrial IoT

Nov. 1, 2022
Automation engineers and integrators who recognize the value of a smart MQTT broker will be in a good position to meet those demands and to develop increasingly sophisticated industrial IoT scenarios.

One of the most popular industrial IoT (IIoT) protocols for data communications is MQTT. Originally developed for the oil and gas sector, it is efficient, quick, and secure, making it ideal for connecting field devices to a central SCADA system and passing data between them. With the advent of IIoT and Industrie 4.0, many automation professionals have turned to MQTT as a useful protocol for connecting devices to the cloud. But MQTT has its drawbacks. For example, it does not have a standardized data format to define how data is sent and received, causing interoperability issues.

To address this problem, Sparkplug B was created. Sparkplug B provides a topic namespace, state management, and payload definition for MQTT. It classifies MQTT clients as either edge of network (EoN) devices that produce data, or as applications that consume data. Each Sparkplug B device produces messages of various kinds, like a “birth” message to show it has come online, “data” messages for sending data, and a “death” message when it goes offline. Any Sparkplug B application that is online receives these messages and is kept informed of which data is coming from which device.

A smart MQTT broker for Sparkplug B
The Sparkplug B specification makes MQTT a better choice for a range of IIoT applications. And yet even more can be done by enabling an MQTT broker to parse messages. By design, MQTT is a transport protocol. The broker that connects the clients acts like a postal service, passing along letters but not knowing the contents. An MQTT broker that can parse and act on the content of the messages as they stream through becomes a smart broker. A smart MQTT broker that also supports Sparkplug B provides some unique capabilities beyond what a normal Sparkplug B broker can offer.

For example, it can:

Synchronize all applications. Because it is aware of all connections, a smart broker can synthesize a “birth” (startup) message for each connected device whenever a new application comes online. This allows that application to receive “data” messages from all currently connected devices, eliminating issues related to start-up order.

Respond to errors. In addition to its ability to identify out-of-order or lost MQTT messages, a smart broker can also automatically disconnect a Sparkplug B device when these kinds of errors occur and allow it to reconnect. This causes the device to re-send its “birth” message, which resynchronizes all receiving applications, thus maintaining a single version of the truth.

Resolve failed writes to devices. Another useful feature is the ability to check all write requests from applications to devices, to ensure the specified data value was written on the device. If the smart broker detects that the value on the device did not change, it forces the device to disconnect, causing it to retransmit its “birth” message. This resynchronizes all applications listening to that device and is another way to maintain a single version of the truth.

Add data quality information. For systems that need to convert Sparkplug B data to other protocols, a smart broker can add quality information. For example, when converting Sparkplug B data to OPC, it adds OPC data quality. “Birth” or “data” messages are assigned the OPC data quality of Good, while “death” (shutdown) messages can take a Not Connected quality.

Companies in this Article

Sponsored Recommendations

Understanding and Using E-Stops

E-stops, or emergency stop switches, are used to ensure machine as well as personnel safety. They are used to provide a consistent and predictable failsafe response on a wide ...

Demystifying motor disconnect switches: What are they and how are they used?

From conveyor belts to drum mixers, motors are used in virtually every industrial application to drive machinery. Equipment downtime is the main motivation behind monitoring and...

Full Line of DIN Rail Terminal Blocks Video

Altech offers an extensive line of DIN Rail Terminal Blocks including all major Connection Technologies available in the industry to meet requirements for a vast variety of applications...

The Value of Integrating DIN Rail Cylindrical Fuse Holders Into Your Designs

What short circuit currents do I have to consider when purchasing a DIN rail cylindrical fuse holder? That data is available from the manufacturer. For example, Altech cylindrical...