Git Product home page Git Product logo

node-red-contrib-opcua's Introduction

NPM download NPM version

Node-RED OPC UA

node-red-contrib-opcua

opcuanodeLogo64

A Node-RED nodes to communicate or serve via OPC UA.

based on node-opcua

nodeopcua64

Install

Run command on Node-RED installation directory.

npm install node-red-contrib-opcua

or run command for global installation.

npm install -g node-red-contrib-opcua

Usage

Use OpcUa-Item to define variables. Use OpcUa-Client to read / write / subscribe / browse OPC UA server.

See some flows under folder ![examples]. Updated server sub-flow example OPCUA-TEST-NODES.json look commands: addFolder, addVariable, addMethod, setFolder. Added new opcua-rights node to set folder/variable access level and role & permissions.

Here you got some ready to use examples. You can use the Import in Node-RED in the right upper corner menu.

node-red-opcua-flow

Examples are available for Schneider IGSS and Prosys Simulation Server as Node-RED flow. Search for OPC UA on: http://flows.nodered.org/

node-red-opcua-flow-Prosys

New method node example

Events example

Message parameters

Input message

Property Function/Value Notes
payload set interval for subscription or monitorItem
interval Subscription interval
queueSize Subscription queue size
deadbandType "a" abs. or "p" percent Action monitor
deadbandValue integer for deadband Action monitor
topic NodeId and DataType in format ns=3;s=Counter;datatype=Int32
action subscribe nodeId / variable
unsubscribe nodeId / variable
deletesubscription subscription
browse nodeId / folder
info nodeId
read nodeId
write nodeId & value
monitor deadbandtype abs/pro
events nodeId
readmultiple [nodeId + datatype]
writemultiple [nodeId + datatype + value]

readmultiple to readmultiple items writemultiple to write multiple items clearitems to empty multiple items (readmultiple / writemultiple)

NOTE: With datatype=xxxArray msg.payload.range = "2:4" can used as indexRange to read/write partial array

Output message

Property Function/Value Notes
payload dataValue.value.value
statusCode OPC UA StatusCode
sourceTimestamp Source timestamp
serverTimestamp Serverยดs timestamp

Release history (only couple of older releases):

v0.2.223

Fixed: Namespace index used with variables (set value).
Enhancements: Initial value can be set to server variable, server returns nodeId as variable created. Added support for StringArray.

v0.2.117

Enhancement: Added users to server. Users.json contains username, password and role for each user.

v0.2.116

Enhancement: server allow anonymous, added verbose to show trusted/rejected folders.

v0.2.115

Enhancement: server node security settings; mode and policy

v0.2.114

Fix: added to client certificate manager

v0.2.113

Enhancement: server commands: registerNamespace and getNamespaceIndex, user can addVariables with registered namespaces like ns=5.
Enhancement: msg.topic = readmultiple AND msg.payload = ALL then msg.payload = values

v0.2.112

Added DateTime to server.

v0.2.111

Fixed DateTime conversion (write).

v0.2.110

Added 2D and 3D array support. Examples:
ns=1;s=Float2D;datatype=FloatArray[5,5]
ns=1;s=Float3D;datatype=FloatArray[5,5,5]
NOTE: Write range uses msg.range
New feature msg.payload.range can be used to read part of Array
New feature msg.range can be used to write part of Array
Updated example OPCUA-TEST-NODES.json

v0.2.109

Added array range examples (examples/OPCUA-TEST-NODES.json).
Send only if payload contains something.
Added msg.payload.range usage
New feature msg.payload.range can be used to read/write part of Array
Fix: FQDN -> hostname in makeAplicationUri
EventId and statustext as clear string
EventId as hex string

v0.2.108 and older

Fixed support for server Array variables
Browse will create topic and datatype thus output can be connected. Next node can progress output msg.
Refactored browse action fast and simple
Merged event payload fix. Merge pull request #265 from list3f/master
Put OPC UA event data in msg.payload

# Advanced examples - needed from users (add links to examples folder)

Authors

Testing

karma start opcua.conf.js --log-level debug --single-run

TBD List

Nodes Function Done
All
Project structure โœ…
Async calls ๐ŸŒ’
UnitTesting ๐ŸŒ‘
Documentation ๐ŸŒ“
Item โœ…
Browser
Browse โœ…
Simple UI interface ๐ŸŒ“
Client
Read โœ…
Read Multiple โœ…
Write โœ…
Write Multiple โœ…
Subscribe โœ…
Unsubscribe โœ…
DeleteSubscription โœ…
Info โœ…
Browse โœ…
AE ๐ŸŒ‘
reconnect on error ๐ŸŒ’
Server
Commands
Restart โœ…
Add Folder โœ…
Set Folder โœ…
Add Variable โœ…
Add Object ๐ŸŒ‘
Add Method ๐ŸŒ‘
Add Equipment ๐ŸŒ“
Add PhysicalAssets ๐ŸŒ“
Delete by NodeId โœ…
Examples
Methods
Structures
Variables
Objects
AE
Alarm and Events
Subscribe โœ…

EMOJI CHEAT SHEET

node-red-contrib-opcua's People

Contributors

aitor-gamarra avatar allatrue avatar alv67 avatar andreasheine avatar arjendeetman avatar biancode avatar c0ppy avatar daviddhauwe avatar dependabot[bot] avatar drehermi avatar erossignon avatar faerylnahr avatar frostmark avatar gmerciel avatar iw3ijq avatar jclavier44 avatar jumo-sballing avatar koseng avatar list3f avatar mikakaraila avatar mscbpi avatar nospam2000 avatar nrok-hpotsirhc avatar olhorst avatar powellblyth avatar sajidbaloch avatar ste-hoe avatar tedkim13 avatar theodorekimtrumpf avatar yizenlim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-red-contrib-opcua's Issues

Failed to write OPC item

Hi again,

I got this msg when I tried to write opc item using the latest version (0.2.9):

msg : error
AssertionError: this.identifierType !== NodeIdType.NUMERIC || (this.value >= 0 && this.value <= 0xFFFFFFFF)

Payload is:

ns=2;s=OPCsim.Plant3.PV1.DC_Voltage : msg.payload : number
123

Data type is int16

Please advice

parsing data error in 0.2.11 ?

Hello, I've just encountered an error in [email protected] that the OPC node tries to parse some data from kepserver and return error in reading the values. The same flow works fine when I switch to use [email protected]

I think the error was thrown at line 362 in opcuaclient.js

so here is the DataValue object I got when I add console.log(dataValue) after line 335:

DataValue {
  value:
   Variant {
     '$dataType': { [Number: 6] key: 'Int32', value: 6 },
     '$arrayType': { [Number: 0] key: 'Scalar', value: 0 },
     value: 55,
     dimensions: null },
  statusCode: StatusCode { value: 0, description: 'No Error', name: 'Good' },
  sourceTimestamp: null,
  sourcePicoseconds: 0,
  serverTimestamp: null,
  serverPicoseconds: 0 
}

and here is the error message it throw in cmd:

1 Feb 13:25:40 - [error] [OpcUa-Client:OPC Read] Bad read: Good (0x00000)
1 Feb 13:25:40 - [error] [OpcUa-Client:OPC Read] Message:ns=2;s=Painting.Sprayer.Sprayer1 dataType:undefined
1 Feb 13:25:40 - [error] [OpcUa-Client:OPC Read] Data:{"value":{"dataType":"Int32","arrayType":"Scalar","value":55},"statusCode":{"value":0,"description":"No Error","name":"Good"},"sourcePicoseconds":0,"serverPicoseconds":0}

