IMD SolutionComputing LibraryShop main store

Troubleshooting

Sparkplug B sends data but receives no SCADA commands

Edge computing and IIoT Published 8 min read

Short answer

Sparkplug B telemetry that reaches SCADA while SCADA writes never arrive is usually a direction-of-function fault: the open-source IEC SparkplugB library V1.0.0.0 implements only sending controller data to SCADA. Verify the broker path, session and authorization, watch the 30-minute demo window of the MQTT Client SL dependency, and choose a documented receive-capable implementation when writes are required.

On this page
  1. Why does Sparkplug B send data to SCADA but receive no commands back?
  2. Does the controller reach the MQTT broker at all?
  3. Does the broker accept and keep the MQTT session?
  4. Is the client authorized to publish and subscribe on its topics?
  5. Does the Sparkplug host see the node and its metrics?
  6. Where exactly does the data path stop?
  7. Why does the MQTT client stop after about 30 minutes?
  8. What should you deploy while command reception is missing?
  9. Questions asked

If your Sparkplug B stack publishes controller data to SCADA but no SCADA command ever arrives at the controller, check the direction of function before touching the broker: the open-source IEC SparkplugB library V1.0.0.0 implements only the sending direction, so a healthy telemetry path proves nothing about the command path. Work the checks in the order a fault actually layers: the direction the application requires, controller-to-broker connectivity, MQTT session acceptance, broker authorization, host-side Sparkplug diagnostics, and the 30-minute licensing window of the MQTT dependency. The final section gives the deployment decision for each case.

Why does Sparkplug B send data to SCADA but receive no commands back? #

The V1.0.0.0 release of the open-source IEC SparkplugB library implements only the publish direction: it turns a CODESYS controller into a Sparkplug edge of network node that sends data to SCADA, and receiving data from SCADA is outside that release's implemented functionality.

An edge of network node — an EoN node — is the Sparkplug role that publishes process data upward; the Sparkplug host role at the SCADA side subscribes to that data and is the role that issues commands back down. The release notes for V1.0.0.0 list command reception as forthcoming, and a planned feature is not an acceptance basis for a deployed system.

Required operation Decision for this release Next check
Publish controller measurements to SCADA Matches the implemented direction Controller-to-broker connectivity and session
Write supervisory commands into the controller Not implemented in V1.0.0.0 Select a documented implementation with receive support
Run continuously past 30 minutes Requires the purchased IIoT Libraries SL license Runtime licensing before endurance testing

If telemetry works but SCADA writes never arrive, stop treating broker routing as the primary suspect: changing subscriptions, credentials or network rules cannot add application functionality this release does not contain. The companion guide to diagnosing Sparkplug MQTT commands that arrive but never update covers the same direction-of-function triage from the host side.

Does the controller reach the MQTT broker at all? #

Confirm the transport before the protocol: the controller interface must be active, its address must belong to the intended network, and the configured broker hostname, port and transport-security settings must match a listener the broker actually has enabled before any Sparkplug diagnosis means anything.

Read the controller's network settings and the client's destination configuration before examining payloads, and test hostname resolution from the controller's own network environment; resolution on an engineering workstation proves nothing about the controller. If those IP settings themselves are the open question, the guide to configuring IP networking on an edge PC with no SSH access walks that first configuration step.

  • Interface link state and network address, against the connected control-network segment
  • Broker hostname or address, against the intended broker endpoint
  • Destination port, against the broker's enabled listener
  • Transport-security settings, against that listener's security requirements
  • Routing and access rules, along the controller-to-broker path

A network path can succeed while secure-session establishment fails; when the client logs handshake trouble, the guide to fixing a CODESYS MQTT TLS peer verification handshake failure covers that specific split.

If the broker records no connection attempt, follow the path back toward the controller with client diagnostics and permitted network captures; if it records an attempt, move to session acceptance instead of re-touching physical-network settings.

Does the broker accept and keep the MQTT session? #

