Restoring a subscription after the server connection is lost #1534
-
I use client python-opcua to connect to server node-opcua. The connection status is monitored by keepalive. Created a subscription for 10-20 nodes. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Switch to asyncua first. If you add/remove nodes on demand, you have to remember the subscribed nodes your self, for example make a list or dict and store all subscribed nodes. When you reconnect you subscribe to all nodes in this list. |
Beta Was this translation helpful? Give feedback.
Switch to asyncua first.
Then you can used a modified https://github.com/FreeOpcUa/opcua-asyncio/blob/master/examples/client-reconnect.py.
If you add/remove nodes on demand, you have to remember the subscribed nodes your self, for example make a list or dict and store all subscribed nodes. When you reconnect you subscribe to all nodes in this list.