an implementation of a OPC UA stack fully written in javascript and nodejs
Node-opcua is an full OPC-UA stack written in NodeJS.
Why NodeJS ?
Because nodeJs is a great framework to design asynchronous application.
$ npm install node-opcua
- check out the API documentation
$ git clone git://github.com/node-opcua/node-opcua.git node-opcua
$ cd node-opcua
$ npm install
$ npm test
If you like the project, please 
This are the item we would like to achieve in the next version of the API.
- sign
- sign & encrypt
- improved documentation
- Compliance testing and certification (CTT)
- HA Support : supporting the historizing service
- more tutorials
-
if you're using node-opcua in one of your project, please feel free to leave a comment and a quick description in the wiki
-
if you have a particular wish or found a issue, let us known and create a issue
This project is based on the node OPC UA project at: https://github.com/node-opcua
In this document I will use the following convention:
Entered data will be BOLD such as usernames and passwords.
Entered commands will be ITALIC such as ls, sudo, etc.
This demo is to be used with my Pi2 in the lab. You will have to modify simple_server.js to conform to your environment.
On the Raspberry Pi 2:
The Pi2 is currently configured to be able to read the ultrasonic sensor installed on the breadboard. The OPC UA server is configured to read this sensor and simulate two others. These sensors are labeled as:
ns=2;s=sonic - Ultrasonic sensor distance in cm
ns=2;s=PumpSpeed - Simulated pump speed reading in rpm
ns=2;s=Pressure - Simulated Pressure reading in psi
Usage:
login using username: pi and password: raspberry
Move to the directory containing the server example:
cd gpio_ultrasonic/node_modules/node_opcua/bin
Run the server: (sudo is required to access the gpio pins)
sudo node simple_server.js
The OPC UA server will start and after a short time it will be available to clients.
On any platform capable of running a browser and nodejs(with npm)/javascript:
Using the files from my repo at https://github.com/jcodling/node-opcua.git you can run the demo client.
Currently there is a client that allows reading of data from the OPC UA server and provides a websocket for a simple html/js client.
Clone the repo:
git clone https://github.com/jcodling/node-opcua.git
Install the packages:
npm install
Run the API:
node wsclient.js
Navigate to localhost:9999/wsindex.html to start the demo.








