Implement Sparkplug B SCADA Host Application state management and rebirth requests

domain: sparkplug · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. The Primary Host Application connects to the MQTT broker and publishes its STATE message to spBv1.0/STATE/HOST_APP_ID with payload 'ONLINE' at QoS 1 with retained flag true; also configure the LWT to publish 'OFFLINE' on unexpected disconnect at QoS 1.
  2. Subscribe to all NBIRTH, DBIRTH, NDATA, DDATA, NDEATH, and DDEATH topics using wildcard spBv1.0/#; process BIRTH messages to build the internal metric catalog keyed by Edge Node and device IDs.
  3. Track the sequence number in each NDATA/DDATA message; if a gap is detected (missing sequence number), send a node rebirth command by publishing to spBv1.0/GROUP_ID/NCMD/EDGE_NODE_ID with a Rebirth metric set to true.
  4. On receiving an NBIRTH after a rebirth request, clear the stale metric catalog for that Edge Node and rebuild it from the fresh BIRTH payload.
  5. Handle NDEATH messages by marking all metrics for that Edge Node as stale until a new NBIRTH is received; DDEATH marks only the specific device's metrics as stale.
  6. Implement bdSeq tracking: the NBIRTH includes a bdSeq metric matching the LWT NDEATH's bdSeq; use this to correlate unexpected disconnects with subsequent reconnects.

Known gotchas

Related routes

Publish a Sparkplug B host application STATE message so edge nodes can detect when the SCADA/host application goes offline
sparkplug.eclipse.org · 5 steps · unrated
Publish Sparkplug B NBIRTH and NDATA messages from an Edge Node with correct QoS levels
sparkplug · 6 steps · unrated
Design MQTT topics and message flow for industrial telemetry using the Sparkplug B specification
sparkplug.eclipse.org · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans