MQTT Sparkplug B
Beta
Overview
Section titled “Overview”Reads Eclipse Sparkplug B edge nodes over MQTT, for example Inductive Automation Ignition with MQTT Transmission publishing through the MQTT Distributor. The payload is binary (Protobuf), and every edge node announces its metric list, with names, data types and aliases, in its BIRTH messages. CONNECT reads the metrics as ordinary signals, so they can drive the model like any other PLC output.
Sparkplug B is a fourth topic mode of the MQTT interface. One MQTT interface can hold Sparkplug B groups next to single, process image and JSON topics.
What CONNECT does
Section titled “What CONNECT does”- One session per edge node. CONNECT keeps the state of every edge node it hears: the metric aliases and data types from the last BIRTH, the
bdSeqof the current session, the message sequence number and whether the node and each of its devices is online. - BIRTH sets the context. An NBIRTH replaces the whole context of the edge node, including all of its devices; a DBIRTH replaces the context of one device. The values in a BIRTH are written to the bound signals right away.
- DATA by name or alias. NDATA and DDATA messages are matched by metric name, or by alias when the edge node sends aliases only (Ignition does this after the BIRTH).
- DEATH marks signals offline. An NDEATH is accepted only when its
bdSeqmatches the current BIRTH session; an older NDEATH is ignored. After NDEATH or DDEATH the affected signals keep their last value and show an offline issue until the next BIRTH. - Passive participant. CONNECT publishes no STATE message, sets no last will and never acts as Primary Host, so Ignition’s Primary Host handling and Store and Forward stay as they are. STATE messages of other hosts are ignored.
- Historical values are not process values. Metrics flagged
is_historical(Store and Forward backlog) are not written to the signal. A metric flaggedis_nullkeeps the last value and shows an issue until a valid value arrives. - The metric context survives a reconnect. CONNECT keeps the BIRTH context while it runs, also when the interface restarts after you bind new signals or when the broker connection drops. After a restart of CONNECT itself, it needs a new BIRTH (see Allow rebirth).
Set it up
Section titled “Set it up”
-
Add the catalog row Ignition Sparkplug B (MQTT) in Add Interface, or use an existing MQTT interface. The row sets Protocol version to
3.1.1, which the Ignition MQTT Distributor requires. Enter the broker URL and, if needed, username and password as for any MQTT interface. -
In the signal list of the interface, open ⋮ → Add Sparkplug B group… and enter the Group ID. Leave Edge Node ID empty to read every edge node of the group, or enter one to read only that node. CONNECT derives the topic itself, for example
spBv1.0/Plant/+/+/#; it is shown in the dialog and cannot be edited. -
Optionally tick Allow rebirth (see below) and save.

-
Press Browse. CONNECT listens for BIRTH messages for up to 20 seconds and lists every metric as a tree of group, edge node, device and metric, with its data type and current value. Pick the metrics you need and add them. They land in the Sparkplug B group, named
<Device>_<Metric>(or<EdgeNode>_<Metric>for node metrics); a name that is already taken gets a suffix.