node-red opc server can't be accessed by locally running opc sample clients

Nevermind - I was having problems with both the OPC clients and my understanding of discovery (which may not happen for this node-red case).

Ignore.

Ideas?

I can connect to the Sample OPC Server (from opc foundation) from 2 different clients (Wonderware and OPC Sample Client).

But neither of the 2 clients can cannect to node-red running:
npm install -g node-red-contrib-opcua
node-RED v0.16.2 (latest)
nodejs v6.10.1 (latest stable)
windows 2012 server

I've added your latest client and server flows from OPCUA-TEST.json

On those, from within node-red the client - read/write fails until the server creates the integer (as we might expect).

After the server create the integer then the clients can read and write from within node-red...

but non of this shows up external to node-red (to other opc client programs on the same computer).

Security?

Problems reading from OPC server it gets "Connection erro" after 60 seconds.

Hey!
Thanks for a great plugin.
I have problems reading from OPC server it gets "Connection erro" after 60 seconds. Writing is no trouble.

in debug


2017-01-02 16: 31: 5560db8389.74461c
msg: string [51]
OPC UA Connection Error: Transaction has timed out


ย Timeout waiting for .... Response {/ * RequestHeader * /
ย authenticationToken / NodeId * * /: ns = 0; i = 0
ย timestamp / * UtcTime * /: 2017-01-0
2T21: 02: 10.588Z
ย request handle / * IntegerId * /: 1
ย ย ย ย ย ย ย 0x1
ย returned diagnostics / * uint32 * /: 0
ย ย ย ย ย ย ย 0x0
ย auditEntryId / * UASTRING * /: null
ย timeout hint / * uint32 * /: 0
ย ย ย ย ย ย ย 0x0
ย additionalHeader / * Extension Object * /: null
};
January 2 22:03:10 - [error] [OpcUa-Client: 60db8389.74461c] OPC UA Connection Error
: Transaction has timed out
warning: Disconnection: pending closing session


Change something and press Deploy none so work it in 60 seconds.

It does not matter if I have the update interval of 1s 10s or 30s.
I set the on 70s that is, it has never asked so will the same result.

This now came up after update 0.2.8 0.2.11 ran before, and then worked good reading.

I also have trouble if you restart the OPC server, you will lose contact with the server and does not reconnect again when the server is back up.

Then I have to restart the "node-red".

I would like to have a function that once every 30 seconds a trustee does not reconnect again. From skratch.

I run "Node-red" 0.15.1 on a viritulel Hyper-V Server win2012r2
I run Bechoff TwinCAT PLC 2.11 Beckhoff OPC UA Server v1.4

Have also tried to run another PLC Beckhoff opcserver with the same result.
ย 
Do you have any idea I was doing wrong.
Sincerely Erik

Issues with node red OPC UA

Hi, Ive had node red OPC UA running on my PC for a few weeks now and its just stopped working. Ive uninstalled NODE JS and reinstalled both it and the npm install node red and OPC ua but when I run node red from CMD prompt it gets so far through the start process and crashes.
The errors are shown here:
9 Apr 22:53:35 - [error] [OpcUa-Client:6ee1b705.cfadd8] subscription.monitorEvent:Error: BadMonitoredItemFilterUnsupported (0x80440000)warning : disconnection : closing pending sessions
9 Apr 22:53:36 - [red] Uncaught Exception:
9 Apr 22:53:36 - AssertionError: self.subscription.session at ClientMonitoredItem._monitor (C:\Users\John Egan\AppData\Roaming\npm\node_modules\node-red-contrib-opcua\node_modules\node-opcua\lib\client\client_monitored_item.js:190:5) at Immediate.wait_for_subscription_and_monitor (C:\Users\John Egan\AppData\Roaming\npm\node_modules\node-red-contrib-opcua\node_modules\node-opcua\lib\client\client_subscription.js:558:27) at runCallback (timers.js:666:20) at tryOnImmediate (timers.js:639:5) at processImmediate [as _immediateCallback] (timers.js:611:5).
Slack as indicated that "Looks like the opcua node isnโ€™t handling all the errors it should"
Is there a fix for this?

Read OPC Item Double Message

Hi Mikakaraila,

I tried to read opc item using flow below:
contribopcua001

As you can see the message shows 2 time which makes the gauge reading awkward.
Is this the correct flow? Or did I do it incorrectly? If I use OpcUa-Item then inject, the result is the same.

node-red-contrib-opcua version: 0.2.7
Node-RED version: v0.15.1
Node.js version: v4.6.1
Linux 4.4.11-v7+ arm LE

Connection errors

Mika thanks for this great news.
I'm encountering the following errors.
Have followed install instructions & nmp modules are up to date.
I feel there is something I'm missing?

Jul 21:01:34 - [info] Settings file : ./settings
2 Jul 21:01:34 - [info] User Directory : /home/pi/.node-red
2 Jul 21:01:34 - [info] Flows file : /home/pi/.node-red/flows_NRdev.json
2 Jul 21:01:34 - [info] Server now running at http://127.0.0.1:1880/
2 Jul 21:01:34 - [info] Starting flows
Test server (read items) connecting to opc.tcp://localhost:4334
Test server (browse) connecting to opc.tcp://localhost:4334
Test server (write items) connecting to opc.tcp://localhost:4334
Test server (subscribe item) connecting to opc.tcp://localhost:4334
2 Jul 21:01:34 - [info] Started flows
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (read items)] Test server (read items) client : process terminated with an error
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (read items)] error :
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (read items)] Error: connect ECONNREFUSED
at errnoException (net.js:905:11)
at Object.afterConnect as oncomplete
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (browse)] Test server (browse) client : process terminated with an error
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (browse)] error :
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (browse)] Error: connect ECONNREFUSED
at errnoException (net.js:905:11)
at Object.afterConnect as oncomplete
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (write items)] Test server (write items) client : process terminated with an error
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (write items)] error :
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (write items)] Error: connect ECONNREFUSED
at errnoException (net.js:905:11)
at Object.afterConnect as oncomplete
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (subscribe item)] Test server (subscribe item) client : process terminated with an error
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (subscribe item)] error :
2 Jul 21:01:34 - [info] [OpcUaClient:Test server (subscribe item)] Error: connect ECONNREFUSED
at errnoException (net.js:905:11)
at Object.afterConnect as oncomplete

Problem with reading and writing

I have some problems with reading and writing values. Subscribing is working fine.
With KEPServerEX V5.11 I am getting these errors...
erroropcuanode
erroropcuanoderead
When I try to read and write a value I am getting an error. When I retry this after some secondes it works.
On the Prosys Testserver I am getting other errors...
erroropcuanodeprosys
erroropcuanodereadprosys

I have created an "opcuaitem" by myself with reading a Jason file.

Subscribing works fine with the same processdata as reading on both servers. They are both running on the same PC as the node-red server.

Change Endpoint

Any way to programmatically set or change the Endpoint for the OpcUa Client node?

msg.endpoint = "opc.tcp://..."; (does not seem to work)

Setting/changing msg.action and msg.topic works great...

Unable to set interval for subscribe in msg

setting msg.payload to use an own interval for a subscription instead of the default 100 ms doesn't work.

The reason is the following condition in the code:
if(msg.payload.length>0 && typeof msg.payload === 'number')
This can never be true, because either the payload is passed as a string, then the second condition is wrong or as a number, then first condition is wrong.

