Publish Sparkplug B NBIRTH and NDATA messages from an Edge Node with correct QoS levels

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

Steps

  1. On connect, configure the MQTT Last Will and Testament as an NDEATH payload on the topic spBv1.0/GROUP_ID/NDEATH/EDGE_NODE_ID with QoS 1 and the retained flag set appropriately per the spec.
  2. Immediately after a successful MQTT CONNECT, publish an NBIRTH message to spBv1.0/GROUP_ID/NBIRTH/EDGE_NODE_ID using QoS 0, containing all metric definitions with full metadata (name, alias, datatype, initial value) and a sequence number starting at 0.
  3. For each connected device, publish a DBIRTH to spBv1.0/GROUP_ID/DBIRTH/EDGE_NODE_ID/DEVICE_ID at QoS 0 with that device's full metric catalog.
  4. Publish operational telemetry as NDATA or DDATA messages at QoS 0, including only changed metrics plus the incremented sequence number (0-255, wrapping).
  5. Use metric aliases (integer handles) in DATA messages instead of full string names to reduce payload size; aliases must be established in the BIRTH message.
  6. The Primary Host Application publishes its STATE messages (online/offline) to spBv1.0/STATE/HOST_APP_ID at QoS 1 — this is the only message type requiring QoS 1 for a host.

Known gotchas

Related routes

Structure Sparkplug B MQTT topics and publish birth/death certificate messages for edge nodes and devices
sparkplug.eclipse.org · 6 steps · unrated
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
Bridge OPC UA node data to cloud MQTT using a gateway with Sparkplug B encoding
opcua-mqtt-gateway · 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