mikakaraila / node-red-contrib-opcua

A Node-RED node to communicate OPC UA. Uses node-opcua library.
Other
216 stars 197 forks source link

On msg.action : Disconnect to a OPC UA Client the Node Red Application crashes #709

Closed edcWre closed 2 months ago

edcWre commented 4 months ago

Hi, I am using node-red-contrib-opc-ua to fetch data from a Sinumerik 840 dsl. Unfortunately, I have the problem that my Node-RED application crashes when the Sinumerik has been off overnight. Is there a way to automatically disconnect the connection at the end of the workday and reconnect it in the morning? I tried using msg.action: disconnect from the example folder, but the application crashes as well.

Thank you very much for your help.

In the following im going to show you the error Message im getting shortly after i inject the disconnect:

Error node red

and a picture of my flow :

error flow

my system im Using : 27 Jun 12:57:56 - [info] Node-RED version: v3.1.9 27 Jun 12:57:56 - [info] Node.js version: v20.13.1 27 Jun 12:57:56 - [info] Windows_NT 10.0.22631 x64 LE 27 Jun 12:57:57 - [info] Loading palette nodes 27 Jun 12:57:57 - [info] Dashboard version 3.6.5 started at /ui

node-red-contrib-opc ua : 0.2.329

mikakaraila commented 4 months ago

Hmm, most probably debug warning seems to use parameter that is not defined and tries to show name of the node.

edcWre commented 4 months ago

Okay thank you for your thougths . Is there a way to do a similar action then Disconnect with something else ?

edcWre commented 4 months ago

Another Question that i have. Im using node red in a factory and if the maschines are turned off the clinet trys to reconnect and mostly on the next morning the application has crashed. Is there a solution for this problem ?

mikakaraila commented 4 months ago

I think I should update node-opcua package. The latest version contains a lot improvements for edge / network connection issues.

Look: https://github.com/node-opcua/node-opcua/releases/ Specially v2.124.0

mikakaraila commented 2 months ago

I added check that should prevent crash.