Here you can find a fix which allows the interval to be set either as string or as number:

diff -Nau 102-opcuaclient.js.orig 102-opcuaclient.js
--- 102-opcuaclient.js.orig	2017-07-20 12:39:52.986066887 +0000
+++ 102-opcuaclient.js	2017-07-20 08:10:30.506670913 +0000
@@ -564,6 +564,14 @@
       }
     }
 
+    function convertAndCheckInterval(interval) {
+      var n = Number(interval);
+      if (isNaN(n)) {
+        n = 100;
+      }
+      return n;
+    }
+
     function subscribe_monitoredItem(subscription, msg) {
       verbose_log("Session subscriptionId: " + subscription.subscriptionId);
       var nodeStr=msg.topic;
@@ -575,11 +583,7 @@
       var monitoredItem = monitoredItems.get({"topicName": msg.topic});
 
       if (!monitoredItem) {
-        var interval = 100;
-        if (msg.payload.length>0 && typeof msg.payload === 'number') {
-            interval = Number(msg.payload);
-        }
-
+        var interval = convertAndCheckInterval(msg.payload);
         verbose_log(msg.topic + " samplingInterval " + interval);
         verbose_warn("Monitoring Event: " + msg.topic + ' by interval of ' + interval + " ms");
 
@@ -743,12 +747,7 @@
       var monitoredItem = monitoredItems.get({"topicName": msg.topic});
 
       if (!monitoredItem) {
-        var interval = 100;
-
-        if (typeof msg.payload === 'number') {
-          interval = Number(msg.payload);
-        }
-
+        var interval = convertAndCheckInterval(msg.payload);
         verbose_log(msg.topic + " samplingInterval " + interval);
         verbose_warn("Monitoring Event: " + msg.topic + ' by interval of ' + interval + " ms");
         // TODO read nodeId to validate it before subscription





Link OPC UA browse to OPC UA Items

Hi:

I am browsing all items in an specific path (ns=2;s=[Default]PLC-Test) and actually i am getting 6 items.
My problem is how to pass the items path found to set a read or subscription.
In conclusion the goal is to read all tags defined in my Ignition server and create all Read/Subscription items automatically.
Could you please provide an example?

Thanks in advance
browse

Timeout after 60 seconds - OpenSecureChannelChannel

Hello Mika,
we just encountered another issue. Our setup is the following:

  • Linux (Yocto based) with 4.4 kernel
  • NodeJS v6.9.2
  • Node-Red v16.2
  • node-contrib-opcua v0.2.13 / v0.2.14

The issue itself is quite strange. No matter how long the Node-Red instance was running, precisely 60 seconds after the first client subscription the node will time out ("waiting for response for OpenSecureChannelRequest") and cease functionality until the next Node-Red restart. By the way: It does not make any difference wether there is any payload being generated within the mentioned 60 seconds. Also, we successfully checked on a Windows based setup, this issue seems to be bound to Linux.

node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] ns=2;s=Production Data.Pieces.Good value has changed to 11114
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8]       Status-Code:Good (0x00000)
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] Client status: active subscribed
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] ns=2;s=Production Data.Pieces.Good value has changed to 11116
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8]       Status-Code:Good (0x00000)
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] Client status: active subscribed
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] ns=2;s=Production Data.Pieces.Good value has changed to 11117
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8]       Status-Code:Good (0x00000)
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] Client status: active subscribed
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] ns=2;s=Production Data.Pieces.Good value has changed to 11116
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8]       Status-Code:Good (0x00000)
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] Client status: active subscribed
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] ns=2;s=Production Data.Pieces.Good value has changed to 11119
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8]       Status-Code:Good (0x00000)
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] Client status: active subscribed
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] ns=2;s=Production Data.Pieces.Good value has changed to 11120
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8]       Status-Code:Good (0x00000)
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] Client status: active subscribed
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8] ns=2;s=Production Data.Pieces.Good value has changed to 11121
node-red-0 3 Apr 15:12:46 - [info] [OpcUa-Client:b1c81faa.5f0af8]       Status-Code:Good (0x00000)
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d] Client status: active subscribed
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d] ns=2;s=Production Data.Pieces.Actual value has changed to 11150
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d]        Status-Code:Good (0x00000)
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d] Client status: active subscribed
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d] ns=2;s=Production Data.Pieces.Actual value has changed to 11153
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d]        Status-Code:Good (0x00000)
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d] Client status: active subscribed
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d] ns=2;s=Production Data.Pieces.Actual value has changed to 11155
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d]        Status-Code:Good (0x00000)
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d] Client status: active subscribed
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d] ns=2;s=Production Data.Pieces.Actual value has changed to 11157
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:dfdf745a.f051d]        Status-Code:Good (0x00000)
node-red-0  Timeout .... waiting for response for  OpenSecureChannelRequest { /*RequestHeader*/
node-red-0  authenticationToken           /* NodeId                           */: ns=0;i=0
node-red-0  timeStamp                     /* UtcTime                          */: 2017-04-03T15:11:47.876Z
node-red-0  requestHandle                 /* IntegerId                        */: 1               0x1
node-red-0  returnDiagnostics             /* UInt32                           */: 0               0x0
node-red-0  auditEntryId                  /* UAString                         */: null
node-red-0  timeoutHint                   /* UInt32                           */: 0               0x0
node-red-0  additionalHeader              /* ExtensionObject                  */: null
node-red-0 };
node-red-0 3 Apr 15:12:47 - [error] [OpcUa-Client:57e0e81b.0c0a7]  OPC UA connection error: Transaction has timed out
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:57e0e81b.0c0a7] Error: Transaction has timed out
node-red-0 3 Apr 15:12:47 - [info] [OpcUa-Client:57e0e81b.0c0a7] Client status: connection error
node-red-0 warning : disconnection : closing pending sessions
node-red-0  Timeout .... waiting for response for  OpenSecureChannelRequest { /*RequestHeader*/
node-red-0  authenticationToken           /* NodeId                           */: ns=0;i=0
node-red-0  timeStamp                     /* UtcTime                          */: 2017-04-03T15:11:47.894Z
node-red-0  requestHandle                 /* IntegerId                        */: 1               0x1
node-red-0  returnDiagnostics             /* UInt32                           */: 0               0x0
node-red-0  auditEntryId                  /* UAString                         */: null
node-red-0  timeoutHint                   /* UInt32                           */: 0               0x0
node-red-0  additionalHeader              /* ExtensionObject                  */: null
node-red-0 };
node-red-0  Timeout .... waiting for response for  OpenSecureChannelRequest { /*RequestHeader*/
node-red-0  authenticationToken           /* NodeId                           */: ns=0;i=0
node-red-0  timeStamp                     /* UtcTime                          */: 2017-04-03T15:11:47.898Z
node-red-0  requestHandle                 /* IntegerId                        */: 1               0x1
node-red-0  returnDiagnostics             /* UInt32                           */: 0               0x0
node-red-0  auditEntryId                  /* UAString                         */: null
node-red-0  timeoutHint                   /* UInt32                           */: 0               0x0
node-red-0  additionalHeader              /* ExtensionObject                  */: null
node-red-0 };

I would appreciate you taking a look at it.
Many thanks in advance!

Best regards
Mark

OPCUA Client Subscribe value

Hello !

please I still having this problem, even I upgrade the OPCUA node :

"subscription.monitorItem:Error: BadNodeIdUnknown (0x80340000)"

Connection Issue

Hi, I have the following Problem with the OPC UA Client:

