Fork of the original 'node-red-contrib-opcua-server' package that is no longer maintained. This has been refactored to support the latest version of node-opcua and fixes incomplete/non-working features.
npm install node-red-contrib-opcua-server-refreshnode-red-contrib-opcua-server by Klaus Landsdorf, which has not been maintained for over 2 years. This updated version was created by Richard Meyer to work with the latest versions of node-opcua and its dependencies, while fixing broken/incomplete features from the original project.
~/.node-red:
bash
npm install node-red-contrib-opcua-server-refresh
`
$3
If you encounter installation issues, try these options:
`bash
npm install node-red-contrib-opcua-server-refresh --unsafe-perm --build-from-source
`
๐ Quick Getting Started
$3
1. Add the OPC UA Server node to your Node-RED flow
2. Configure the endpoint: Set the endpoint URL (default: opc.tcp://localhost:54840)
3. Deploy your flow: The server will start automatically
$3
A detailed example server is included with pre-populated address space nodes deployed in various formats. If you use the default port 54840, simply define the endpoint URL in the format:
`
opc.tcp://:54840
`
!Screenshot of endpoint configuration
$3
We recommend Prosys OPC UA Browser for testing:
1. Install an OPC UA client (Prosys is free with email registration)
2. Connect to your endpoint using the URL above
3. Set security to "None" for initial testing (anonymous login)
4. Browse the Objects folder to see your data
!Screenshot of client browser
๐ง Advanced Configuration
$3
Navigate to the Users & Sets tab and enter the absolute path to your nodeset XML file.
Pre-included Nodesets:
This package includes nodesets in src/public/nodesets/. Example path:
`
/root/.node-red/node_modules/node-red-contrib-opcua-server-refresh/src/public/nodesets/Opc.Ua.AutoID.NodeSet2.xml
`
Validation:
Successfully loaded nodesets appear in Types โ DataTypes โ XML Schema in your OPC UA client.
!Screenshot of nodeset loading
$3
For developers working with TypeScript:
`bash
Development build with source maps
npm run build:dev
Watch mode for development
npm run watch
Production build
npm run build:ts
`
$3
- Anonymous Access: Enabled by default for easy setup
- User Authentication: Configure in the Users & Sets tab
- Certificate Security: Specify certificate paths for secure connections
- Security Policies: Support for modern OPC UA security standards
๐ Detailed Guides
For comprehensive setup guides, see our detailed tutorials:
- Part 1: Deploy a Basic OPC-UA Server in Node-Red
- Part 2: Build a Secure OPC-UA Server with PLC Data
- Part 3: Build an OPC-UA Client Dashboard
๐ Examples
Example projects are provided in the examples folder:
- example-server.json: Basic server configuration
- example-with-context.json: Dynamic data from flow context
Simply copy the JSON and import into your Node-RED flows.
๐ Debug & Troubleshooting
$3
Enable debug logging for detailed information:
`bash
DEBUG=opcuaCompact* node-red -v 1>Node-RED-OPC-UA-Server.log 2>&1
`
$3
- "Cannot read properties of null": Check nodeset file path is correct
- Connection refused: Verify endpoint URL and port availability
- Security errors: Ensure security settings match between client and server
๐งช Testing
This package includes comprehensive testing:
`bash
Run all tests
npm test
Run with coverage
npm run test:coverage
Clear test cache
npm run test:clearCache
`
Test Coverage: 61 tests covering all functionality with 100% pass rate.
๐ ๏ธ Development
$3
- Node.js 20+
- TypeScript 4.7+
- npm or yarn
$3
`bash
Install dependencies
npm install
TypeScript development build
npm run build:dev
Watch mode for development
npm run watch
Run tests
npm test
Format code
npm run clean:formatter
``