-
Notifications
You must be signed in to change notification settings - Fork 0
04 Emulation
MQTTProbe includes a built-in Sparkplug B emulator that lets you explore the app without any external MQTT clients. It generates realistic Sparkplug B traffic with configurable nodes, devices, and metrics.
- Connect to any MQTT broker (including the optional Mosquitto broker in Docker)
- Open the Emulation panel
- Add a node with devices and metrics
- Click Start to begin publishing
Creates a fully compliant Sparkplug B node with its own MQTT connection:
- Publishes NBIRTH with all metric definitions and aliases
- Publishes DBIRTH for each device
- Continuously publishes NDATA and DDATA with generated values
- Sends NDEATH when stopped
- Includes health metrics (CPU, heap, threads, uptime, publish cycles) as node-level metrics
Publishes simple messages through the shared MQTT connection:
- Supports JSON, Plain Text, and Hex payload formats
- Uses a configurable topic template
- No MQTT connection overhead — good for testing basic pub/sub
| Setting | Description |
|---|---|
| Type |
SparkplugB or Generic
|
| Group ID | Sparkplug B group identifier |
| Node ID | Sparkplug B node identifier |
| Payload Format | (Generic only) Json, PlainText, or Hex
|
| Topic Template | (Generic only) Topic with {metric} placeholder |
| Setting | Description |
|---|---|
| Device ID | Unique device identifier within the node |
| Setting | Description |
|---|---|
| Name | Metric name |
| Value Type |
Double, Int64, or Boolean
|
| Waveform | Signal generation pattern (see below) |
| Waveform | Description | Key Settings |
|---|---|---|
| Sine | Smooth sinusoidal wave | Min, Max, Period |
| Ramp | Linear ramp between Min and Max | Min, Max, Period |
| Random Walk | Gradual random drift | Min, Max, Step Amplitude |
| Constant | Fixed value | Constant Value |
| Fixed Boolean | Always true or always false | Boolean Value |
| Toggle | Alternates true/false each cycle | — |
| Random Boolean | Random true/false | True Probability (0-1) |
The publish interval controls how often each node publishes data. The minimum interval is 50ms.
When the projected message rate exceeds 200 messages/second, a high-throughput warning is displayed. The rate is calculated based on:
- Sparkplug B: 1 (node metrics) + devices-with-metrics per tick
- Generic JSON: devices-with-metrics per tick
- Generic PlainText/Hex: individual metric count per tick
Click Add Node to create a new emulator node with default settings. You can then edit it to add devices and metrics.
You can duplicate an existing node to quickly create multiple similar emulators.
- Remove individual nodes with the delete button
- Click Remove All to clear all emulator nodes
Emulator configurations are saved to config/appsettings.json and restored when you reconnect.
The emulator automatically stops when the main MQTT client disconnects. This prevents orphaned emulation traffic.
To emulate a Sparkplug B temperature sensor:
-
Add Node: Type = SparkplugB, Group ID =
Sparkplugs, Node ID =SensorNode1 -
Add Device: Device ID =
TemperatureSensor -
Add Metric: Name =
Temperature, Value Type = Double, Waveform = Sine, Min = 60, Max = 80, Period = 10 - Start the emulator
You'll see NBIRTH, DBIRTH, and NDATA messages appear in the MQTTProbe message browser, and the Sparkplug Nodes view will show your emulated node with live temperature data.