Everytime when i'm connecting my OPC UA Client with the Server, the connection is getting lost after a few seconds. In the console i get the following warning:

30 Jun 13:25:20 - [info] Starting flows
[BaseClient:connect] Connecting to IoTF with host : ssl://cje5yu.messaging.internetofthings.ibmcloud.com:8883
30 Jun 13:25:20 - [info] Started flows
[BaseClient:onClose] Connection was closed.
[BaseClient:disconnect] Disconnected from the client.
[GatewayClient:connect] GatewayClient Connected
message was
undefined
message was 2: { /OpenSecureChannelRequest/
requestHeader /* RequestHeader /: {
authenticationToken /
NodeId /: ns=0;i=0
timeStamp /
UtcTime /: 2017-06-30T11:25:20.630Z
requestHandle /
IntegerId /: 1 0x1
returnDiagnostics /
UInt32 /: 0 0x0
auditEntryId /
UAString /: null
timeoutHint /
UInt32 /: 0 0x0
additionalHeader /
ExtensionObject /: null
}
clientProtocolVersion /
UInt32 /: 0 0x0
requestType /
SecurityTokenRequestType /: ISSUE ( 0)
securityMode /
MessageSecurityMode /: NONE ( 1)
clientNonce /
ByteString /: null
requestedLifetime /
UInt32 /: 600000 0x927c0
};
nodeStr=ns=3;s="WerkPos1AVorh"
30 Jun 13:25:38 - [info] [filter:6c8aaadc.1cc564] node-red-filter: message dropped (not matching the 'WerkstInGreifer' regular expression)
30 Jun 13:25:38 - [info] [filter:72441345.a65cfc] node-red-filter: message dropped (not matching the 'WerksFarbe_' regular expression)
30 Jun 13:25:38 - [info] [filter:242ba887.2510b8] node-red-filter: message dropped (not matching the 'sHlftxt' regular expression)
Timeout .... waiting for response for OpenSecureChannelRequest { /RequestHeader/
authenticationToken /
NodeId /: ns=0;i=0
timeStamp /
UtcTime /: 2017-06-30T11:25:20.630Z
requestHandle /
IntegerId /: 1 0x1
returnDiagnostics /
UInt32 /: 0 0x0
auditEntryId /
UAString /: null
timeoutHint /
UInt32 /: 0 0x0
additionalHeader /
ExtensionObject */: null
};
30 Jun 13:26:20 - [error] [OpcUa-Client:a9eae1b0.136b] OPC UA connection error: Transaction has timed out
warning : disconnection : closing pending sessions
warning : ClientSessionKeepAliveManager#ping_server ServiceResult is BadSessionIdInvalid (0x80250000)

Hopefully anyone have an idea to solve this Problem.

time out issue in node-red

while i connect arduino uno with my PC and start node red but it throws an error shown below......
if possible then please help me..........

1510247579548 Device or Firmware Error A timeout occurred while connecting to the Board.

Please check that you've properly flashed the board with the correct firmware.
See: https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting

If connecting to a Leonardo or Leonardo clone, press the 'Reset' button on the board, wait approximately 11 seconds for complete reset, then run your program again.

Connecting inject, function (msg.payload) to OPC Item to OPC Server.

Could not find an example of a OPC Item connect to a Server and to an inject simultaneously?
The data seems not be passing along the flow. How to connect an inject to a Server without the translation function provided in the videos?
Regards
PS: Which software is used on those videos as OPC Client?

Error at RaspberryPi but on Windows it's working

Hello there,
I am a student from Germany and at this moment I am working at a company.

My task is to read something out of a PLC with OPC UA.

My programm has about 8 Flows with 13 OPCUA client nodes, which are reading.
If I deploy only 1-2 Flows there are no problems on my RaspberryPi 3. But if I deploy more, I get the warning:

warning : ClientSessionKeepAliveManager#ping_server   ServiceResult is BadSessionIdInvalid (0x80250000)
 warning : ClientSessionKeepAliveManager#ping_server   ServiceResult is BadSessionIdInvalid (0x80250000)
 message was 
undefined
 message was 2: { /*OpenSecureChannelRequest*/
 requestHeader                 /* RequestHeader                    */: {
   authenticationToken         /* NodeId                           */: ns=0;i=0
   timeStamp                   /* UtcTime                          */: 2017-08-18T19:50:29.933Z
   requestHandle               /* IntegerId                        */: 1               0x1
   returnDiagnostics           /* UInt32                           */: 0               0x0
   auditEntryId                /* UAString                         */: null
   timeoutHint                 /* UInt32                           */: 0               0x0
   additionalHeader            /* ExtensionObject                  */: null
 }
 clientProtocolVersion         /* UInt32                           */: 0               0x0
 requestType                   /* SecurityTokenRequestType         */: ISSUE ( 0)
 securityMode                  /* MessageSecurityMode              */: NONE ( 1)
 clientNonce                   /* ByteString                       */: null
 requestedLifetime             /* UInt32                           */: 600000               0x927c0
};

For about one minute, the programm will run now. But after one minute I get this Error:

Timeout .... waiting for response for  OpenSecureChannelRequest { /*RequestHeader*/
 authenticationToken           /* NodeId                           */: ns=0;i=0
 timeStamp                     /* UtcTime                          */: 2017-08-18T19:50:29.933Z
 requestHandle                 /* IntegerId                        */: 1               0x1
 returnDiagnostics             /* UInt32                           */: 0               0x0
 auditEntryId                  /* UAString                         */: null
 timeoutHint                   /* UInt32                           */: 0               0x0
 additionalHeader              /* ExtensionObject                  */: null
};
18 Aug 19:51:29 - [error] [OpcUa-Client:7ad5e19b.271e7]  OPC UA connection error: Transaction has timed out
warning : disconnection : closing pending sessions

But I get this Errors only at the RaspPi. On Windows I get sometimes the warning but not the Error..
What is my fault? I am searching for a week now and i don't know what's wrong...
EDIT: Sometimes I get the Error also at Windows but not very often and then the Clients are still active

Can you help me?
Thanks in advance and sorry for my bad english..

Valentin

I think it's the same problem like this: https://github.com/mikakaraila/node-red-contrib-opcua/issues/22
But there i found no solution..

subscriptions not working when injected in state "connecting"

