A Node-RED node collection for OPC UA communication and server functionality, based on the node-opcua library. Current stable version is 0.2.351, released regularly with active maintenance. It provides client nodes to read, write, subscribe, browse, and invoke methods on OPC UA servers, plus server nodes to create variable and method nodes. Key differentiators include tight integration with Node-RED's flow-based programming model and support for complex OPC UA features like subscriptions, monitored items, events, and array index ranges. Compared to generic OPC UA SDKs, it abstracts connection management and message parsing into easy-to-configure nodes.
npm install node-red-contrib-opcuaVerified import paths — ran on the pinned version, not inferred.
Installation and minimal flow to read an OPC UA variable using OpcUa-Client and OpcUa-Item nodes.
Update to v0.2.223+ and ensure variable nodes have correct namespace index.
Update to latest node-opcua and this package, check node-opcua migration guides.
Format topic as 'ns=<namespace>;s=<identifier>;datatype=<DataType>' (e.g., 'ns=3;s=Counter;datatype=Int32').
Upgrade Node.js to version 15 or later.
Configure firewall to allow OPC UA traffic, or set specific client/server ports.
Use action='subscribe' with interval and queueSize parameters.
Run 'npm install node-opcua' in the Node-RED user directory or globally.
Check OPC UA server status and ensure port 4840 is open on server and client firewall.
Ensure nodeId follows pattern 'ns=<namespaceIndex>;<identifierType>=<identifier>' (e.g., 'ns=2;s=MyVariable').
Reconnect the OpcUa-Client node (e.g., deploy flow again or trigger reconnect).
Place client's self-signed certificate in server's trusted certificate store, or disable certificate verification (not recommended).