A TCP connection to the listener is not an accepted MQTT session: the broker also applies its authentication policy to the client ID, username and credentials, and a session that is repeatedly replaced usually indicates an identity collision rather than an unstable link.

Compare the client identity, credentials and security settings with the broker's own configuration, and remember that every concurrently connected client needs an identity unique on that broker. Take keepalive and reconnect values from the client's actual configuration and correlate disconnect timestamps between controller and broker logs instead of assuming timings. On a broker you administer, the secure Mosquitto MQTT lab broker guide shows where the authentication and access rules live.

If the session holds, continue downstream; if it repeatedly drops, fix the identity or credentials before reading anything into Sparkplug behavior.

Is the client authorized to publish and subscribe on its topics? #

Authorization is checked separately from authentication: a broker can accept the connection and still deny publication or subscription on the topic hierarchy, so a connected status alone proves neither that telemetry is flowing nor that a command could ever be delivered.

Read the broker's access rules and rejection log for the topics the application actually uses. A publish permission denied on the telemetry topics silences data while the session stays connected, and a subscribe restriction on the command topics would block delivery to any client able to consume them. Granting subscribe rights does not create a receive function in a release whose application never reads those messages, which keeps an authorization fault separate from the missing direction in the first section.

Decision: a rejection entry names a permission to correct; a clean authorization log with publications visible moves the diagnosis up to the Sparkplug layer.

Does the Sparkplug host see the node and its metrics? #

MQTT moves bytes; Sparkplug supplies the conventions that let a host interpret node identity, lifecycle state and metric definitions, so a generic MQTT connection test does not prove Sparkplug interoperability between the controller and the SCADA host.

Compare the group and node identities the controller publishes with the hierarchy the host expects, and read the host's incoming-message and lifecycle diagnostics — including whether the host has re-requested birth data through its rebirth mechanism — rather than judging from broker byte counters alone.

Observed result Likely stopping point Next reading
Client connected, no publications visible Publication path or broker permissions Application status and broker authorization log
Publications visible, host sees no node Host subscription or Sparkplug interpretation Host broker settings and incoming-message diagnostics
Node appears, expected metrics missing Metric mapping or node initialization Metric definitions and lifecycle diagnostics at the client

When a node appears but metrics stay missing, the guide on fixing Sparkplug B device tags at the client rather than the broker maps those faults to client-side definitions.

Where exactly does the data path stop? #

Trace one value through every hop instead of testing subsystems in isolation: record a non-actuating test value in the controller, its publication on the broker, and its displayed value in SCADA, because the first hop where the value disappears names the subsystem to inspect.

Check in this order:

  1. Application direction — does the installed release implement the direction the process needs?
  2. Transport — interface, address, resolution, listener port, transport security.
  3. Session — authentication policy, client identity stability, disconnect correlation.
  4. Authorization — publish and subscribe rights on the topics in use.
  5. Sparkplug layer — group and node identities, lifecycle, metric definitions at the host.

Worked example: a software counter in the controller application reads 117; the broker payload shows 117; the SCADA faceplate shows 117. If the broker already shows 117 and SCADA does not, the fault sits above MQTT in host mapping; if every hop shows 117, telemetry is proven end to end and the missing SCADA writes remain the application-direction question of the first section, not a data-path fault.

Why does the MQTT client stop after about 30 minutes? #

A stop that lands about 30 minutes after the runtime starts is a licensing event, not a network defect: the MQTT Client SL dependency runs in demo mode for 30 minutes without functional restrictions, and continuous operation beyond that window requires IIoT Libraries SL purchased through the CODESYS Store.

A 30-day demo license exists for evaluation, so endurance testing under a legitimate license is possible before purchase. Worked example: a runtime that starts at 06:02 reaches the end of its demo window at 06:02 + 00:30 = 06:32, so publications stopping at 06:32 — at a fixed offset from the runtime start rather than at a random wall-clock time — point at licensing, and the installed runtime license is the first thing to read. Drops at random times, or correlated with broker restarts, point back to the transport, session and authorization checks instead. The open-source design also permits bringing a different MQTT client; that is an engineering change to validate, not a connection setting.