Last week I saw multiple times, that there have been up to 177 active OPC UA connections to my test PLC (that's its limit) and none of them was working. The reason was, that I started around 200 item subscriptions before the OPC connection was established, it was in state "connecting".
This happens when you use the flag "inject once at start" of the 'inject' node to trigger the subscriptions to start the flow automatically.

I get the following traces:
[info] Settings file : /data/settings.js
[info] User directory : /data
[info] Flows file : /data/flows.json
[info] Server now running at http://127.0.0.1:1880/
[info] Starting flows
[info] [OpcUa-Client:OPC UA Subscribe] [object Object]
[warn] [OpcUa-Client:OPC UA Subscribe] OPC UA Subscribe: create Client ...
[info] [OpcUa-Client:OPC UA Subscribe] [object Object]
[info] [OpcUa-Client:OPC UA Subscribe] Client status: create client
[info] [OpcUa-Client:OPC UA Subscribe] async series - connecting
[info] [OpcUa-Client:OPC UA Subscribe] Client status: connecting

[info] [inject:cyclic processing] repeat = 60000
[info] Started flows
[warn] [OpcUa-Client:OPC UA Subscribe] OPC UA Subscribe: can't work without OPC UA Session
[warn] [OpcUa-Client:OPC UA Subscribe] OPC UA Subscribe: can't work without OPC UA Session
[warn] [OpcUa-Client:OPC UA Subscribe] OPC UA Subscribe: can't work without OPC UA Session
[info] [OpcUa-Client:OPC UA Subscribe] Client disconnected!
[warn] [OpcUa-Client:OPC UA Subscribe] OPC UA Subscribe: create Client ...
[info] [OpcUa-Client:OPC UA Subscribe] [object Object]
[info] [OpcUa-Client:OPC UA Subscribe] Client status: create client
[info] [OpcUa-Client:OPC UA Subscribe] async series - connecting
[info] [OpcUa-Client:OPC UA Subscribe] Client status: connecting

[warn] [OpcUa-Client:OPC UA Subscribe] OPC UA Subscribe: can't work without OPC UA Session
[warn] [OpcUa-Client:OPC UA Subscribe] OPC UA Subscribe: can't work without OPC UA Session
[warn] [OpcUa-Client:OPC UA Subscribe] OPC UA Subscribe: can't work without OPC UA Session
[info] [OpcUa-Client:OPC UA Subscribe] Client disconnected!
[warn] [OpcUa-Client:OPC UA Subscribe] OPC UA Subscribe: create Client ...
[info] [OpcUa-Client:OPC UA Subscribe] [object Object]
[info] [OpcUa-Client:OPC UA Subscribe] Client status: create client

In a function node between the inject node and the OPC UA Client node, I use roughly the following code (but with around 200 items):

const interval = 1000;
let items = [
    {
    	'name': 'Serialnumber',
    	'topic': 'ns=3;s=SerialNumber',
    	'datatype': 'String',
    	'payload': interval
    },
    {
    	'name': 'SoftwareRevision',
    	'topic': 'ns=3;s=SoftwareRevision',
    	'datatype': 'String',
    	'payload': interval
    },
    {
    	'name': 'Manufacturer',
    	'topic': 'ns=3;s=Manufacturer',
    	'datatype': 'LocalizedText',
    	'payload': interval
    }
];
return [items];

I already made a fix which I'm still testing, see my fork.

Auto generated Server Status

Hello,
im currenty working on my Masterthesis. For the implementation of my project im using Node-Red.
I've installed Node-red and Node-red-contrib-opcua on my Windows Computer and started my project. Everything worked fine so far. So I have to install my flows on a Linux server (Ubuntu 16.04.2). As far as I can tell the installation of Node-red and the other additional Modules worked fine and I'm able to start node-red. But while loading Node-red, i get the following Error-Messages:

16 May 12:55:20 - [warn] [OpcUa-Browser] Error: Cannot find module 'generated/_auto_generated_ServerStatus'
16 May 12:55:20 - [warn] [OpcUa-Client] Error: Cannot find module 'generated/_auto_generated_ServerStatus'
16 May 12:55:20 - [warn] [OpcUa-Event] Error: Cannot find module 'generated/_auto_generated_ServerStatus'
16 May 12:55:20 - [warn] [OpcUa-Item] Error: Cannot find module 'generated/_auto_generated_ServerStatus'
16 May 12:55:20 - [warn] [OpcUa-Server] Error: Cannot find module 'generated/_auto_generated_ServerStatus'

I'v already checked for the latest version and I also tried to reinstall it. I rally hope you can help me, with my issue.

Kind regards
Philip

Cannot locate certificate file

Hi ,

I am trying to create OPC UA Browser using node-red and I am following example https://www.youtube.com/watch?v=LaUmhhMdoyY

I am trying to connect to PLC system and Allen-Bradley ControlLogix Ethernet - ControlLogix 5500 using

opc.tcp://MyIPAddress:44818

When I try to view the UI Page what I have developed I am getting following error and I have no idea what does it mean.

Error: cannot locate certificate file C:\Users<USER>\AppData\Roaming\npm\node_modules\node-red-contrib-opcua\node_modules\node-opcua\certificates\client_selfsigned_cert_1024.pem

Look forward for your reply.

Dharmesh

Missing genrsa -rand option

Hi Mika,
I am trying to use the lib with alpine linux with libressl, but the -rand option is missing.
The installation went wrong, and produced the following error:

OpenSSL version : LibreSSL 2.6.3
ERROR Command failed: "openssl" genrsa -out private/cakey.pem -rand random.rnd 2048
usage: genrsa [args] [numbits]
-des encrypt the generated key with DES in cbc mode
-des3 encrypt the generated key with DES in ede cbc mode (168 bit key)
-idea encrypt the generated key with IDEA in cbc mode
-aes128, -aes192, -aes256
encrypt PEM output with cbc aes
-camellia128, -camellia192, -camellia256
encrypt PEM output with cbc camellia
-out file output the key to 'file
-passout arg output file pass phrase source
-f4 use F4 (0x10001) for the E value
-3 use 3 for the E value

Command failed: "openssl" genrsa -out private/cakey.pem -rand random.rnd 2048
usage: genrsa [args] [numbits]
-des encrypt the generated key with DES in cbc mode
-des3 encrypt the generated key with DES in ede cbc mode (168 bit key)
-idea encrypt the generated key with IDEA in cbc mode
-aes128, -aes192, -aes256
encrypt PEM output with cbc aes
-camellia128, -camellia192, -camellia256
encrypt PEM output with cbc camellia
-out file output the key to 'file
-passout arg output file pass phrase source
-f4 use F4 (0x10001) for the E value
-3 use 3 for the E value

done ... (0)

Can the installation produces rsa keys without using -rand?

Write an Array?

I'm not seeing how one would write to a tag that holds an array of values?

Is this a gap, or am I just missing how to do this?

Best I can tell the build_new_variant function would need to be modified to handle the case where value is an array.

A quick/naive implementation would look something like:

module.exports.build_new_variant = function (opcua, datatype, value) {

    var nValue = new opcua.Variant({dataType: opcua.DataType.Float, value: 0.0});

    var arrVal;
    if(Array.isArray(value)){
        arrVal = value;
    }

    switch (datatype) {
        case "Float":
            nValue = new opcua.Variant({dataType: opcua.DataType.Float, value: arrVal || parseFloat(value)});
            break;
        case "Double":
            nValue = new opcua.Variant({dataType: opcua.DataType.Double, value: arrVal || parseFloat(value)});
            break;
        case "Int32":
            nValue = new opcua.Variant({dataType: opcua.DataType.Int32, value: arrVal || parseInt(value)});
            break;
        case "Int16":
            nValue = new opcua.Variant({dataType: opcua.DataType.Int16, value: arrVal || parseInt(value)});
            break;
        case "Int8":
            nValue = new opcua.Variant({dataType: opcua.DataType.Int8, value: arrVal || parseInt(value)});
            break;
        case "UInt32":
            nValue = new opcua.Variant({dataType: opcua.DataType.UInt32, value: arrVal || parseInt(value)});
            break;
        case "UInt16":
            nValue = new opcua.Variant({dataType: opcua.DataType.UInt16, value: arrVal || parseInt(value)});
            break;
        case "UInt8":
            nValue = new opcua.Variant({dataType: opcua.DataType.UInt8, value: arrVal || parseInt(value)});
            break;
        case "Boolean":
            if (value && value !== "false") {
                nValue = new opcua.Variant({dataType: opcua.DataType.Boolean, value: true});
            }
            else {
                nValue = new opcua.Variant({dataType: opcua.DataType.Boolean, value: false});
            }
            break;
        case "String":
            nValue = new opcua.Variant({dataType: opcua.DataType.String, value: arrVal || value});
            break;
        default:
            nValue = new opcua.Variant({dataType: opcua.DataType.BaseDataType, value: arrVal || value});
            break;
    }

    return nValue;
};

Cannot restart node-red after critical OPC server error.

Hello,
I implemented an OPC item flow to an OPC Server and I got the following error in console:
erroropc
I cannot even restart node-red now.
Do you know the cause?
Seems that the server is still open but I checked netstat in cmd and I didn't find any 53880 port opened.
Best regards,
Andrรฉ

Only one node visible: OpcUaItem - missing OpcUaClient & OpcUaBrowse

I cloned the current node-red repository (v0.12.2 according to node-red package.json), npm installed it, and installed the node-red-contrib-opcua via npm install git://github.com/mikakaraila/node-red-contrib-opcua.
However, I can only find the OpcUaItem under Advanced, and I am missing the OpcUaClient OpcUaBrowse node. (see attached screenshot)
Any ideas why?

Thank you for your feedback.
Please let me know, if you need more information.
2015-11-30 23_40_32-node-red screenshot

OPC UA Client gets stuck on Active Reading

Maybe this is a user error and quite possibly as I'm new to these libraries and nodes.

I'm testing against the Prosys OPC UA Simulation Server right now too.

  1. I have a simple flow which has

Inject -> Opc-ua-Client -> Template -> Debug

and an equivalent using the Opc-ua-item node:

Inject -> Opc-ua-item Opc-ua-node -> Template -> Debug

  1. The actual test Node-RED flow is as below:

[{"id":"a3631fd0.4642b","type":"inject","z":"a73edfd3.234468","name":"","topic":"ns=2;s=MyEnumObject","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":189,"y":199,"wires":[["679e58b9.b0ad2"]]},{"id":"679e58b9.b0ad2","type":"OpcUa-Client","z":"a73edfd3.234468","endpoint":"4c718b59.85a844","action":"read","time":"","name":"Test server (read items)","x":532,"y":195.75,"wires":[["a9c05ba8.7b0cf8"]]},{"id":"a9c05ba8.7b0cf8","type":"template","z":"a73edfd3.234468","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"This is the payload","x":649,"y":279.5,"wires":[["b25e574c.3ad488"]]},{"id":"603a079a.1725c8","type":"inject","z":"a73edfd3.234468","name":"Read","topic":"ns=2;s=MyEnumObject","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":151,"y":97.75,"wires":[["e0785202.82a4a8"]]},{"id":"e0785202.82a4a8","type":"OpcUa-Item","z":"a73edfd3.234468","item":"ns=2;s=MyEnumObject","datatype":"Int32","value":"","name":"FreeMemoryItem","x":323,"y":104.75,"wires":[["679e58b9.b0ad2"]]},{"id":"b25e574c.3ad488","type":"debug","z":"a73edfd3.234468","name":"Read value","active":true,"console":"false","complete":"true","x":681,"y":347.75,"wires":[]},{"id":"4c718b59.85a844","type":"OpcUa-Endpoint","z":"","endpoint":"opc.tcp://localhost:53530/OPCUA/SimulationServer","login":false}]

  1. The flow that uses which uses the Topic field of the inject node always returns an error along with the read. However the Info documentation for the Opc-ua-client states that you only have to set the Topic field of the inject node to be the NodeId e.g. ns=;i= or ns=;s= however using an Opc-ua-item ad setting the Item to the NodeId performs a clean read.

  2. Additionally, when using the Inject node / Topic combination, the flow never progresses beyond the Opc-ua-client, it gets stuck (or bails out) on that node. And just leaves the state in Active Reading which still works for subsequent injects but I'd expect to see an output flow on error?

So I guess two possible issues (I may have misunderstood the expected behaviour):

  1. I cannot see a way to dynamically query in Node-RED using these nodes, as Opc-ua-item hard codes the NodeId into the node. No way of dynamically added a NodeId using e.g. msg.topic without hitting the errors above and not getting any output from the Opc-ua-client?

  2. Why does the opc-ua-client hang on an error and not provide an error output?

Any help/thoughts/comments are appreciated,

Many thanks, Andy

How to add variable?

Hi Mika,

How can I add variable or node so that I can create my own OPC UA server?
Is the command not yet supported? Because I can only add equipment and physical asset at the moment.

Problem with write to the OPC server

Hi,
I'm using this node on Raspberry pi 3. I'm using node-opcua as a server.

When I tried to use your example ExampleFlow.json and I just changed the OPC server, it is not writing to the OPC server variables. The value is still the same.

The OpcUa-Client node having this status: Active writing, but it is still there, with no change. Even the debugger has no information.

Here is the writing and reading example:
[{"id":"5f334c75.a5b744","type":"OpcUa-Item","z":"f7029c5.3c5f86","item":"ns=1;i=1020ffaa;datatype=Double","datatype":"Double","value":"20","name":"","x":281.00000762939453,"y":107.00000381469727,"wires":[["b7f8a70b.9b2898"]]}]

Here is the server code: https://github.com/node-opcua/node-opcua/blob/master/documentation/sample_server.js

Thank you for your help.

Extention for browse results?

Hi,
if I use the OPCua browser I currently get something like
{ "referenceTypeId": "ns=0;i=47", "isForward": "true", "nodeId": "ns=4;s=MY.PATH", "browseName": { "namespaceIndex": "4", "name": "MY_VARIABLE" }, "displayName": { "text": "MY_VARIABLE", "locale": "" }, "nodeClass": "Variable", "typeDefinition": "ns=0;i=63" }
I'm missing information about datatype and value and I don't know if it's an "issue" of this project or of node-opcua. I just need some additional information, something like the following
{ ... "value": { "value": 0, "datatype": "Int16" }, ... }
That would suit all my needs :-)
Kind regards,
Stefi

Turn on/off and reset client connection

Hi all,
I'm currently trying to connect 3 different, not permanently to the network connected devices via OPC-UA. These 3 devices host an OPC-UA server each, so node-red is connecting to them via the client node.
When a device is connected to the network and I e.g. deploy the new flows a connection by the client node is established and it's working.
If one of the devices leaves the network and rejoins the OPC-UA client node is unable to reestablish the connection due to the timeout error.
Is there a way to start/stop the connection manually and/or retrigger the connection e.g. by a switch node?

Thanks in advance.
dgP

0x891e307 Fatal error in , line 0 - unreachable code

I am running node-red on a Yocto Linux System (Processor: Intel Quarkยฎ x1020 400 MHz).

My application includes a S7-Node (node-red-contrib-s7) to read out values of a PLC (this is currently a test value which changes every 15sec from true to false and vice versa).
An OPCUA-Server-Node (node-red-contrib-opcua) is initialized with the creation of a Boolean-variable and creates an OPCUA-Server to further read out the Data via OPC protocol.
An OPC-Client writes the incoming true/false values from the PLC to the OPCUA-Server.

After an unspecified time period (approx. 20-40 min) node-red crashes.


Welcome to Node-RED
===================

22 Jun 07:53:37 - [info] Node-RED version: v0.15.2
22 Jun 07:53:37 - [info] Node.js  version: v6.9.2
22 Jun 07:53:37 - [info] Linux 4.4.18-yocto-standard ia32 LE
22 Jun 07:53:52 - [info] Loading palette nodes
22 Jun 07:55:13 - [info] Dashboard version 2.1.0 started at /ui
22 Jun 07:55:14 - [warn] ------------------------------------------------------
22 Jun 07:55:14 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
22 Jun 07:55:14 - [warn] ------------------------------------------------------
22 Jun 07:55:14 - [info] Settings file  : /home/root/.node-red/settings.js
22 Jun 07:55:14 - [info] User directory : /home/root/.node-red
22 Jun 07:55:14 - [info] Flows file     : /home/root/.node-red/flows_iot2000.json
22 Jun 07:55:15 - [info] Server now running at http://127.0.0.1:1880/
22 Jun 07:55:15 - [debug] red/runtime/nodes/credentials.load : no user key present
22 Jun 07:55:15 - [debug] red/runtime/nodes/credentials.load : using default key
22 Jun 07:55:15 - [info] Starting flows
22 Jun 07:55:35 - [info] Started flows
22 Jun 07:55:36 - [info] [debug:9e445757.340408]
{ opcuaCommand: 'addVariable' }
22 Jun 07:56:39 - [info] [debug:7f92b9a0.ab1b8] true
22 Jun 07:56:39 - [error] [OpcUa-Client:WRITE ] WRITE  OPC UA connection error: connect ECONNREFUSED 127.0.0.1:53880
22 Jun 07:56:39 - [info] [OpcUa-Client:WRITE ] TESTLOG: RESET CLIENT NACH CONNECTION ERROR
 Bad Session in  _on_ActivateSessionRequest 030691667bf38f6e20b540681a3c7a3e
22 Jun 07:57:29 - [error] [s7 endpoint:ac2f8250.edec] Failure (Bad values)
22 Jun 07:57:31 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 07:57:37 - [info] [debug:7f92b9a0.ab1b8] true
 Timeout .... waiting for response for  OpenSecureChannelRequest { /*RequestHeader*/
 authenticationToken           /* NodeId                           */: ns=0;i=0
 timeStamp                     /* UtcTime                          */: 2017-06-22T07:56:39.362Z
 requestHandle                 /* IntegerId                        */: 1               0x1
 returnDiagnostics             /* UInt32                           */: 0               0x0
 auditEntryId                  /* UAString                         */: null
 timeoutHint                   /* UInt32                           */: 0               0x0
 additionalHeader              /* ExtensionObject                  */: null
};
 Timeout .... waiting for response for  CloseSecureChannelRequest { /*RequestHeader*/
 authenticationToken           /* NodeId                           */: ns=0;i=0
 timeStamp                     /* UtcTime                          */: 2017-06-22T07:56:39.667Z
 requestHandle                 /* IntegerId                        */: 2               0x2
 returnDiagnostics             /* UInt32                           */: 0               0x0
 auditEntryId                  /* UAString                         */:
 timeoutHint                   /* UInt32                           */: 0               0x0
 additionalHeader              /* ExtensionObject                  */: null
};
22 Jun 07:57:43 - [error] [s7 endpoint:ac2f8250.edec] Failure (Bad values)
22 Jun 07:57:43 - [error] [OpcUa-Client:WRITE ] WRITE  OPC UA connection error: Transaction has timed out
22 Jun 07:57:43 - [info] [OpcUa-Client:WRITE ] TESTLOG: RESET CLIENT NACH CONNECTION ERROR
22 Jun 07:57:56 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 07:58:06 - [info] [debug:9e445757.340408]
{ opcuaCommand: 'addVariable' }
22 Jun 07:58:08 - [info] [debug:7f92b9a0.ab1b8] true
22 Jun 07:58:23 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 07:58:39 - [info] [debug:7f92b9a0.ab1b8] true
22 Jun 07:58:55 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 07:59:10 - [info] [debug:7f92b9a0.ab1b8] true
...
...
...
22 Jun 08:17:57 - [info] [debug:7f92b9a0.ab1b8] true
22 Jun 08:18:13 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 08:18:28 - [info] [debug:7f92b9a0.ab1b8] true
22 Jun 08:18:44 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 08:18:59 - [info] [debug:7f92b9a0.ab1b8] true


#
# Fatal error in , line 0
# unreachable code
#

==== C stack trace ===============================

 1: V8_Fatal
 2: 0x891e307
 3: v8::internal::LCodeGenBase::GenerateBody()
 4: v8::internal::LCodeGen::GenerateCode()
 5: v8::internal::LChunk::Codegen()
 6: v8::internal::OptimizedCompileJob::GenerateCode()
 7: v8::internal::Compiler::FinalizeOptimizedCompileJob(v8::internal::OptimizedCompileJob*)
 8: v8::internal::OptimizingCompileDispatcher::InstallOptimizedFunctions()
 9: v8::internal::StackGuard::HandleInterrupts()
10: v8::internal::Runtime_StackGuard(int, v8::internal::Object**, v8::internal::Isolate*)
11: 0x3dd0a07e
12: 0x3c43c8df
13: 0x3dd1fd9e
14: 0x3dd1bd23
15: 0x85da06a
16: v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*)
17: v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*)
18: v8::Function::Call(v8::Local<v8::Value>, int, v8::Local<v8::Value>*)
19: node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*)
20: 0x89a5cbb
21: 0x89f1d30
22: uv_run
23: node::Start(int, char**)
24: main
25: __libc_start_main
Illegal instruction

