Troubleshooting
Why the UaCPP demo server publishes nothing to an MQTT broker
Short answer
The UaCPP Demo Server implements OPC UA PubSub over the UDP transport only, so a downloaded configuration with an MQTT connection, writer group and published nodes has no transport to run on. The PubSub Config View in UaExpert has no fields for broker topic, user name or password, so it cannot configure an MQTT broker at all. Read the server's nodes over OPC UA client/server and publish them with an MQTT bridge, or use a publisher that implements the MQTT transport profile.

On this page
The UaCPP Demo Server publishes nothing to your MQTT broker because it implements OPC UA PubSub over the UDP transport only. The configuration you built in the PubSub Config View of UaExpert — an MQTT connection, a writer group, published nodes — downloads without an error, but the server has no MQTT stack to run it, and the view has no fields for a broker topic, user name or password, so it cannot configure a broker connection at all. No setting in that view changes the transport. Move the publishing out of the demo server: either read its nodes over the OPC UA client/server interface it already serves and publish them with an MQTT bridge, or put a publisher that implements the MQTT transport profile into the publishing role. The sections below trace where the path stops, compare the four routes to the broker, and walk through the bridge setup and its verification.
Where the publish path stops #
Trace the path hop by hop and it stops at the server, before any network is touched:
- Configuration download — completes without an error, but a stored configuration is not a running client.
- PubSub publisher on the server — the stop. The demo server supports the UDP transport only, so the downloaded MQTT connection object has no stack to attach to.
- TCP session and TLS handshake toward the broker — never opened, because the server has no MQTT client. Cloud brokers such as HiveMQ expose MQTT over TLS on port 8883, while plain MQTT uses port 1883.
- MQTT CONNECT with user name and password — never built, because the view has no fields for credentials.
- MQTT PUBLISH to a topic — never built, because the view has no topic field; a writer group's queue name lives in broker transport settings that a UDP-only tool never writes.
A packet capture on the server host's uplink settles it in one minute: filter for the broker's address after the download and no TCP SYN toward its MQTT ports appears, and the broker's client log shows no connection attempt against your credentials.
Why the PubSub Config View has no broker fields #
OPC UA Part 14 defines PubSub transports as profiles, and the profile registry names the broker mapping PubSub MQTT UADP, where UADP is the OPC UA binary PubSub wire encoding: a transport protocol mapping that specifies connection handling with a broker and the security that broker requires. In that mapping the topic is not an address field; it sits in the broker transport settings of the writer group and of each data set writer, and the user name and password are connection credentials, not properties of a socket address.
A configuration tool that models only the UDP transport offers a multicast address and a network interface and nowhere else to write, which matches the view exactly. Adding an MQTT server entry there produces a connection object without broker-specific settings, and the demo server has no MQTT stack to run it. End-to-end message security over MQTT additionally requires UADP network messages in binary encoding, so the transport choice matters before any encoding question comes up. The broker side of the mapping — connection options, message patterns and the settings a broker expects — is laid out in OPC UA PubSub over MQTT message patterns and broker settings guide.
The four routes to the broker #
Each route delivers the values; they differ in what you build and what subscribers receive.
| Route | What changes | When it fits |
|---|---|---|
| A. Wait for MQTT support in the demo server | Nothing; the vendor lists PubSub over UDP only for it | Blocks the project, and there is no date to plan around |
| B. Keep UDP PubSub and convert UADP to MQTT in a gateway | A UDP listener that decodes UADP network messages and republishes to the broker | Only when the server must stay the PubSub source and you accept building a decoder |
| C. Read the nodes over OPC UA client/server and publish from an MQTT bridge | A bridge host with an OPC UA client and an MQTT client | The default fix when the requirement is values on broker topics |
| D. Put a publisher that implements the MQTT transport profile into the publishing role | A different PubSub publisher replaces the demo server for publishing | When subscribers must receive PubSub-encoded messages rather than plain values |
The decision #
Pick C when the requirement is that values appear on your broker topics. It uses the client/server interface the demo server already serves, and the bridge owns the credentials, the TLS trust and the topic names in one place you control. Pick D only when subscribers must receive OPC UA PubSub-encoded messages on the broker; the publisher then has to implement the MQTT transport profile, which the demo server cannot. Pick B only when the server must stay the PubSub source and the UADP decoder effort is acceptable. Route A is not a route.
The vendor's SDK documentation describes PubSub transport connections to a broker as well as to a UDP socket, so route D can stay within the tooling you already use. The split behind route C — reads over client/server, distribution over MQTT — is the pattern in OPC UA client/server for control with PubSub fan-out over MQTT guide. Whatever you choose, keep the demo server as a test source; it is not a production publisher.
Set up the bridge route #
- Confirm the demo server's endpoint in UaExpert, browse to the nodes you tried to publish, and note each NodeId together with its namespace index.
- Create the broker credential pair in the broker's own console, and note the cluster host name and its TLS port.
- Pick the bridge host: a fanless industrial mini PC in the cabinet next to the server carries the load easily, because an OPC UA client and an MQTT client are lightweight workloads.
- Open outbound TCP from that host to the broker's TLS port, and check firewalls and proxies on the way: MQTT over TLS fails at the handshake when a TLS-inspecting proxy presents a certificate the client does not trust.
- Configure the bridge's OPC UA session with one monitored item per node, and set the intervals from the data rate. Worked example: 20 monitored items, sampling every 500 ms, publishing interval 500 ms. A 500 ms publishing interval repeats 1000 ms ÷ 500 ms = 2 times per second, so the session delivers 20 × 2 = 40 updates per second. At roughly 120 bytes per JSON payload with value, source timestamp and status code, the stream is 40 × 120 = 4800 bytes per second, and 4800 × 8 = 38,400 bit per second, about 38 kbit/s — negligible on any plant uplink, so choose the intervals for the process, not for bandwidth.
- Configure the bridge's MQTT client with the host, the TLS port, the credentials and a client ID unique to this instance. Build the topic per node, for example
site1/uacppdemo/line3/motor_current, and put the value, the source timestamp and the OPC UA status code in the payload so subscribers can see bad quality.
For the read side, Node-RED fills both roles, and how Node-RED reads PLC data over OPC UA, MQTT or Modbus shows how to wire the client side end to end.
Verify data reaches the broker #
- Change a writable or simulated node in the demo server from UaExpert and confirm the new value arrives in the OPC UA subscription first; this clears the source before you blame the broker side.
- Read the bridge log for the MQTT CONNECT acknowledgement. A refusal for bad credentials points at the user name or password; a handshake failure points at certificate trust or the wrong port.
- Subscribe to the topic wildcard of your hierarchy with a separate test client under its own credentials, and confirm the payload changes when the node value changes.
- Compare the source timestamp in the payload against the demo server's clock to confirm the bridge publishes current values rather than a stale cache.
- Pull the bridge's network link for a few seconds and confirm it reconnects and resumes on its own. If it comes back but stays silent, the cause sits in session or subscription state; why an MQTT client reconnects but then publishes nothing walks that case.
Mistakes that recur #
- Reading the MQTT entry in the view as a working transport: it is stored configuration, not a running client.
- Reading a configuration download that reports no error as success: verify with traffic instead — one capture with no SYN toward the broker settles it.
- Testing the cloud broker first: run the first connect against a broker on the plant LAN, for example one on a PC at 192.168.1.50, to remove DNS, firewall and TLS variables; why a device cannot publish MQTT to a broker on your PC lists the usual blockers when that first target is a Windows PC.
- Publishing credentials in plain MQTT across the internet: keep the unencrypted listener on the plant network and use the TLS listener toward the cloud.
- Carrying UDP PubSub settings into the MQTT design: multicast addresses and interface selection belong to the UDP transport, which is the one the demo server does support.
The decision stands: route C for values on broker topics, route D when subscribers need PubSub-encoded messages, route B only with a UADP decoder you are willing to build.
Questions asked
Can UDP PubSub output from the demo server reach a cloud broker directly?
No. PubSub over UDP sends multicast datagrams that stay on the local device network, and an MQTT broker accepts TCP connections, not UDP traffic. Something on your side has to terminate the UDP stream and publish the values onward, which is exactly what the bridge route does. The UDP output and the broker will never meet on their own.
Why does the broker keep disconnecting the bridge?
Two MQTT clients are sharing one client ID. The broker treats the second connect as a session takeover and closes the older connection, so both sides drop and reconnect in a loop that looks random in the logs. Give every bridge instance its own client ID and the disconnections stop. A single client that reconnects but then publishes nothing has different causes.
Which port does the bridge use for a cloud broker like HiveMQ?
Cloud brokers accept MQTT over TLS on port 8883. Create the user name and password in the broker's own console first, because a connect with credentials the broker does not know is refused. Keep plain MQTT on port 1883 for a broker on your plant network; never send credentials across the internet unencrypted.
Does switching the message mapping to JSON change anything?
No. The transport is what the demo server lacks, while JSON versus UADP is the message encoding chosen inside the same configuration. A publisher still needs an MQTT transport to deliver either encoding, so changing the mapping does not help while the server supports UDP only. Choose the encoding once a publisher with the MQTT transport profile is in place.


