Sparkplug B is a specification for MQTT in industrial environments. It defines how edge nodes announce themselves, how they report data, and how they handle disconnection.
CollatrEdge implements the full edge node lifecycle. Birth certificates on connection. Death certificates (via MQTT Last Will) on disconnection. Periodic heartbeats with self-monitoring metrics.
The Sparkplug B codec maps CollatrEdge metric types to Sparkplug types. Metric aliases for bandwidth reduction on constrained networks. Payload encoding with protocol buffers.
The hub link session manager handles the state machine: offline, connecting, online, disconnecting. Graceful “going standalone” messages before cutting the connection. Automatic rebirth after broker reconnection.
I extracted a shared MQTT client wrapper first. The MQTT consumer (input) and MQTT output now share connection logic. One set of reconnection behaviour. One set of tests.
This is how CollatrEdge talks to the Collatr Hub. But it is also how it talks to any Sparkplug B-aware system. The protocol is open. The agent is not locked in.