I want to understand why node crashes randomly. Can anybody help?

Unsubscibe?

Hi,

I'm succesfully using the Client to subscribe to a server on a PLC. Now I would like to unsubscribe from a topic or close the session of the Client. I can't find how to do this. Is it possible with the current version?

Regards,
Markus

PS: Thanx for the great work.

Problem: connection with credentials

Hey
For a university project i try to connect a opc client in node red to a molding machine with an OPC UA server.

The connection is with no SecurityPolicy and SecurityMode but with credentials.
The Connection works with other clients (UA Expert) but node-red opcua returns:

Error: Cannot find ANONYMOUS user token policy in end point description"

Shouldn't there be a username token policy when i use credentials?

iยดm very thankful for some help!

Missing some browse attributes while browsing

Hi Mika,

thanks for pointing me how to browse/read OPC/UA data points using node-RED.
Browsing an OPC/UA data point I should also have:

  • Description "Room 15"
  • DataType (Bool, Double, ...)
  • AccessLevel (CurrentRead, CurrentWrite)
  • UserAccessLevel (CurrentRead, CurrentWrite)

Can you add this missing fields to the main stream?

Thanks a lot

Can't connect to OPC UA server using endpoint security

Hi,

I just tried to use a OPC UA client node in order to perform a subscription. The connection to the OPC UA server should be established with security policy "Basic128Rsa15 signed+encrypted". I can click "Update" when configuring the endpoint settings without getting any errors but when I try to connect to the server I get

