MQTT probe
The MQTT probe connects to an MQTT broker and runs one action or a list of packet steps on it, recording every control packet with its fields and its raw bytes. VirtuProbe speaks MQTT directly, written against the specification rather than wrapped around a client library, so you can send a packet a client library would refuse and you see what the broker did with it, including the things it did that the specification does not allow.
A probe is a broker address, a session, an identity and either one action or a list of steps. One send opens the connection, sends the CONNECT, runs what the probe asks for and closes the session.

Connection
Section titled “Connection”| Field | Description |
|---|---|
| Host | The broker address |
| Port | The broker port (default: 1883, or 8883 with TLS) |
| Version | MQTT 5, 3.1.1 or 3.1 |
| TLS mode | None or TLS |
| Trust self-signed certificates | Accept a server certificate that does not verify and skip the host name check. Shown with TLS on. Lab use |
| Over WebSocket | Carry MQTT inside a WebSocket instead of a raw TCP stream |
| WebSocket path | The request path of the WebSocket (default: /mqtt) |
The TLS mode and the WebSocket switch combine into four transports: plain TCP, TLS, MQTT inside a
WebSocket and MQTT inside a WebSocket over TLS. The default port follows the TLS mode, 1883
without it and 8883 with it. It moves only off that default, so a port you typed stays put.
Identity
Section titled “Identity”The probe holds a reference to a credential in the credential store, not the secret itself. Pick an Authentication method in the session fields and a Credential in the auth fields.
| Authentication | Credential |
|---|---|
| User name and password | A Basic credential, sent in the CONNECT |
| A SCRAM mechanism | Enhanced authentication (MQTT 5 only). The CONNECT names the mechanism and the exchange runs over AUTH packets before the CONNACK |
A client certificate (scheme MTLS, mutual TLS) is made in the credential store and picked in the same Credential list. Over TLS it is the connection’s identity. It may also carry a user name and password for a broker that wants both. A user name and password credential can be made without leaving the editor with New credential.
The SCRAM mechanisms on offer are SCRAM-SHA-256, SCRAM-SHA-512 and SCRAM-SHA-1. Enhanced
authentication needs MQTT 5; the editor says so when the version is set lower.
A probe that logs on and has no credential of its own uses the project default (see when the probe names its own account).
Session
Section titled “Session”| Field | Description |
|---|---|
| Client ID | Left empty, a random identifier is used for every run. A fixed one makes the broker disconnect the client that already holds it, so set it only when you mean to take that session over |
| Keep alive (s) | The keep-alive the CONNECT asks for (default: 60) |
| Session expiry (s) | MQTT 5 Session Expiry Interval. Empty leaves the property out |
| Clean start | Start a fresh session rather than resume a stored one |
| Will Message | A Will topic, Will payload, QoS and retain. The broker publishes this if the connection drops without a DISCONNECT. Empty topic means no Will Message |
What to do
Section titled “What to do”Switch between Action and Advanced. An action is a ready-made exchange. Advanced is a list of control packets you write by hand.
Action
Section titled “Action”| Action | What it does |
|---|---|
| Connect | Connects, reads the CONNACK and disconnects |
| Read retained messages | Subscribes and collects the retained messages the broker holds. An empty filter reads everything |
| Subscribe and receive | Subscribes and waits for the given number of messages |
| Publish | Publishes one message. With QoS 1 or 2 the acknowledgement is part of the result |
| Publish and wait for the answer | Subscribes to the Response Topic (or to the topic itself), publishes and waits for the answer |
| Ping | Connects and exchanges PINGREQ for PINGRESP |
A publishing action takes a Topic, a Payload, a QoS and a Retain flag. A receiving action takes a Topic filter, how many Messages to wait for and how long to Wait (ms).
The payload is read as Text, Hex, Base64 or Sparkplug B (JSON). For Sparkplug B you write the payload as JSON, a metrics list with a name, a datatype and a value per metric. It is sent as protobuf. A missing timestamp is filled in.
On MQTT 5, a publish may carry the specification’s PUBLISH properties: Payload Format Indicator, Message Expiry Interval, Content Type, Response Topic, Correlation Data, Topic Alias and User Property.
Advanced
Section titled “Advanced”Advanced mode sends exactly the steps you list. Each step is a control packet (CONNECT, CONNACK, PUBLISH, PUBACK, PUBREC, PUBREL, PUBCOMP, SUBSCRIBE, SUBACK, UNSUBSCRIBE, UNSUBACK, PINGREQ, PINGRESP, DISCONNECT, AUTH), a WAIT that collects what arrives, or RAW bytes written as hex.
| Step | Fields |
|---|---|
| PUBLISH | Topic, QoS (0 to 3, so an illegal 3 can be sent), Retain, DUP, Payload and its encoding |
| SUBSCRIBE | Topic filters (comma separated), QoS and on MQTT 5 an Options byte for No Local, Retain As Published and Retain Handling |
| UNSUBSCRIBE | Topic filters |
| WAIT | Wait (ms) and an optional Stop after this many messages |
| RAW | Bytes (hex), sent as they are |
| The acknowledgements and DISCONNECT, AUTH | A Reason code |
Any packet also takes a Packet ID where it carries one. A Header flags override and a Remaining Length override let the packet break the fixed header on purpose, so the Remaining Length can be made to disagree with the body. On MQTT 5 any packet may carry any of the specification’s properties.
A CONNECT is sent in front of your steps unless they already open with a CONNECT or a RAW step, so a probe that means to break the CONNECT itself opens with its own. Acknowledge QoS 1 and 2 automatically completes the inbound QoS 1 and QoS 2 handshakes for you; off, the probe sends only what its steps say. Action mode always acknowledges.
Writes are held back
Section titled “Writes are held back”An MQTT broker drives devices, so a probe that changes the target is sent only when writes are enabled for the workspace in Settings > Advanced, the probe is Armed for writes and you confirm the send. In a chain there is nobody to confirm, so the first two decide. A refused probe sends nothing at all and the result says which condition was missing.
A probe counts as changing the target when it:
- publishes a message, which the devices subscribed to the topic act on,
- connects with a fixed Client ID, which disconnects the client that holds it,
- registers a Will Message, which the broker publishes if the connection drops,
- joins a shared subscription (
$share/{group}/{filter}), which takes a share of the messages from the other consumers, or - sends RAW bytes that cannot be shown to be a read. A packet type VirtuProbe does not know counts here too, because nothing says it is a read.
A step that changes the target carries a Modifies target chip. The bar above it reads Modifies target with the reasons or Read only when the probe only reads. Stop after messages and Stop after bytes bound how much one run collects.
Response
Section titled “Response”The result opens with the transport outcome when it is not OK, the duration and a CONNACK line:
the return or reason code with its name, the MQTT version, the Client ID the broker assigned and
whether a session was present. A probe the write gate refused shows a warning in place of the run
and says nothing was sent.
Messages lists the application messages the broker delivered, each with its topic, QoS, retain flag and size. A message expands to its payload, its MQTT 5 properties and, for a Sparkplug B payload, a table of its metrics with their datatypes and values. Packets lists every control packet of the run in order, each with its direction, whether it succeeded, its command and the time it arrived at. A packet expands to its decoded fields and its raw bytes. A packet the proxy answered carries a Mocked chip. A packet the broker sent against the specification carries a Rules broken count with the findings listed inside.

