Skip to content

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 situationUse
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 tagsMQTT Client connector
You want to pass those messages to the cloud unchangedMQTT Client connector with "Forward": true
Ignition MQTT Transmission, Node-RED or other Sparkplug B edge nodesSparkplug B through the local broker
Devices that can publish to Edge directlyPoint 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.

ConceptMQTT meaningLimit
ChannelOne broker connectionmax 60 channels
DeviceA "topic device": one or more topic filtersmax 1024 devices per channel
TagTopic 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 ​

SettingDefaultDescription
Host / Portlocalhost / 1883Broker address
TransportTcpTcp or WebSocket
WebSocketPath/mqttWebSocket path (ws://, or wss:// with TLS)
UseTlsfalseUse TLS
AllowUntrustedCertificatesfalseDo 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
ClientIdconnectmq-edge- + PC name + channelMQTT client ID
Username / Password—Credentials
ProtocolVersion3.1.13.1.1 or 5
KeepAliveSeconds30Keep-alive
CleanSessiontrueClean session
ConnectTimeoutMs10000Connection timeout
ReconnectMinMs / ReconnectMaxMs1000 / 30000Reconnect wait range (exponential)

Relative file paths are resolved under %ProgramData%\ConnectMQ\Edge.

Device settings ​

SettingDefaultDescription
Topics[]Topic filters to subscribe to (+ and # allowed)
Qos1Subscription QoS
DefaultFormatJsonDefault payload format of the tags
AutoCreateTagsfalseDiscovery: create tags for messages no tag matches
AutoCreateModeTopicTopic: one tag per topic. JsonLeaves: one tag per JSON leaf
AutoCreateLimit1000Max auto-created tags per device
WatchdogSeconds0If no message arrives in this time, the tags become stale and the device offline; the next message brings it back online
ForwardfalseBridge mode: pass the raw message unchanged to the ConnectMQ broker
ForwardStripPrefix—Prefix removed from the source topic when forwarding
ForwardPrefix—Prefix added when forwarding
WriteSuffixemptyDefault 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:

SettingDescription
FormatJson, Xml, Csv, KeyValue, Text, Binary, Regex (empty = the device's DefaultFormat)
PathPath for the format, see below
TimestampPathTimestamp field in the same format: ISO-8601 text or Unix epoch (s or ms)
Delimiter, HasHeaderCSV delimiter (default ,, \t supported) and header row
PairSeparator, KeyValueSeparatorKey-value separators (default ; and =; a line break also separates pairs)
GroupRegex group number or name (default: group 1 if there is one, otherwise the whole match)
ByteOrderBinary byte order: ABCD (big endian), DCBA (little endian), BADC, CDAB
FormatPath examples
Jsonsensor.temp, $.values[0].v, ['key.with.dots']; empty or $ = the whole payload
XmlXPath: /m/v, /m/v/@id, number(/m/v)
CsvColumn index (2, zero-based) or, with HasHeader, the header name (temp). The last line is the data line
KeyValueKey name: temp (payload temp=21.5;hum=40)
TextNo path, the whole payload
Binaryfloat32@4, int16@0, uint32@2, float64@8, bool@3.5 (byte.bit), string@0:10
RegexPattern 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.

NameTopicFormat / pathDataTypeUnit
Temperatureplant/line1/sensor1Json data.temp, time from tsFloat64°C
Humidityplant/line1/kvKeyValue hum%
Speedplant/line1/rawBinary float32@4, CDABFloat32
Setpointplant/line1/spText, writable to plant/line1/sp/set
json
{
  "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:

text
connectmq/site1/production/line1/sensors/Line1Sensors/Temperature

with this payload:

json
{
  "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:

SettingDefaultDescription
WriteTopicsource topic + WriteSuffixRequired if the source topic contains wildcards
WriteFormatRawRaw (plain value), Json ({"value": …, "timestamp": …}) or Template
WriteTemplate{value}Placeholders {value} and {timestamp}
WriteRetain / WriteQosfalse / 1
  • From the cloud: turn on Allow writes from the cloud in Cloud Settings, then publish {"value": 12.5} (or just 12.5) to the tag topic plus /set, for example connectmq/site1/production/line1/sensors/Line1Sensors/Setpoint/set. Edge publishes the value to plant/line1/sp/set on 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 BISA-95 in ConnectMQ
Group plant1_packingSite plant1, area packing
Edge node line1Line line1
Device filler1Cell 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:

text
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/telemetry

The decoded payload contains the metrics by name:

json
{ "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 ​

SymptomCause and fix
MQTT Client channel offline, login rejectedWrong Username / Password, or the broker needs TLS. Check the credentials and UseTls / Port.
TLS handshake failsThe broker certificate is not trusted. Set CaCertificateFile; use AllowUntrustedCertificates only for tests.
Device connected, but tags stay emptyThe tag topic or Path does not match the payload. Turn on "AutoCreateTags": true with "AutoCreateMode": "JsonLeaves" to see what arrives.
Tags turn stale, device offlineNo message within WatchdogSeconds. Check that the devices still publish, or raise the value.
Write does not reach the deviceSet WriteTopic (required when the source topic has wildcards) and check WriteFormat.
Sparkplug node cannot connect to EdgeThe 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 convertedA topic prefix is set in Cloud Settings. Leave it empty so topics start with spBv1.0/.
Sparkplug topics do not reach the cloudThe wildcard rule spBv1.0/# for Local client messages is missing on the Topics page.
Wrong site or area in the converted topicName the Sparkplug group site_area, for example plant1_packing.

Fully managed MQTT broker for connected devices.