11 Apr 11:10:40 - [error] [OpcUa-Client:Subscription] Subscription OPC UA connection error: End point must exist [...]

I found out that my endpoint configration wouldn't be saved correctly. It saves the endpoint URL and user credentials but not the value selected for "Sign" (in my case "Basic128Rsa15 signed+encrypted"). It always switchs back to "None" as security policy and this is (intentionally) not configured on the device. Thus no connection possible.

What am I missing?

Thanks in advance!

node version: v6.9.5
node-red version: v0.16.2

Node-Red crashes when injecting incorrect NodeID into OpcUA-Client node

Hello, I am experiencing a crash of Node-Red when subscribing to a miss-typed/incorrect NodeID. I'm injecting the namespace and NodeID using the injection node. If I use the correct values, everything is working as expected.

Let's assume, the correct NodeID would be "TestVerzeichnis.TestKnoten". When we mess it up to "TestVerzeichnis.TestKnotn" we are receiving the following error:
"subscription.monitorItem:Error: BadNodeIdUnknown (0x80340000)"

So far, so good - when I inject again, Node-Red would crash with the following error (sorry for the poor format, editor doesn't wrap correctly...):

node-red-0 21 Feb 12:18:26 - [warn] [OpcUa-Client:94a092f2.3a43b] OpcUaClientNode: Monitoring Event: ns=2;s=TestVerzeichnis.TestKnotn by interval of 0 ms node-red-0 AssertionError: self.subscription.session node-red-0 at ClientMonitoredItem._monitor (/home/root/.node-red/node_modules/node-opcua/lib/client/client_monitored_item.js:190:5) node-red-0 at Immediate.wait_for_subscription_and_monitor (/home/root/.node-red/node_modules/node-opcua/lib/client/client_subscription.js:558:27) node-red-0 at runCallback (timers.js:637:20) node-red-0 at tryOnImmediate (timers.js:610:5) node-red-0 at processImmediate [as _immediateCallback] (timers.js:582:5) node-red-0 21 Feb 12:18:26 - [red] Uncaught Exception: node-red-0 21 Feb 12:18:26 - AssertionError: self.subscription.session node-red-0 at ClientMonitoredItem._monitor (/home/root/.node-red/node_modules/node-opcua/lib/client/client_monitored_item.js:190:5) node-red-0 at Immediate.wait_for_subscription_and_monitor (/home/root/.node-red/node_modules/node-opcua/lib/client/client_subscription.js:558:27) node-red-0 at runCallback (timers.js:637:20) node-red-0 at tryOnImmediate (timers.js:610:5) node-red-0 at processImmediate [as _immediateCallback] (timers.js:582:5) node-red-0 21 Feb 12:18:28 - [info]

I am using Node-Red v0.16.2 with node-red-contrib-opcua v0.2.13 on an Ubuntu host, yet I did test with Node-Red v0.15.1 and node-red-contrib-opcua v0.2.11 on a Raspberry Pi with the same result.

I would greatly appreciate someone taking a look at it. Many thanks!!

Mark

error in 102-opcuaclient

When using the Prosys OPC UA Simulation server with the example flow as defined in the Libraries (https://flows.nodered.org/flow/ec7e2ba5d204214b960c), I'll get an error when pressing the Subscribe Events (250ms) injector. The error is:

MessageBuilder : ERROR DETECTED IN event handler
ReferenceError: valid is not defined
at C:\Users\Admin.node-red\node_modules\node-red-contrib-opcua\opcua\102-op
cuaclient.js:774:20

Looking in the code, the var VALID isn't defined and I don't see any use for it. Commenting it seems to solve the problem.

My inventory:

  • Prosys OPC UA Simulation server (v2.3.2-146)
  • node-red v0.17.5
  • node.js v6.11.3
  • dashboard 2.5.1
  • Windows 7 (6.1.7600) x64 system

Monitored item twice

Hello,

I have installed the example flow from here https://github.com/mikakaraila/node-red-contrib-opcua/blob/eeba8e62e0068ac64a155fc0e3381554690e61a5/examples/ExampleFlow.json

I only used the "Subscribe (100ms)" inject and I configured the item according to my opc ua server. As a result I got always two messages at every interval. For your information, my item is a simple counter with a +1 every 500 msec.

Is this normal ?

Regards

Christophe Absil

PS : you are doing a great job keep going.

Not connecting!

I'm trying to get the data from an Siemens WinCC OPC Server into InfluxDB using node-red, but it's not working... seems that the OPC Client is not working properly...

When I watched the videos, there's always an icon showing that the OPC is connected, it's not appearing in my case.

I'm sure the OPC UA Server is workin, as you could see in the Unified Automation UAExpert Client.

capturar

capturar

capturar

Do you have any clue?

Clients are unable to modify items on node-red OPC UA server

Hello,

in a node red flow I added some items to a node-red OPC UA server using the 'addVariable' command.

My problem is that OPC UA clients are not able to modify these items. It seams that the missing setter for the item value in '104-opcuaserver.js' is the reason for this behavier. The following code resolves the issue:

	...
	var opcuaBasics = require('./opcua-basics');
	...
	addressSpace.addVariable({
		componentOf: addressSpace.findNode(parentFolder.nodeId),
		nodeId: name,
		browseName: browseName, // or displayName
		dataType: opcuaDataType,
		value: {
			get: function() {
				return new opcua.Variant({dataType: opcuaDataType, value: variables[browseName]})
			},
			set: function (variant) {
				variables[browseName] = opcuaBasics.build_new_value_by_datatype(variant.dataType, variant.value);
				return opcua.StatusCodes.Good;
			}
		}
	});
	...

Best regards,
Volker

Can't write Byte Type

Hi,

I am currently reviewing the node to interact with Beckhoff PLC.

I can read and write successfully boolean, int16.

I can read successfully Byte type (and datatype is indeed reported as byte).

I cannot write Byte type, no errors but the value never changes in the node.

Works from other OPC-UA client.

Thanks for help!

Martin

OPC/UA session is still open after node execution or redeployment

Hi Mika,

I found out that I had a bunch of opened opc-ua browse node sessions looking at my opc-ua client.

If I redeploy or trigger an opc-ua node the browse node session persist and is not closed after execution.
My workaround is to restart node-red server to get rid of this sessions.

Is there a way to close the browse node #session after execution or redeployment?

OpcUa-Client Node Missing

After installing with npm install node-red-contrib-opcua there is no node "npm install node-red-contrib-opcua" available in node-red.

unbenannt

Write Double value issue

Using the same flow to write Boolean from my client as in examples/ProsysOpcUaFlow.json I'm able to set a Boolean value, but when my variable is of type Double it send NaN instead of 1 as value to my OPC server!

Certificate Error

Node-Red V. 0.17.5
NodeJS V8.9.1
Windows Server 2012 R2 on AWS
node-red-contrib-opcua v 0.2.22

Error Message while trying to utilize OPC UA browser to a UI template node.
Utilizing Kepware ServerEX OPC UA server with all security turned off for testing purposes.

"Error: cannot locate certificate file C:\Users\DLABUDOV.node-red\node_modules\node-opcua\certificates\client_selfsigned_cert_1024.pem"

I have checked this path, and the file exists. Also, i am sitting behind corp. proxy so i had to manually download openssl and run it to create certification fold with cert files.

Node Clipboard
[{"id":"c4c870b0.f6c58","type":"OpcUa-Browser","z":"47b2a9d7.488c74","endpoint":"4ba0ce65.716ad8","item":"","datatype":"","topic":"","items":[],"x":380,"y":159,"wires":[["f11356c8.de74e8"]]},{"id":"4ba0ce65.716ad8","type":"OpcUa-Endpoint","z":"47b2a9d7.488c74","endpoint":"opc.tcp://170.168.11.78:4840","secpol":"None","secmode":"NONE","login":false}]

Any suggestions?

Http Request Write To PLC

Hi Mika,

right now, Iโ€™m trying to write data to an plc via our opc ua client module. For Boolean I, have already find a way, with fixed values for every http slot (it is workingโ€ฆ.). But now Iโ€™m struggling with Int values, because I like to use the data inside the payload. Did you have any suggestions?

Thank you upfront

Rico

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.