Extractors
Section titled “Extractors”An expression picks a received message: blank is the last one, a whole number is its position counting from 0 and anything else is a Topic Filter (wildcards included) that selects the messages whose topic it matches.
| Extractor | Returns |
|---|---|
MQTT_SUCCESS | true when the probe passed, otherwise false |
MQTT_CONNACK_CODE | The CONNACK code as a number: 0 is accepted, anything else is the broker’s refusal. Blank when no CONNACK arrived |
MQTT_SESSION_PRESENT | The Session Present flag of the CONNACK, true or false |
MQTT_REASON_CODE | The reason code of a received packet, as a number. The expression is a packet type (PUBACK, SUBACK, DISCONNECT); blank is the last received packet that carries a code. A SUBACK gives its highest code |
MQTT_SUBACK_CODES | Every code of the last SUBACK, in the order of the filters, comma separated. A code is the granted QoS, or 128 and above for a refused filter |
MQTT_MESSAGE_COUNT | How many messages arrived. Blank counts all of them, a Topic Filter counts the ones it matches |
MQTT_MESSAGE_TOPIC | The topic a received message arrived on, which tells a wildcard subscription which topic answered |
MQTT_MESSAGE_PAYLOAD | The payload of a received message as text. Blank when it is not valid UTF-8 |
MQTT_MESSAGE_PAYLOAD_HEX | The payload of a received message as hex |
MQTT_MESSAGE_PROPERTY | One MQTT 5 property of the last message by its specification name (Content Type, Response Topic), or user:KEY for a User Property |
MQTT_SERVER_PROPERTY | One property the broker announced in its CONNACK (Maximum QoS, Retain Available, Assigned Client Identifier), by its specification name |
MQTT_SPARKPLUG_METRIC | The value of a Sparkplug B metric by name. The newest message that carries it wins, so after a birth and some data messages this is the current value |
Chains
Section titled “Chains”MQTT is a chain step. {{variable}} placeholders resolve into the host, the WebSocket path, the
Client ID, the Will topic and payload, the topic and payload and every step’s topic, payload, raw
hex, filters and property values before the probe is sent. One pattern is to publish a setpoint,
subscribe and read it back with MQTT_MESSAGE_PAYLOAD and assert on the value. Another is HTTP then
MQTT: change something through the system’s own API, then subscribe to the topic it is supposed to
drive.
A probe that changes the target has to be armed to run in a chain. Unarmed, the chain step fails and nothing is sent.
The proxy and mock rules
Section titled “The proxy and mock rules”MQTT is interceptable behind the proxy’s SOCKS5 front door. MQTT is client-first. The proxy claims a flow by the start of its CONNECT, so it cannot take another protocol’s connection.
A mock rule for MQTT matches on the host and on a command, a case-insensitive prefix of the
packet’s type followed by what it addresses: CONNECT, PUBLISH plant/line1/state, SUBSCRIBE plant/#. It answers with a reason or return code written as a number (0x87, 135, 5). The
mock answers the control packets a session needs, so a client talking to it does not hang: a
CONNECT gets a CONNACK, a SUBSCRIBE a SUBACK, a PUBLISH above QoS 0 its acknowledgement, an
UNSUBSCRIBE its UNSUBACK, a PINGREQ a PINGRESP and the third leg of a QoS 2 flow its PUBCOMP. A
QoS 0 PUBLISH has nothing to acknowledge, so it is dropped, which is what a broker losing it would
look like.
A mock may also carry a SCRAM verifier (the mechanism, the salt, the iteration count, the StoredKey and the ServerKey a real server stores) so it stands in as an enhanced-authentication broker: it answers the challenge, checks the client proof and signs the server-final, so a SCRAM-auth probe completes a clean connection against the mock. The verifier cannot be reversed to the password, so it is safe in the rule.
What the proxy can read depends on the transport. Plain TCP is decoded packet by packet. Under TLS the bytes are encrypted, so the proxy relays them without decoding. MQTT inside a WebSocket opens with an HTTP upgrade and is read as HTTP.
Local servers to test against
Section titled “Local servers to test against”virtuprobe-docker ships two brokers from two independent implementations. Two brokers that accept
the same hand-written packets are better evidence than one.
cd virtuprobe-docker/all-protocols && docker compose up --build -d mqtt sparkplug-node mqtt-emqxMosquitto (mqtt-simple) has six listeners, one for every way into a broker:
| Listener | Address | Authentication |
|---|---|---|
| MQTT | localhost:1883 | user name and password |
| MQTT, anonymous | localhost:1884 | none |
| MQTT over TLS | localhost:8883 | user name and password |
| MQTT over mutual TLS | localhost:8884 | client certificate, its CN is the user name |
| MQTT over WebSocket | ws://localhost:9001 | user name and password |
| MQTT over WebSocket over TLS | wss://localhost:9002 | user name and password |
User vptest / Password123! may read and write everything; readonly / Password123! may read
everything and write nothing, so a publish as readonly is refused. It seeds retained messages
under plant/# and public/. A Sparkplug B edge node publishes births and a data message
every two seconds under spBv1.0/VirtuProbe/.... The data messages carry aliases only, so a
subscriber that missed the births sees no metric names until it sends a rebirth command.
EMQX (mqtt-emqx) runs beside it on its own ports (2883, 9883, WebSocket 9083 and 9084
on path /mqtt) and is the one that implements MQTT 5 enhanced authentication: user scramuser /
Password123! with SCRAM-SHA-256. It has the same vptest and readonly users, no anonymous
access, with topic aliases and shared subscriptions on.
Both brokers accept MQTT 3.1, 3.1.1 and 5. The TLS material and the exact seed are in each target’s
README.md.
What the probe does not cover
Section titled “What the probe does not cover”- MQTT over QUIC. The transport is TCP, TLS or WebSocket.
- Running as a broker or a bridge. The probe is a client.
- Reading a payload beyond text, hex, Base64 and Sparkplug B. Anything else is kept as raw
bytes, which
MQTT_MESSAGE_PAYLOAD_HEXreturns.
Writing a probe file by hand
Section titled “Writing a probe file by hand”A probe file written by hand or over MCP is shaped like this.
- The broker is
host,port,tlsMode(NONEorTLS),webSocketandprotocolVersion(5,3.1.1,3.1).authMethodis blank for a user name and password or a SCRAM mechanism for enhanced authentication.authCredentialIdnames a credential in the store. modeisACTIONorADVANCED. An action namesactionType(PUBLISH,SUBSCRIBE_RECEIVE,READ_RETAINED,PUBLISH_RECEIVE,PING,CONNECT_CHECK) withtopic,payload,qosand the rest beside it.- An advanced step is a
typeand the fields that type uses.{"type": "SUBSCRIBE", "filters": ["plant/#"], "qos": 1}is a whole subscribe.{"type": "WAIT", "waitMs": 2000, "messageCount": 3}collects three messages. - A probe that changes the target needs
armedset totrue, or the write gate refuses it and nothing is sent.