mikakaraila / node-red-contrib-opcua

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

OPC UA Client - after inactivity never returns subscribed despite loop inject. #563

Open adm91002947 opened 1 year ago

adm91002947 commented 1 year ago

Hi, i hope that someone has also encountered this case and can help me or be unblocked as well. Here's my issue:

My OPC UA client, after more than 12h of inactivity, doesn't stay in "keepalive" or "active subscribed" despite my injection loop with 60 minutes interval. I then tried to set credentials to make sure I could re-authenticate the request on the same channel, but it didn't work.

It remains stuck at "active subscribing", but doesn't switch to "active subscribed". active-subscribing active subscribed

What would be the best practices here to apply to make sure that despite after several hours/days of inactivity I don't need to manually come and inject a timestamp to subscribe again? timestamp-aj

I was thinking of injecting an unsubscribe and resubscribe at the end of my inactivity period, to make sure I'm listened to after the inactivity period.

thank you in advance for your help :)

mikakaraila commented 1 year ago

Normal timeout is something like 50s to 10min not to 1hour.

One way to ensure is to add into the monitored item a counter that will count every second or with 10s interval. I expect server actually limits session or subscription timeout less than you expect.

adm91002947 commented 1 year ago

Normal timeout is something like 50s to 10min not to 1hour.

One way to ensure is to add into the monitored item a counter that will count every second or with 10s interval. I expect server actually limits session or subscription timeout less than you expect.

Hi, thank you for your feedback.

the problem is that on my OPCUA server, I have several anonymous connections to it each time, and there's no log in the systemctl node-red I have to restart the flows to return to keep alive mode because sometimes it's stuck in "active subscribING" and not "active subscribED". but the loop should be enough, even if I set a 10-minute delay, right?

What do you mean by adding a 10s interval counter? And if I use the OpcuaCommand with a "KeepSessionAlive: true" wouldn't it solve my problem?

Sincerely