What should you deploy while command reception is missing? #

Commit to one of two decisions: if the application only needs telemetry, V1.0.0.0 with a properly licensed MQTT dependency is a deployable telemetry path; if SCADA writes are required, this release cannot provide them and you must select a documented implementation that supports the receive direction.

Case 1 — telemetry only: run the checks of sections 2 through 5, and size the runtime license for continuous operation before endurance testing rather than after a licensing stop has been misread as a fault. If the underlying requirement is data collection rather than control writes, the OPC UA to MQTT edge gateway article documents a bridged controller-to-broker pattern that validates on the same path.

Case 2 — SCADA writes required: no broker, network or subscription change adds the missing function; choose an implementation whose documentation explicitly covers command reception, then validate its command round trip exactly the way section 6 traces telemetry, treating the announced later release as a roadmap item, never an acceptance basis.

One safety note: prove any command round trip on a non-actuating metric, or with the equipment in a safe state, before a SCADA write is allowed to reach live outputs.

Questions asked

Which component actually needs the runtime license?

The Sparkplug library itself carries no runtime license; it is released under an MIT license. The requirement comes from its dependency: the supplied implementation uses CODESYS MQTT Client SL, and running that dependency beyond 30 minutes requires the IIoT Libraries SL package from the CODESYS Store. A 30-day demo license is offered for evaluation, so you can test the full stack under a legitimate license before purchasing.

How does a SCADA write reach a field device in a Sparkplug B system?

The host publishes a command message to the broker on a topic built from the group ID and edge node ID of the target. The EoN node receives that command and translates it into a device-level write using the device's native protocol, so the controller or the attached device executes the write locally. A receive-capable edge implementation must subscribe for those command messages and apply them.

If I replace the supplied MQTT client with my own, will SCADA writes start arriving?

No. The gap is in the Sparkplug layer above MQTT, so a different transport client changes how bytes move but still receives no command messages for the application to act on. Swapping the client is legitimate — the open-source design allows it and the maintainers ask that any substitute be stable — but validate its interface, connection-state reporting, publication behavior and recovery handling, and expect renewed interoperability testing of the whole stack.

Will a manually configured broker subscription deliver the missing commands?

No. A broker-side subscription only causes the broker to forward matching messages to the client; nothing in the V1.0.0.0 Sparkplug application subscribes for command topics or consumes what arrives, so the messages would accumulate unread or be discarded. The receive direction needs application code that handles the command messages and applies the writes, which is exactly the functionality this release leaves out.

Keep reading

  • How-to

    Sending PLC data to an IoT hub without custom software

    You do not need custom software to move PLC data to an IoT hub: a configurable edge package with an S7, Modbus TCP or EtherNet/IP driver, a channel mapping and an MQTT publisher replaces hand-written acquisition code. Verify two things before you commit: the driver covers the protocol your controller actually speaks, and the publisher covers the destination's authentication and message format. Software still does the work — you configure it instead of writing it.

    Edge computing and IIoT

  • How-to

    Bridging OPC UA PLC data to MQTT with an edge PC

    Keep the OPC UA server on the PLC side and give MQTT publishing its own role on a separate edge PC that acts as the OPC UA client and MQTT publisher. Commission the two links independently — first a verified tag read, then a verified subscriber message — and only then widen the tag set.

    Edge computing and IIoT

  • Troubleshooting

    Fix MQTT sensor data missing in Node-RED

    A green MQTT connection in Node-RED proves only a broker session, not that the GSM module published a value or that the flow subscribes to its topic. An http in node cannot receive MQTT publications at all: use an mqtt in node. Trace RS-485 acquisition, publish result, broker identity and topic match in order, and fix the first stage with no positive result.

    Edge computing and IIoT