If no BIRTH arrives in that time, Browse says so in a hint line above the list. Without a BIRTH it still lists the metric names it saw in DATA messages, with guessed data types. Enable Allow rebirth or reconnect the edge node in Ignition, then browse again.
Group ID and Edge Node ID
Section titled “Group ID and Edge Node ID”| Field | Rule |
|---|---|
| Group ID | required; must not contain /, + or # |
| Edge Node ID | optional, empty = every edge node of the group; must not contain /, + or # |
| Allow rebirth | off by default |
| Rebirth interval | 5 to 3600 s, default 30 s |
Two Sparkplug B groups on one interface must not overlap: the same group with an empty Edge Node ID and with a concrete one, or the same group and edge node twice, is refused with sparkplug-overlap. Use one group container per group, or distinct concrete edge nodes.
Addresses
Section titled “Addresses”The address of a Sparkplug B signal is the metric key <GroupId>/<EdgeNodeId>/<DeviceId>/<Metric>; for a node metric without a device the device part is -. Browse fills it in; you rarely type it. The metric key includes the group, so the same edge node, device and metric names in two groups stay separate signals.
One metric can be bound to one signal per group container. Binding the same metric again under another name is refused with address-already-bound; rename the existing signal instead.
Direction and data types
Section titled “Direction and data types”Sparkplug B signals are PLC outputs only. A PLC input in a Sparkplug B group is refused with sparkplug-read-only, both when you save the configuration and when you bind from Browse.
The signal’s configured type always wins. Browse suggests a type from the Sparkplug data type; when you bind to a model signal that already has a type, the value is converted:
| Sparkplug type | Suggested signal type | Conversion |
|---|---|---|
| Int8, Int16, Int32, UInt8, UInt16 | Int | into a Float signal as a number |
| UInt32, Int64, UInt64 | Int if the value fits Int32, else Float | a large integer in a Float signal raises a one-time precision issue |
| Float, Double | Float | into an Int signal rounded (half away from zero) |
| Boolean | Bool | a number into a Bool signal: not 0 = true; a Bool into a number signal: 1 or 0 |
| String, Text, UUID, DateTime | String | text goes only into text signals; any value can go into a text signal |
| DataSet, Template, Bytes, File | not offered | unsupported metric type issue |
A value that does not fit the signal (overflow, NaN or infinity, text into a number) is dropped and reported as value not representable.
Allow rebirth
Section titled “Allow rebirth”BIRTH messages are not retained on the broker, so CONNECT learns the metric list only when an edge node starts or reconnects. With Allow rebirth ticked (in the Add Sparkplug B group dialog, or later in the topic settings of the group), CONNECT sends the Sparkplug Rebirth command to an edge node whose context it does not know, and the node republishes its BIRTH:
- after connecting, when no BIRTH arrived within 5 seconds;
- when a DATA message carries an alias CONNECT does not know;
- when the message sequence (
seq, 0 to 255) has a gap, which means messages were lost; - when you press Browse.
The command is the standard NCMD spBv1.0/<GroupId>/NCMD/<EdgeNodeId> with the metric Node Control/Rebirth = true, sent with QoS 0 and without the retain flag. It goes only to concrete edge nodes CONNECT knows (configured, bound or seen on the broker), and at most once per edge node within the Rebirth interval.
Without this permission CONNECT only listens. After a CONNECT restart its signals show waiting for BIRTH until the edge node reconnects or republishes its BIRTH.
Ignition settings
Section titled “Ignition settings”- MQTT 3.1.1 on the CONNECT interface. The Ignition MQTT Distributor refuses MQTT 5.0; the catalog row sets 3.1.1.
- Convert UDTs on in MQTT Transmission (the Ignition default). UDT instances are then published as flat metrics, which CONNECT reads. Template and DataSet metrics are not read yet; they are reported and skipped.
- Primary Host and Store and Forward need no change; CONNECT is not a Primary Host.
- The user CONNECT logs in with needs subscribe rights on
spBv1.0/<GroupId>/#, and publish rights onspBv1.0/<GroupId>/NCMD/#only if you allow rebirth.
Status and issues
Section titled “Status and issues”Problems appear as signal issues on the interface card. Each one is raised once when it starts and cleared when it is gone:
| Issue | Meaning |
|---|---|
| waiting for BIRTH | no BIRTH context for this edge node or device yet |
| offline | the edge node or device sent NDEATH or DDEATH; the last value is kept |
| seq gap | messages from the edge node were lost; values resync with the next BIRTH |
| unknown alias | DATA used an alias without a known BIRTH |
| payload error | a message was not a valid Sparkplug B payload and was skipped |
| NDEATH without bdSeq | the death message could not be matched to a session and was ignored |
| metric null / unsupported metric type / value not representable / precision | see Direction and data types |
The interface status (GET /status of CONNECT) lists the Sparkplug B edge nodes with online state, last BIRTH, sequence gaps and rebirths sent. Interfaces without a Sparkplug B group report exactly as before.
Not supported yet
Section titled “Not supported yet”- Writing to an edge node (NCMD/DCMD for metrics other than Rebirth).
- Template, DataSet, Bytes and File metrics.
- Acting as Sparkplug Primary Host (STATE).
- Sparkplug B in the browser’s own MQTT adapter (Direct mode); Sparkplug B runs in CONNECT only.
See also
Section titled “See also”- MQTT for broker settings and the other topic modes
- Configuring interfaces for adding signals, direction and write access
- Common concepts
- All supported interfaces