npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-opcua-server-refresh

v0.1.6

Published

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.

Readme

node-red-contrib-opcua-server-refresh

A programmable OPC UA server for Node-RED based on node-opcua next generation version with less dependencies.

NOTE: This is a fork of the original work of Klaus Landorf by Richard Meyer. The original node-red-contrib-opcua-server package has not been maintained for over 2 years. This updated version was created to work with the latest version of node opc-ua and its dependencies, as well as fix some broken/in progress features from the original project such as -

  • loading of nodeset xml files from inside the node configuration
  • full opc-ua security policy support

The goal of this projec is to be able to build modern node opc-ua servers within node-red that support most essential features.

Core

using next generation node-opcua version from Etienne Rossignon

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

    npm install node-red-contrib-opcua-server-refresh

try these options on npm install to build from source if you have problems to install

    --unsafe-perm --build-from-source

Debug

Debugging on remote devices is important to help users. The verbose logging provides interesting points in different abstractions if IDE or console debugging is not possible.

Start debug with Node-RED in verbose (-v) mode to get a verbose logging:

DEBUG=opcuaCompact* node-red -v 1>Node-RED-OPC-UA-Server.log 2>&1

or on local Node-RED

DEBUG=opcuaCompact* node red.js -v 1>Node-RED-OPC-UA-Server.log 2>&1

Code Style

Prettier

Quick Getting Started

A detailed example server showcasing various ways to construct nodes in OPC-UA is now included as part of the default package. The address space is pre-populated with a working nodes deployed in various formats, along with notes to help understand the context.
If you leave the deafult port number of 54840, the only additional task is to define the endpoint.
On the Discovery tab, populate the Endpoint Url with the format opc.tcp:\\<node-red-ip>:54840, as is shown here - Screenshot of endpoint

Your server should be ready to go at this point. To view the contents of your server, there are numerous OPC-UA clients you can use. If you don't have a preference, I recommend Prosys OPC UA Browser due its clean UI and ease of use. It's free, but requires an email to get access to the file.

Once you have installed the OPC UA Browser of your choice, simply enter your endpoint url into the OPC UA client and press enter. You will be prompted for security credentials, but since this server has security disabled by default, you can log in anonymously and set security to none. You should be able to browse the server. Your data will be located in the Objects path. An example using the pre-defined code is shown - Screenshot of client browser.

Detailed Set-Up Information

For a more detailed, step-by-step guide on how to set up an OPC-UA server in node-red, I have written detailed guides hosted on flowfuse, split into 3 parts. You can find them here -

Loading a Nodeset Configuration File

To load a nodeset xml file, navigate to the Users & Sets tab, and enter the absolute path to the nodeset xml file. This package comes pre-loaded with nodeset xml files in the src/public/nodesets directory. So for example, if I want to load the nodset xml file Opc.Ua.AutoID.NodeSet2.xml, for my set-up, the absolute path to that file would be /root/.node-red/node_modules/node-red-contrib-opcua-server-refresh/src/public/nodesets/Opc.Ua.AutoID.NodeSet2.xml. If you get an error TypeError: Cannot read properties of null (reading 'objects'), that means the server cannot find the nodeset file and you didn't enter the path correctly. If the server can see the nodeset file, you can confirm it was loaded correctly by checking the Types -> DataTypes -> XML Schema path in a OPC UA Client browser - Screenshot of nodeset

Examples

Example projects are provided as part of the project in the examples folder. Links to the examples here - Link to Example Flows You can simply copy the json and import them into your flows.
There are two examples - one is simply a copy of the example provided by default with the project called example-server.json. The other is an example that simulates data coming from a PLC in node-red and uses flow context memory to pull the dynamic data in data from outside the server called example-with-context.json.

Contribution

Yes, sure! Please help us to make it even better and send your pull requests or tests!

Happy coding!

License

based on node-opcua we use MIT license Copyright (c) 2019 Bianco Royal Software Innovations® Forked and updated by Richard Meyer 2024