The IoT/IIoT OPC UA toolbox package for Node-RED based on node-opcua.
The actual DATATRONiQ contribution to v4.x+ upgrades the original work of v3.x by migrating to TypeScript, and updating dependencies, including updates to new major release versions of Node-RED (v1.x to v2.x+) and node-opcua (v0.7 to v2.64.1).
- tested with Node.js v14.19 and Node-RED v2.2.2
- based on node-opcua v2.64 (OPC UA v1.03)
- extendable with node-opcua-isa95
Use the Node-RED "Manage Pallet" to install it via Node-RED
- Navigate to your Node-RED data directly. This defaults to
$HOME/.node-red/
- Install via npm.
npm install node-red-contrib-iiot-opcua
The update from v3.x to v4.x changed the way some nodes are implemented. As a major version v4.x has breaking-changes.
- The message format was standardized. While in older versions, a lot of additional properties were placed directly into the message,
they have been moved into the message's payload (
msg.payload
). This is to ensure the standard Node-RED message format is used, where the message itself may only contain an ID, a topic, and a payload. This means that any references likemsg.nodetype
should be changed tomsg.payload.nodetype
.
- The option
singleBrowseResult
has been replaced withmultipleOutputs
, and the default value now combines all outputs into one message. To maintain the same output, replacesingleBrowseResult
withmultipleOutputs
and swap the corresponding boolean value (true becomes false, false becomes true).
- The
node-opcua
library is now directly accessible asopcua
. This means all references tocoreServer.core.nodeOPCUA
should be replaced withopcua
. node.iiot.assert
is no longer accessible. The functionality can be replaced by using anif
statement that throws a new error (if (errorConfition) throw new Error('Error Message'
). Errors can be displayed by using acatch
node connected to adebug
node, which displys the entire message.
Every bit helps! If you come across any bugs, please send a bug report, or if you feel inclined to fix it yourself, submit a pull request.
- Ensure you are using node 14. This has been developed using node v14.19.1. If using Node Version Manager:
nvm install v14.19.1
- Install Node-RED to a separate directory.
git clone git@github.com:node-red/node-red.git cd node-red git checkout tags/2.2.2 # pls see most recent 2.2.x tag for Node-RED npm install npm run build npm run start # This must be run once to initialize the ~/.node-red directory
- Clone this repository into its own directory
git clone git@github.com:BiancoRoyal/node-red-contrib-iiot-opcua.git cd node-red-contrib-iiot-opcua git checkout development npm install npm run build
- Add
node-red-contrib-iiot-opcua
to Node-REDcd ~/.node-red npm install <path to where you have cloned the project>/node-red-contrib-iiot-opcua
- Start Node-RED
cd <...>/node-red npm run staart
- Link Node-RED to a separate development directory.
git clone git@github.com:BiancoRoyal/node-red-contrib-iiot-opcua.git cd node-red-contrib-iiot-opcua git checkout development npm install npm run dev-link DEBUG=*opcua* node-red -v
⚠️ After making changes, remember to run npm run build
in the node-red-contrib-iiot-opcua
directory and re-starting Node-RED! ⚠️
To increase the verbosity of logging, enable debug modes and verbose logging.
Start debug with Node-RED in verbose (-v) mode to get a verbose logging:
DEBUG=opcuaIIoT* npm run start -v 1>nodeREDIIoTOPCUA.log 2>&1
With the flex server you could create your own information model with the OPC UA address space.
The server node contains demo objects and variables to start playing with OPC UA method call, read and write operations.
see Node-RED menu (right upper corner) -> Import -> Examples -> iiot opcua
... secure reading from OPC UA servers with your own key pairs ...
... and secure writing and moving data between OPC UA servers ...
... create your own variables and objects from events ...
Node-RED | UAExpert / Client |
---|---|
The BSD 3-Clause License
DATATRONiQ, is the current maintainer of the DATATRONiQ node-red-contrib-iiot-opcua detached Fork
This Node-RED package has been revitalized in 2022 and is based on the node-red-contrib-iiot-opcua package created by Klaus Landsdorf in 2017. Copyright notices by Mika Karaila, Klaus Landsdorf, and others are to honor their work in previous years on Node-RED, OPC-UA, and node-red-contrib-iiot-opcua; we are very grateful for all the time and energy they've invested!!
Klaus Landsdorf, creator and current maintainer of the Bianco-Royal node-red-contrib-iiot-opcua
That is a whole new Node-RED package started in 2017 based on the node-opcua v0.4 and the API documentation. The old copyrights by Mika Karaila are just to honor his pioneer work in the years 2015/2016 for Node-RED and OPC UA.
This is not an official product of the OPC Foundation or Plattform Industrie 4.0.
Special thanks go to Etienne Rossignon for the node-opcua packages and very special for the node-opcua-isa95 package! Special thanks also go to Klaus Landsdorf for creating node-red-contrib-iiot-opcua in the first place!