MQTT Client and Sparkplug B Basic & Scale
ConnectMQ Edge brings MQTT data from your plant network to ConnectMQ in two ways: the MQTT Client connector subscribes to a broker in your network and turns message fields into tags, and the local MQTT broker of Edge accepts Sparkplug B nodes such as Ignition and Node-RED and forwards their messages to the cloud, where they are decoded into ISA-95 JSON.
Which one to use
| Your situation | Use |
|---|---|
| Devices already publish to a broker in your network (for example Mosquitto or a gateway's built-in broker), and you want individual values as tags | MQTT Client connector |
| You want to pass those messages to the cloud unchanged | MQTT Client connector with "Forward": true |
| Ignition MQTT Transmission, Node-RED or other Sparkplug B edge nodes | Sparkplug B through the local broker |
| Devices that can publish to Edge directly | Point them at the Edge local broker (mqtt:// Edge PC :1883), see Local OPC UA server and MQTT broker |
MQTT Client connector
The MQTT Client connector connects to one broker per channel, subscribes to topics, extracts tag values from the payloads and publishes them to your ConnectMQ broker on ISA-95 topics.
| Concept | MQTT meaning | Limit |
|---|---|---|
| Channel | One broker connection | max 60 channels |
| Device | A "topic device": one or more topic filters | max 1024 devices per channel |
| Tag | Topic filter (Address) + payload parser (Settings) |
Limits are per driver, not per project. How many values you can send to the cloud depends on your plan: see Plans & broker limits and pricing.
Prepare
- Note the address of the broker in your network (for example
192.168.1.20:1883) and a user name and password if it needs one. - Find out which topics your devices publish and what the payload looks like, for example with MQTT Explorer or
mosquitto_sub -h 192.168.1.20 -t "#" -v. - TLS brokers (port 8883): if the broker certificate is not from a public CA, copy its CA certificate to
%ProgramData%\ConnectMQ\Edge. - Do not point this connector at the Edge's own local broker; local devices can publish there directly.
Add the connector in ConnectMQ Edge
Add a channel from the template
In the ConnectMQ Edge desktop app open Connectors in the left menu, click + Add channel and pick the MQTT Client template. The channel is added with sample topics.
Enter the broker
Set Host, Port, Username and Password. For TLS set "UseTls": true and, if needed, CaCertificateFile.
Add topic devices
Each device subscribes to its Topics (wildcards + and # are allowed). Set WatchdogSeconds to mark the device offline when nothing arrives for that long.
Add your tags
Each tag has a topic (Address) and a parser: Format and Path, for example JSON path data.temp. To discover what arrives, set "AutoCreateTags": true on the device instead.
Validate and save
Click Validate project, then press Save and apply. The channel starts right away without restarting the service.
Check the values
On Overview the devices show Reading data under Field devices; problems such as a rejected login appear in the Last problem column. Live values are on Local OPC UA Server › Live tag values, details in Windows Service Settings › Logs.
Channel settings
| Setting | Default | Description |
|---|---|---|
Host / Port | localhost / 1883 | Broker address |
Transport | Tcp | Tcp or WebSocket |
WebSocketPath | /mqtt | WebSocket path (ws://, or wss:// with TLS) |
UseTls | false | Use TLS |
AllowUntrustedCertificates | false | Do not validate the server certificate (tests only) |
CaCertificateFile | — | CA file (PEM/DER) to validate the broker certificate |
ClientCertificateFile / ClientCertificatePassword | — | PFX/P12 client certificate for mutual TLS |
ClientId | connectmq-edge- + PC name + channel | MQTT client ID |
Username / Password | — | Credentials |
ProtocolVersion | 3.1.1 | 3.1.1 or 5 |
KeepAliveSeconds | 30 | Keep-alive |
CleanSession | true | Clean session |
ConnectTimeoutMs | 10000 | Connection timeout |
ReconnectMinMs / ReconnectMaxMs | 1000 / 30000 | Reconnect wait range (exponential) |
Relative file paths are resolved under %ProgramData%\ConnectMQ\Edge.
Device settings
| Setting | Default | Description |
|---|---|---|
Topics | [] | Topic filters to subscribe to (+ and # allowed) |
Qos | 1 | Subscription QoS |
DefaultFormat | Json | Default payload format of the tags |
AutoCreateTags | false | Discovery: create tags for messages no tag matches |
AutoCreateMode | Topic | Topic: one tag per topic. JsonLeaves: one tag per JSON leaf |
AutoCreateLimit | 1000 | Max auto-created tags per device |
WatchdogSeconds | 0 | If no message arrives in this time, the tags become stale and the device offline; the next message brings it back online |
Forward | false | Bridge mode: pass the raw message unchanged to the ConnectMQ broker |
ForwardStripPrefix | — | Prefix removed from the source topic when forwarding |
ForwardPrefix | — | Prefix added when forwarding |
WriteSuffix | empty | Default write topic = source topic + this suffix (for example /set) |
A forwarded message is published on: device ISA-95 topic / ForwardPrefix / source topic without ForwardStripPrefix. Publish filters on the Topics page apply to these topics too.
Tag parsers
The tag Address is a topic filter; if empty, the device's Topics are used. The tag Settings:
| Setting | Description |
|---|---|
Format | Json, Xml, Csv, KeyValue, Text, Binary, Regex (empty = the device's DefaultFormat) |
Path | Path for the format, see below |
TimestampPath | Timestamp field in the same format: ISO-8601 text or Unix epoch (s or ms) |
Delimiter, HasHeader | CSV delimiter (default ,, \t supported) and header row |
PairSeparator, KeyValueSeparator | Key-value separators (default ; and =; a line break also separates pairs) |
Group | Regex group number or name (default: group 1 if there is one, otherwise the whole match) |
ByteOrder | Binary byte order: ABCD (big endian), DCBA (little endian), BADC, CDAB |
| Format | Path examples |
|---|---|
| Json | sensor.temp, $.values[0].v, ['key.with.dots']; empty or $ = the whole payload |
| Xml | XPath: /m/v, /m/v/@id, number(/m/v) |
| Csv | Column index (2, zero-based) or, with HasHeader, the header name (temp). The last line is the data line |
| KeyValue | Key name: temp (payload temp=21.5;hum=40) |
| Text | No path, the whole payload |
| Binary | float32@4, int16@0, uint32@2, float64@8, bool@3.5 (byte.bit), string@0:10 |
| Regex | Pattern U=([\d.]+)V, or a named group I=(?<cur>[\d.]+)A with Group cur |
If DataType is set the value is converted to it; with Auto, numbers and booleans in text are detected automatically.
Example
Sensors of line 1 publish to a Mosquitto broker at 192.168.1.20. The project's ISA-95 levels are connectmq / site1 / production, and the device sets Line: line1 and Cell: sensors.
| Name | Topic | Format / path | DataType | Unit |
|---|---|---|---|---|
Temperature | plant/line1/sensor1 | Json data.temp, time from ts | Float64 | °C |
Humidity | plant/line1/kv | KeyValue hum | % | |
Speed | plant/line1/raw | Binary float32@4, CDAB | Float32 | |
Setpoint | plant/line1/sp | Text, writable to plant/line1/sp/set |
{
"Name": "SiteBroker",
"Driver": "MqttClient",
"Settings": { "Host": "192.168.1.20", "Port": 1883, "Username": "edge", "Password": "***" },
"Devices": [
{
"Name": "Line1Sensors",
"Isa95": { "Line": "line1", "Cell": "sensors" },
"Settings": { "Topics": [ "plant/line1/#" ], "WatchdogSeconds": 30 },
"Tags": [
{ "Name": "Temperature", "Address": "plant/line1/sensor1", "DataType": "Float64", "Unit": "°C",
"Settings": { "Format": "Json", "Path": "data.temp", "TimestampPath": "ts" } },
{ "Name": "Humidity", "Address": "plant/line1/kv", "Unit": "%",
"Settings": { "Format": "KeyValue", "Path": "hum" } },
{ "Name": "Speed", "Address": "plant/line1/raw", "DataType": "Float32",
"Settings": { "Format": "Binary", "Path": "float32@4", "ByteOrder": "CDAB" } },
{ "Name": "Setpoint", "Address": "plant/line1/sp", "Writable": true,
"Settings": { "Format": "Text", "WriteTopic": "plant/line1/sp/set", "WriteFormat": "Json" } }
]
},
{
"Name": "Discovery",
"Settings": { "Topics": [ "gateway/+/telemetry" ], "AutoCreateTags": true, "AutoCreateMode": "JsonLeaves",
"Forward": true, "ForwardStripPrefix": "gateway/" }
}
]
}When plant/line1/sensor1 receives {"data": {"temp": 21.7}, "ts": "2026-10-21T14:29:00.123Z"}, the Temperature tag arrives in ConnectMQ on the topic:
connectmq/site1/production/line1/sensors/Line1Sensors/Temperaturewith this payload:
{
"timestamp": "2026-10-21T14:29:00.123Z",
"value": 21.7,
"quality": "good",
"unit": "°C",
"dataType": "Float64",
"tag": "Temperature",
"device": "Line1Sensors",
"channel": "SiteBroker"
}See Topics and payloads for the topic rules and quality values.
Write values
Tags with "Writable": true are published to the local broker with these tag settings:
| Setting | Default | Description |
|---|---|---|
WriteTopic | source topic + WriteSuffix | Required if the source topic contains wildcards |
WriteFormat | Raw | Raw (plain value), Json ({"value": …, "timestamp": …}) or Template |
WriteTemplate | {value} | Placeholders {value} and {timestamp} |
WriteRetain / WriteQos | false / 1 |
- From the cloud: turn on Allow writes from the cloud in Cloud Settings, then publish
{"value": 12.5}(or just12.5) to the tag topic plus/set, for exampleconnectmq/site1/production/line1/sensors/Line1Sensors/Setpoint/set. Edge publishes the value toplant/line1/sp/seton your broker. - Locally: write the tag from an OPC UA client on the Edge local OPC UA server.
Sparkplug B through the local broker
Sparkplug B nodes publish protobuf payloads that are hard to use outside the plant. With ConnectMQ Edge, the nodes publish to the local MQTT broker of Edge, Edge forwards the messages to your ConnectMQ broker over MQTT/TLS (and buffers them on disk while offline), and ConnectMQ Cloud decodes them and publishes a readable JSON copy on an ISA-95 topic. The nodes do not need internet access of their own.
Supported: Ignition MQTT Transmission, Node-RED and other Sparkplug B edge nodes and gateways, with protobuf or JSON payloads.
Start the local MQTT broker
In the desktop app open Windows Service Settings and make sure Start with the service › Start the local MQTT broker (accept local clients) is on. Users and anonymous access are set on Local MQTT Settings.
Point the Sparkplug nodes at Edge
Configure Ignition MQTT Transmission, Node-RED or your gateway to publish to the Edge PC on port 1883, for example mqtt://edge-pc:1883. The installer opens port 1883 in the Windows firewall for the Domain and Private profiles.
Name the Sparkplug group
Name the group site_area, for example plant1_packing. ConnectMQ Cloud uses it for the ISA-95 site and area; the edge node becomes the line and the device the cell.
Forward spBv1.0 to the cloud
On the Topics page, under Wildcard rules, choose Local client messages, type spBv1.0/#, click Add rule and then Save and apply.
Keep the topic prefix empty
Leave Topic prefix in Cloud Settings empty. The cloud only recognises topics that start with spBv1.0/; with a prefix they are forwarded but not converted.
Use the data in ConnectMQ
In the ConnectMQ console you find the original spBv1.0/… topics and the converted ISA-95 topics, ready for dashboards, alerts and the digital twin.
How topics are converted
| Sparkplug B | ISA-95 in ConnectMQ |
|---|---|
Group plant1_packing | Site plant1, area packing |
Edge node line1 | Line line1 |
Device filler1 | Cell filler1 (the edge node name if there is no device) |
| DDATA / NDATA | …/telemetry |
| DBIRTH / NBIRTH | …/birth |
| DDEATH / NDEATH | …/death |
| DCMD / NCMD (published by local nodes) | …/command |
Example:
Sparkplug B node publishes to Edge (:1883)
spBv1.0/plant1_packing/DDATA/line1/filler1 (protobuf)
ConnectMQ Cloud publishes the ISA-95 copy
connectmq/plant1/packing/line1/filler1/telemetryThe decoded payload contains the metrics by name:
{ "Temperature": 71.4, "Speed": 120, "Running": true, "timestamp": 1763049600000 }Use the …/death topics to raise an alert when an edge node or device goes offline.
Good to know
- Edge passes Sparkplug B through unchanged; the decoding into ISA-95 JSON runs in ConnectMQ Cloud.
- Commands sent from the cloud (NCMD / DCMD, rebirth requests) are not delivered to local Sparkplug nodes. Commands published by local nodes do appear in the cloud under
…/command. - While the internet is down, Edge keeps the forwarded messages in its offline buffer and sends them in order when the link is back.
- Sparkplug nodes that can reach the internet may also publish to your ConnectMQ broker directly.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| MQTT Client channel offline, login rejected | Wrong Username / Password, or the broker needs TLS. Check the credentials and UseTls / Port. |
| TLS handshake fails | The broker certificate is not trusted. Set CaCertificateFile; use AllowUntrustedCertificates only for tests. |
| Device connected, but tags stay empty | The tag topic or Path does not match the payload. Turn on "AutoCreateTags": true with "AutoCreateMode": "JsonLeaves" to see what arrives. |
Tags turn stale, device offline | No message within WatchdogSeconds. Check that the devices still publish, or raise the value. |
| Write does not reach the device | Set WriteTopic (required when the source topic has wildcards) and check WriteFormat. |
| Sparkplug node cannot connect to Edge | The local broker is off, port 1883 is blocked, or anonymous access is off. Check Windows Service Settings and Local MQTT Settings. |
| Sparkplug topics reach the cloud but are not converted | A topic prefix is set in Cloud Settings. Leave it empty so topics start with spBv1.0/. |
| Sparkplug topics do not reach the cloud | The wildcard rule spBv1.0/# for Local client messages is missing on the Topics page. |
| Wrong site or area in the converted topic | Name the Sparkplug group site_area, for example plant1_packing. |