You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A realistic Sparkplug B edge node simulator that models a CNC machining centre.
Publishes NBIRTH / NDATA / NDEATH to any MQTT broker and responds to NCMD
rebirth commands from host applications or spmon.
# Connect to local broker with defaults (group=tedge, node=sim-cnc01, interval=5s)
./spdevice
# Custom broker and faster publishing
./spdevice --broker 192.168.1.10:1883 --interval 1s
# Different group / node ID (must match your flow.toml or host application config)
./spdevice --group factory1 --node cnc-line-a --interval 2s
Flags
Flag
Default
Description
--broker
localhost:1883
MQTT broker host:port
--group
tedge
Sparkplug B Group ID
--node
sim-cnc01
Sparkplug B Edge Node ID
--interval
5s
Minimum publish interval — use 1s, 500ms, etc.
Keybindings
Key
Action
p
Pause / resume simulation and publishing
r
Send NBIRTH immediately (re-declare all metrics with aliases)
q
Publish NDEATH then quit
Simulated metrics
Metric
Type
Range
Alarm threshold
spindle.speed.rpm
Double
0 – 12 000 rpm
spindle.load.pct
Double
0 – 100 %
warn > 90 %
spindle.temperature.celsius
Double
20 – 90 °C
alarm > 83 °C
feed.rate.mm_per_min
Double
0 – 1 000
axis.{x,y,z}.position.mm
Double
0 – 500 mm
coolant.temperature.celsius
Double
20 – 35 °C
warn > 34 °C
coolant.flow.litres_per_min
Double
0 – 12 L/min
alarm < 2.0 L/min
hydraulic.pressure.bar
Double
130 – 165 bar
alarm > 157 bar
power.kw
Double
0 – 8 kW
program.cycle_count
Int64
incrementing
program.part_count
Int64
incrementing
door.open
Boolean
estop.active
Boolean
Alarm/*/Active
Boolean
true / false
Alarm/*/Text
String
Machine states
IDLE → WARMUP → RUNNING → COOLDOWN → IDLE
↕ any state → FAULT → IDLE
IDLE: Spindle stopped, axes parked, low power draw. WARMUP: Spindle ramping up slowly, coolant flow increasing. RUNNING: Full machining — spindle at target speed, axes executing path, all coolant and hydraulics active. COOLDOWN: Spindle decelerating, door briefly opens for part removal, tool change on next cycle start. FAULT: E-stop triggered (rare random event or thermal runaway), all motion stops.
About
Sparkplug B device to use for demos where a device is required to decode Sparkplug B messages