Configure the OPC UA client in the gateway (e.g., Node-RED with node-red-contrib-opcua, or a purpose-built gateway) with the OPC UA server endpoint URL, security mode, and authentication credentials.
Map OPC UA node IDs to Sparkplug B metric names and data types in the gateway configuration; define the polling interval or set up monitored-item subscriptions for change-on-value.
Encode polled or event-driven readings into Sparkplug B Protobuf payloads (using the spBv1.0 namespace) for NBIRTH and NDATA messages.
Publish NBIRTH to the MQTT broker on gateway startup and NDATA for each telemetry cycle, following QoS 0 rules for Edge Node messages.
Implement reconnect logic for both the OPC UA session and the MQTT connection; re-publish NBIRTH after any MQTT reconnect to re-declare the metric catalog.
Forward processed data upstream to IoT Hub, AWS IoT Core, or a Unified Namespace MQTT broker as appropriate for the architecture.
Known gotchas
OPC UA Variant types must be explicitly mapped to Sparkplug B DataType enums; mismatched types cause parse failures in consuming applications.
Large OPC UA address spaces can produce very large NBIRTH payloads; consider segmenting logical groups across multiple Edge Node IDs.
OPC UA session resumption with continuation points is separate from MQTT reconnect; handle both reconnect paths independently to avoid missing data.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp