issue_owner_repo
listlengths
2
2
issue_body
stringlengths
0
262k
issue_title
stringlengths
1
1.02k
issue_comments_url
stringlengths
53
116
issue_comments_count
int64
0
2.49k
issue_created_at
stringdate
1999-03-17 02:06:42
2025-06-23 11:41:49
issue_updated_at
stringdate
2000-02-10 06:43:57
2025-06-23 11:43:00
issue_html_url
stringlengths
34
97
issue_github_id
int64
132
3.17B
issue_number
int64
1
215k
[ "FreeOpcUa", "opcua-asyncio" ]
The results of some tests like `test_secure_channel_key_expiration` are inconsistent and fail accidentally. e.g. https://github.com/FreeOpcUa/opcua-asyncio/actions/runs/6141995241/job/16663096954?pr=1432
Tests are flaky
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1433/comments
1
2023-09-11T07:36:33Z
2023-09-11T07:53:45Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1433
1,889,864,902
1,433
[ "FreeOpcUa", "opcua-asyncio" ]
The current [`check_certificate`](https://github.com/FreeOpcUa/opcua-asyncio/blob/master/asyncua/crypto/uacrypto.py#L281) might be a bit too strict on the client side. For instance when connecting to an Ignition OPCUA server, I'm hitting 2 failed checks: ``` 1. certificate does not contain the application uri ({application_uri}). Most applications will reject a connection without it. 2. certificate does not contain the hostname in DNSNames {hostname}. Some applications will check this. ``` these will be logged for each new connection as an error, and yet the connection works fine. There is also no way of disabling these short of monkeypatching. I'm not very knowledgeable about certificate validation best practices, and could be mistaken, but I feel it's not really client's role to do such strong enforcement of certificates. In particular, logging as an error that "Most (or some) applications " will fail with this certificate, does seem to be a false positive when the application works fine. **Version**<br /> Python-Version: 3.11 opcua-asyncio Version: master
Client side check_certificate is producing false positives
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1430/comments
6
2023-09-07T15:47:32Z
2023-09-10T08:37:55Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1430
1,886,153,584
1,430
[ "FreeOpcUa", "opcua-asyncio" ]
It would be nice if the changelog was kept up to date for releases. For instance, otherwise it's hard to know what were exactly the changes in the last two bug fix release, particularly given that PRs are not squashed. Thanks!
Keeping the changelog up to date
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1428/comments
0
2023-09-07T08:50:31Z
2023-09-07T08:50:31Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1428
1,885,415,230
1,428
[ "FreeOpcUa", "opcua-asyncio" ]
I'm trying to get a value of a node in my OPCUA server. I'm using `asyncua` on a windows 10 x64 computer. The server is on a PLC. When I write this in a normal task it works ``` client = Client("opc.tcp://192.168.1.88:4840") # client.max_chunkcount = 5000 # in case of refused connection by the server # client.max_messagesize = 16777216 # in case of refused connection by the server client.connect() ``` But when I use the basic example using an `async` function with the await the line, await client.connect() Returns a `timeoutError` with `asyncio.exceptions.CancelledError` but nothing else to explain why it doesn't work. I would've kept trying without the the await but when I try to get my value with `client.nodes.root.get_child([...])` the returned value prints `<coroutine object Node.get_child at 0x000002C38EE45E40>` (when it should be a simple integer or boolean) and I don't know what to do with that so I guess I should keep going with the examples. Do you have any idea why await `client.connect()` return this exception ? I also tried with 2 different (and built under different langages) opcua clients just to be sure it wasn't the server that was broken. And the clients can connect properly. The code can connect with await when I launch locally an opcua server using `\Python311\Scripts>uaserver --populate`
Can't connect asynchronously to opcua server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1426/comments
30
2023-09-06T14:53:28Z
2023-10-02T07:29:37Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1426
1,884,194,354
1,426
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> Deserializer for dataclass does not fill the optional field if it is `None`. **To Reproduce**<br /> ```python from dataclasses import dataclass, field from typing import Optional from asyncua import ua from asyncua.ua.ua_binary import struct_from_binary, struct_to_binary @dataclass class MyStruct: Encoding: ua.Byte = field(default=0, repr=False, init=False) a: ua.Int32 = 1 b: Optional[ua.Int32] = 2 d: ua.Int32 = 4 def main(): m1 = MyStruct(1, None, 3) print(m1) data1 = struct_to_binary(m1) print(data1) m2 = struct_from_binary(MyStruct, ua.utils.Buffer(data1)) print(m2) assert m1 == m2 if __name__ == "__main__": main() ``` ``` $ python test.py MyStruct(a=1, b=None, d=3) b'\x00\x01\x00\x00\x00\x03\x00\x00\x00' MyStruct(a=1, b=2, d=3) Traceback (most recent call last): File "/home/usert/test/test.py", line 28, in <module> main() File "/home/user/test/test.py", line 24, in main assert m1 == m2 AssertionError ``` **Expected behavior**<br /> Filled with `None`. **Screenshots**<br /> n/a **Version**<br /> - Python-Version: 3.10.12<br /> - opcua-asyncio Version (e.g. master branch, 0.9): 1.0.4
Deserializer does not fill optional field with `None`
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1425/comments
2
2023-09-05T08:39:44Z
2023-09-05T10:10:05Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1425
1,881,493,365
1,425
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> `struct_to_binary` raises `TypeError` when a dataclass field has `None` value. **To Reproduce**<br /> For example, `TargetName` in `RelativePathElement` is a `QualifiedName` which is [nullable](https://reference.opcfoundation.org/Core/Part6/v105/docs/5.1.2) but asyncua fails to serialize it. ```python >>> from asyncua import ua >>> rpath = ua.RelativePath( Elements=[ ua.RelativePathElement( ReferenceTypeId=ua.NodeId(ua.ObjectIds.HierarchicalReferences), IsInverse=False, IncludeSubtypes=True, TargetName=None, # <--- ) ] ) >>> ua.ua_binary.struct_to_binary(rpath) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/opcua-asyncio/asyncua/ua/ua_binary.py", line 336, in struct_to_binary return serializer(obj) File "/home/user/opcua-asyncio/asyncua/ua/ua_binary.py", line 325, in serialize return b''.join( File "/home/user/opcua-asyncio/asyncua/ua/ua_binary.py", line 327, in <genexpr> else serializer(obj.__dict__[name]) File "/home/user/opcua-asyncio/asyncua/ua/ua_binary.py", line 401, in serialize return data_size + b''.join(type_serializer(el) for el in val) File "/home/user/opcua-asyncio/asyncua/ua/ua_binary.py", line 401, in <genexpr> return data_size + b''.join(type_serializer(el) for el in val) File "/home/user/opcua-asyncio/asyncua/ua/ua_binary.py", line 325, in serialize return b''.join( File "/home/user/opcua-asyncio/asyncua/ua/ua_binary.py", line 327, in <genexpr> else serializer(obj.__dict__[name]) File "/home/user/opcua-asyncio/asyncua/ua/ua_binary.py", line 335, in struct_to_binary serializer = create_dataclass_serializer(obj.__class__) File "/home/user/opcua-asyncio/asyncua/ua/ua_binary.py", line 284, in create_dataclass_serializer data_fields = fields(dataclazz) File "/home/user/.pyenv/versions/3.10.12/lib/python3.10/dataclasses.py", line 1198, in fields raise TypeError('must be called with a dataclass type or instance') from None TypeError: must be called with a dataclass type or instance ``` **Expected behavior**<br /> Encode Python `None` value to `null` in OPC message properly. **Screenshots**<br /> n/a **Version**<br /> - Python-Version: 3.10.12 - opcua-asyncio Version (e.g. master branch, 0.9): 1.0.4
Serializer fails when dataclass field has `None`
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1424/comments
4
2023-09-05T03:12:11Z
2023-09-05T08:12:26Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1424
1,881,110,120
1,424
[ "FreeOpcUa", "opcua-asyncio" ]
https://github.com/FreeOpcUa/opcua-asyncio/blob/a8091a44dbf9959f37d84e39d15e3110acdd69e2/asyncua/common/structures104.py#L129C1-L129C1 quick fix is newname = name.strip() newname = re.sub(r"\W+", "_", newname) Don't ask me whi something starts with this whitespace... but in current implementation it makes Error 13:47:27.473 [WARNING] renamed LessEqual to _LessEqual_ due to Python syntax File "C:\Python_3.10.10\lib\enum.py", line 111, in __setitem__ raise ValueError('_names_ are reserved for future Enum use')
available quick fix - leading or trailing spaces cause error in load_data_type_definitions for Enum
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1422/comments
0
2023-09-01T11:49:25Z
2023-09-01T11:52:08Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1422
1,877,280,801
1,422
[ "FreeOpcUa", "opcua-asyncio" ]
The source codes contain some `type: ignore[union-attr]` annotations but they suppress potential errors such as accessing attributes on `Optional` variable it can be `None`. We should handle the case explicitly.
Clean up "type: ignore[union-attr]"
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1421/comments
0
2023-09-01T09:40:05Z
2023-09-01T09:40:05Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1421
1,877,095,935
1,421
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, I am sorry. I am a newbie Is it possible that we can check if the server still alive or crashed or network interface down from the server code side? Thanks
check server alive from the server code side
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1418/comments
4
2023-08-30T01:53:54Z
2023-08-30T15:00:11Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1418
1,872,753,316
1,418
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> I want to make asyncua a Windows service, but it started with an error **To Reproduce**<br /> server-methods2.py: ``` #!/usr/bin/env python # coding: utf-8 import os import sys import subprocess import configparser import asyncio import logging #导入pandas包 import pandas as pd from asyncua import ua, uamethod, Server config = configparser.ConfigParser() #使用工具类读写ini配置文件 current_path=os.path.dirname(os.path.realpath(__file__)) config.read(os.path.join(current_path, r'server.ini'),encoding="gbk") #server的启动端口 port = config['server']['port'] #灰度格框条数 gray_grid_boxes_num=int(config['data-analysis']['gray_grid_boxes_num']) #拍照间隔时间 per_col_time=int(config['data-analysis']['per_col_time']) #每格高度 per_line_height=int(config['data-analysis']['per_line_height']) #找截止行需去掉的末尾行数 endline_num=int(config['data-analysis']['endline_num']) #找截止行需去掉的末尾行数 startline_num=int(config['data-analysis']['startline_num']) def calculate_func(excel_name): #读取表格数据 excel_path=excel_name origin_data=pd.read_excel(excel_path,header=None,sheet_name=0) #do something return ratio,slope class SubHandler(object): async def datachange_notification(self, node, val, data): if val: try: ratio,slope=calculate_func(val) except Exception as e: ratio,slope=-1.0,-1.0 print("计算报错:"+str(e)) idx=node.nodeid.NamespaceIndex parent = await node.get_parent() ratioNode=await parent.get_child(str(idx)+":ratio") await ratioNode.write_value(ratio) slopeNode=await parent.get_child(str(idx)+":slope") await slopeNode.write_value(slope) async def main(): logging.basicConfig(level=logging.ERROR) # now set up our server server = Server() await server.init() server.set_endpoint("opc.tcp://0.0.0.0:"+port+"/freeopcua/server/") server.set_server_name("FreeOpcUa Example Server") # set up our own namespace uri = "http://examples.freeopcua.github.io" idx = await server.register_namespace(uri) myobj = await server.nodes.objects.add_object(idx, "MyObject") excel_name = await myobj.add_variable(idx, "excel_name", "") await excel_name.set_writable() ratio = await myobj.add_variable(idx, "ratio", 0.0) slope = await myobj.add_variable(idx, "slope", 0.0) handler = SubHandler() sub = await server.create_subscription(100, handler) await sub.subscribe_data_change(excel_name) async with server: while True: await asyncio.sleep(1) if __name__ == "__main__": with subprocess.Popen([os.path.join(current_path, r"killPort.bat"),port], stdout=subprocess.PIPE) as process: process.wait() for i in range(30): cmd = [os.path.join(current_path, r"checkKillPort.bat"),port] with subprocess.Popen(cmd, stdout=subprocess.PIPE) as process: process.wait() out=process.stdout.read() process.stdout.close() if out.strip().decode()=="0": break else: time.sleep(2) asyncio.run(main()) ``` makeService2.py: ``` import os import sys import servicemanager import win32event import win32service import win32timezone import win32serviceutil # import subprocess class MyService(win32serviceutil.ServiceFramework): _svc_name_ = "TianYaoService" _svc_display_name_ = "Tian Yao Service" def __init__(self, args): win32serviceutil.ServiceFramework.__init__(self, args) self.hWaitStop = win32event.CreateEvent(None, 0, 0, None) def SvcStop(self): self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) win32event.SetEvent(self.hWaitStop) def SvcDoRun(self): # while True: # time.sleep(2) self.main() def main(self): # # 在这里添加你的 Python 脚本的执行逻辑 # #杀死端口 # with subprocess.Popen([PYTHON_EXECUTABLE,killPortPy,killPort,checkPort,port], stdout=subprocess.PIPE) as process: # process.wait() # os.system(f"{PYTHON_EXECUTABLE} {SCRIPT_PATH} {port}") try: os.system(r'python C:\Users\ty\Desktop\extra项目\拟合曲线项目\OPCUA接口\server-methods2.py') except Exception as e: print(str(e)) if __name__ == '__main__': if len(sys.argv) == 1: servicemanager.Initialize() servicemanager.PrepareToHostSingle(MyService) servicemanager.StartServiceCtrlDispatcher() else: win32serviceutil.HandleCommandLine(MyService) ``` run: `python makeService2.py install` then The Windows service reported an error when starting the service **Expected behavior**<br /> I want to register the server made of asyncua as a Windows service, with Windows management for server startup and shutdown restart **Screenshots**<br /> ![image](https://github.com/FreeOpcUa/opcua-asyncio/assets/24905236/eb8ea3dd-cadc-4424-a7b0-cbfaeee0248f) **Version**<br /> Python-Version:3.10.9<br /> opcua-asyncio Version (e.g. master branch, 0.9):1.0.2
I want to make asyncua a Windows service, but it started with an error
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1417/comments
3
2023-08-28T14:39:19Z
2023-09-18T12:43:45Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1417
1,869,899,462
1,417
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> When adding a variable to an object of the `uatypes.DateTime` type, when we read the value from the server, the timezone is preserved. When reading from the client, the tzinfo attribute is discarded. **To Reproduce**<br /> The following code snippet should document the exact problem: ```python3 import asyncio import logging from asyncua import Server, Client from asyncua.ua import uatypes from datetime import timezone async def main(): _logger = logging.getLogger(__name__) server = Server() await server.init() url = "opc.tcp://0.0.0.0:4840/freeopcua/server/" server.set_endpoint(url) uri = "http://examples.freeopcua.github.io" idx = await server.register_namespace(uri) original_value = uatypes.DateTime.now(timezone.utc) myobj = await server.nodes.objects.add_object(idx, "MyObject") myvar = await myobj.add_variable( idx, "MyVariable", original_value, varianttype=uatypes.VariantType.DateTime ) _logger.info("Starting server!") async with server: read_from_server = await myvar.get_value() async with Client(url=url) as client: client_node = client.get_node(myvar) read_from_client = await client_node.get_value() _logger.info(f"{original_value=}") _logger.info(f"{read_from_server=}") _logger.info(f"{read_from_client=}") assert read_from_server == original_value, "server read discards tzinfo" assert read_from_server == read_from_client, "client read discards tzinfo" if __name__ == "__main__": logging.basicConfig(level=logging.INFO) logging.getLogger("asyncua").setLevel(logging.CRITICAL) asyncio.run(main(), debug=True) ``` Here are the results of running this: ``` ... INFO:__main__:original_value=DateTime(2023, 8, 23, 14, 47, 2, 319146, tzinfo=datetime.timezone.utc) INFO:__main__:read_from_server=DateTime(2023, 8, 23, 14, 47, 2, 319146, tzinfo=datetime.timezone.utc) INFO:__main__:read_from_client=datetime.datetime(2023, 8, 23, 14, 47, 2, 319146) ... AssertionError: client read discards tzinfo ``` **Expected behavior**<br /> I expect the client to return an equivalent value to what gets retrieved by the server. **Version**<br /> Python-Version:3.11.4<br /> opcua-asyncio Version (e.g. master branch, 0.9): 1.0.3
asyncua.Client discards tzinfo attribute when reading timezone aware variables from server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1414/comments
4
2023-08-23T15:19:07Z
2023-08-28T12:07:21Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1414
1,863,547,966
1,414
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> The [spec](https://reference.opcfoundation.org/Core/Part4/v105/docs/A.2) allows you to specify `ReferenceType` in the text format of `RelativePath` such as`"<1:ConnectedTo>..."`, but this feature has not been implemented yet other than the standard types (`ns=0`). This is a remaining task of #1382. **To Reproduce**<br /> ```python >>> from asyncua import ua >>> ua.RelativePath.from_string("<0:HasChild>1:Boiler/1:HeatSensor") RelativePath(Elements=[...]) >>> ua.RelativePath.from_string("<1:ConnectedTo>1:Boiler/1:HeatSensor") Traceback (most recent call last): ... ValueError: Non-standard ReferenceTypes are not supported. ``` **Expected behavior**<br /> Add a feature to resolve the `QualifiedName` of reference types by using the namespace table in the server. **Screenshots**<br /> n/a **Version**<br /> Python-Version: 3.10 opcua-asyncio Version: 1.0.3
Non-standard reference types are not supported in RelativePath's text format
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1411/comments
0
2023-08-23T05:27:50Z
2023-08-23T05:27:50Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1411
1,862,592,751
1,411
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> `Server` accepts `ExpandedNodeId` as a parameter in a request, but it doesn't match with the node added to the server when its nodeid is `NodeId` (i.e. registered by using namespace index instead of namespace URI). **To Reproduce**<br /> ```python import asyncio from asyncua import ua, Server async def run_server(): server = Server() await server.init() server.set_endpoint("opc.tcp://0.0.0.0:4840/freeopcua/server/") server.set_server_name("FreeOpcUa Example Server") server.set_security_policy([ua.SecurityPolicyType.NoSecurity]) idx = await server.register_namespace("http://examples.freeopcua.github.io") await server.nodes.objects.add_variable( ua.NodeId("MyVariable", idx), ua.QualifiedName("MyVariable", idx), 6.7 ) async with server: while True: await asyncio.sleep(0.1) asyncio.run(run_server()) ``` ```python from asyncua import ua from asyncua.sync import Client >>> c = Client('opc.tcp://localhost:4840') >>> c.connect() >>> c.nodes.namespace_array.read_value() ['http://opcfoundation.org/UA/', 'urn:freeopcua:python:server', 'http://examples.freeopcua.github.io'] >>> c.get_node("ns=2;s=MyVariable").read_value() 6.7 >>> c.get_node("nsu=http://examples.freeopcua.github.io;s=MyVariable").read_value() Traceback (most recent call last): File "<stdin>", line 1, in <module> ... File "/home/user/project/venv/lib/python3.10/site-packages/asyncua/ua/uatypes.py", line 372, in check raise UaStatusCodeError(self.value) asyncua.ua.uaerrors._auto.BadNodeIdUnknown: "The node id refers to a node that does not exist in the server address space."(BadNodeIdUnknown) ``` **Expected behavior**<br /> Normalize the received requests by converting `nsu` and `srv` into `ns` in the `Server`'s context. **Screenshots**<br /> n/a **Version**<br /> - Python-Version: 3.10 - opcua-asyncio Version: 1.0.3
Server does not support requests specifying ExpandedNodeId
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1406/comments
3
2023-08-21T06:55:18Z
2023-08-22T07:53:06Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1406
1,858,725,789
1,406
[ "FreeOpcUa", "opcua-asyncio" ]
When using the read_values method and there is a bad quality tag in a list, from an existing channel/device on an OPC Ua server, sometimes the timeout occurs, sometimes it skips altogether. Opposed to that, if I try to read a list containing a tag from a non-existent channel/device, the tag gets completely ignored on when trying to read its value. When the timeout is triggered, it seems to keep on happening for some random amount of time, and then it suddenly stops happening altogether. The exception's class that happens is: asyncio.exceptions.TimeoutError. I'm also using a Client timeout of 2s. **To Reproduce**<br /> - Configure an OPC Ua server with 2 different devices. One existing and one not existing (one can be a Simulated driver, and the other one can be anything, doesn't really matter) - Use the read_values method to read a list containing valid tags and non-existing tags from the second device. **Expected behavior**<br /> The timeout shouldn't be randomly occurring. It should always happen, or never happen. **Version**<br /> Python-Version: 3.10.9 python-opcua Version: 1.0.1 Top Server (OPC Ua server used): 6.12
read_values random timeout
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1405/comments
6
2023-08-16T18:14:05Z
2023-08-18T11:33:12Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1405
1,853,700,744
1,405
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> `create_*` functions (e.g. `create_folder()`) in `asyncua.common.managed_nodes` receives `nodeid` and `bname`. If we specify a namespace ID for `nodeid` and not for `bname`, the namespace of the resulting browse name will be `0` instead of the one for node ID. **To Reproduce**<br /> ```python from asyncua.sync import Client from asyncua import ua client = Client(...) nodeid: ua.NodeId = ua.NodeId("0:Folder", 2) qname: str = "Folder" folder = client.nodes.objects.create_folder(nodeid, qname) assert folder.read_browse_name().NamespaceIndex == 2 # fails ``` **Expected behavior**<br /> The namespace of browse name is same one specified in the node ID. **Version**<br /> - Python-Version: 3.10 - opcua-asyncio Version (e.g. master branch, 0.9): 1.0.3
create_* functions doesn't respect namespace ID for browse name
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1390/comments
4
2023-08-04T09:23:45Z
2024-02-22T19:27:20Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1390
1,836,389,313
1,390
[ "FreeOpcUa", "opcua-asyncio" ]
First of all, thank you very much for your hard work ! We are trying to send data from an OPCUA server embedded in a PLC using Codesys to an embedded computer acting as a client. Sending data generally works fine, except when we decide to send more complex data containing arrays, which take the form of structures in Codesys and are translated into ExtensionObjects when using the OPCUA protocol. When we check the contents of the variables using the UAExpert client, the arrays are complete and can be read without any problems. However, when these same variables are retrieved by the OPCUA asyncio client on the embedded computer, the arrays are no longer treated as such and data is lost. We retrieve the data by subscribing to the nodes and storing them in a queue once they have been received in the callback notifying us of data modifications. A test was carried out with 2 ExtensionObjects with arrays of 10 Int16 containing different data. ![image](https://github.com/FreeOpcUa/opcua-asyncio/assets/32198669/672368dd-8b86-430d-adbd-779de673c2a8) ![image (1)](https://github.com/FreeOpcUa/opcua-asyncio/assets/32198669/ff1beb90-b134-46a8-86b7-7d783deeed9b) Here are the results when reading the variables using the UAexpert client : ![Screenshot from 2023-08-03 11-57-45](https://github.com/FreeOpcUa/opcua-asyncio/assets/32198669/03dda3cd-22dc-4c36-944c-20860e6dc6e4) ![Screenshot from 2023-08-03 11-58-50](https://github.com/FreeOpcUa/opcua-asyncio/assets/32198669/692f6ff9-11e4-4c9a-a272-0a2d605a220f) And here are the results when reading the variables using the library : ![Screenshot from 2023-08-03 11-52-10](https://github.com/FreeOpcUa/opcua-asyncio/assets/32198669/2ec6bef1-5c81-4ee3-b1e2-1fa5240cdb1a) ![Screenshot from 2023-08-03 11-51-48](https://github.com/FreeOpcUa/opcua-asyncio/assets/32198669/904e7e45-9284-435d-81b2-3454ad5aaadc) After displaying the contents, it can be seen that the size of the 1st array is correctly read, but the contents are limited to the value of the data at the beginning of the list. Then, the size of the next list corresponds to the addition of the 4 bytes of the next 2 indexes (concatenating the binary of 2 and 3 gives 196610 in Int32 decimal writing, and the same applies to the second list with 12 and 13, which gives 851980 in Int32). Finally, the contents of the 2nd list correspond to the contents of the 4th value of the 1st list. The data is therefore decoded as a succession of bytes, irrespective of the fact that they are lists. Interestingly, if I call the read_value() function directly on the ExtensionObject field containing the array, the data is correctly decoded. We are currently running python 3.8.10 and opcua asyncio 1.0.3 Thanks in advance !
Problem reading arrays inside an ExtensionObject variable
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1388/comments
12
2023-08-03T10:04:56Z
2023-08-09T20:16:12Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1388
1,834,738,200
1,388
[ "FreeOpcUa", "opcua-asyncio" ]
I use opcua-asyncio to connect to a opc ua server hosted by an IO-Link-master. With this opc ua server I wish to change the ISDU of a sensor connected to the IO-Link-master. In order to do that I try to call a method (with two arguments - index and subindex - the index is supposed to be an Uint16 and the subindex is supposed to be in byte) provided on the server. When I do this "manually" while connected to the server with a Prosys client, the method works fine. Unfortunately I am not able to call the method with this library. I always receive an error that the one of the arguments is not an integer. This is weird, because only the sonc argument should be an byte (as mentioned above). And even more weird, if I define the second argument as an integer as well, I get an error, that one or more arguments are missmatched. Appended is the code I use and a picture of the method call on prosys. Is there something I am doing wrong or is this kind of method call not implemented yet? Code: ``` parent_object = client.get_node("ns=3;i=5002") method = client.get_node("ns=3;i=7005") arg1 = ua.Variant(40, ua.VariantType.UInt16) arg2 = ua.Variant('00000000', ua.VariantType.Byte) output = parent_object.call_method(method, [arg1, arg2]) ``` ![Screenshot (3)](https://github.com/FreeOpcUa/opcua-asyn ![Screenshot (5)](https://github.com/FreeOpcUa/opcua-asyncio/assets/73947915/ba94054b-20bc-40a2-8a9e-397e8e24af12) cio/assets/73947915/1483b61c-345c-4820-8ced-59d114bdd40a)
Call Method Arguments unclear
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1387/comments
6
2023-08-02T20:57:10Z
2023-08-18T08:25:41Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1387
1,833,894,631
1,387
[ "FreeOpcUa", "opcua-asyncio" ]
Hello ! I'm actually trying to test specific behavior on server configuration and I wanted to raise a bunch of errors. The below example is just one of many others. I always get the common Exception instead of the library exception, which is annoying to custom the behavior after this. Maybe there is a problem in my implementation, I'm new to this library. If i am wrong the code i get from the error means it is [BadTcpSecureChannelUnknown error](https://opcua-asyncio.readthedocs.io/en/latest/api/asyncua.ua.uaerrors.html#asyncua.ua.uaerrors._auto.BadTcpSecureChannelUnknown) **Describe the bug** <br /> A clear and concise description of what the bug is. **To Reproduce**<br /> ```python async def get_client_secure(self) -> Client: client = Client(url=self.url, timeout=self.timeout) client.application_uri = self.uri await client.set_security( SecurityPolicyBasic256Sha256, certificate=self.cert, private_key=self.key, ) return client # BELOW IS THE PROBLEM from asyncua import Client, ua from asyncua.ua import uaerrors async def is_possible_to_activate_session_using_non_existing_secure_channel_token(self): """This function is used to verify that it is impossible to activate a session from a non existing secure channel""" client: Client = await self.opcua_utils.get_client_secure() client = await client.create_session(client) client.uaclient.protocol._connection.security_token.ChannelId = 1000 try: await client.activate_session() except uaerrors.BadTcpSecureChannelUnknown: # HERE IS WHERE I WANT TO BE return Status.SUCCESS, "This is fine !" except ua.UaStatusCodeError: return Status.SUCCESS, "TEST" except Exception: # HERE IS WHERE I ENDED :( return Status.FAIL, "This is not fine !" return Status.FAIL, "Can activate session from a non existing secure channel" ``` **Expected behavior**<br /> I want to catch `uaerrors.BadTcpSecureChannelUnknown` error The following error is printed, but not raised as `uaerrors`, only as a default python error `Exception` ``` CRITICAL:asyncua.client.ua_client.UASocketProtocol:Received an error: ErrorMessage(Error=StatusCode(value=2155806720), Reason=None) ``` **Version**<br /> Python-Version : `3.11` opcua-asyncio Version (e.g. master branch, 0.9) : `latest`
Specific errors are not raised
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1385/comments
0
2023-08-02T12:09:24Z
2023-08-02T12:11:39Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1385
1,833,059,219
1,385
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> I'm using asyncua to connect to a [Tani OPC-UA Gateway](https://www.tanindustrie.de/), version 2.7.3. When using ``client.load_data_type_definitions``, an ``AttributeError`` is raised from ``structures104.py``. Investigating the issue, I found that on the Tani Server, there are ``OptionSet`` types in which the ``DataTypeDefinition`` is set as ``StructureDefinition`` instance. Its fields are ``StructureField`` instances. ``structure104.make_enum_code`` raises because the latter are missing the ``Value`` attribute. **Server data + Traceback see below.** I can't tell yet whether the server or the client is at fault here. I just know that UaExpert connects to the server without any complaints whatsoever. The OPC UA reference docs left me in total confusion on how actual OptionSet subtypes are supposed to look like. (Any hints are appreciated.) As far as I see, the data types in question are "builtin" to the Tani Server (something to do with BACnet), so they will always be present and the call will crash consistently. Meaning that ``asyncio`` is currently incompatible with that server, at least regarding structured datatypes. **To Reproduce**<br /> 1. Set up a server with an OptionSet subtype as in the screenshot below. (here: Tani OPC UA Server 2.7.3) 2. Connect with asyncua 3. Call ``client.load_data_type_definitions``. **Expected behavior**<br /> *If* the server data is within what the standard allows (*opinion wanted*), asyncua should be able to understand it. Independent from that, it would be good if ``load_data_type_definitions`` would handle such a case more gracefully. For instance, it could log an error message and proceed with the next item instead of crashing altogether. This would mean introducing some generic try/catch logic in the loops within ``load_data_type_definitions`` and ``load_enums``. One could even collect the exceptions on-the-go and raise them as ``ExceptionGroup`` after completion, if the python version allows. I'd be happy to prepare a PR if it makes sense. **Screenshot / Traceback**<br /> Here's one representative OptionSet Node on the server: (Path: ``Types / DataTypes / BaseDataType / Structure / OptionSet``): ![OptionSet_BACnetDaysOfWeek](https://github.com/FreeOpcUa/opcua-asyncio/assets/16409434/09437378-8365-47ef-b3aa-b390073b1147) Particularly, note that Attribute ``DataTypeDefinition.Fields[0]`` does not have the ``Value`` attribute required by ``make_enum_code``. Here's the traceback: Traceback (most recent call last): File "python\lib\site-packages\plc_bridge\asyncua\reconnecting_opcua_client.py", line 98, in aservice await self._setup_connection(s) File "python\lib\site-packages\plc_bridge\asyncua\reconnecting_opcua_client.py", line 153, in _setup_connection self._client = await estack.enter_async_context( File "contextlib.py", line 556, in enter_async_context File "contextlib.py", line 175, in __aenter__ File "python\lib\site-packages\plc_bridge\asyncua\extensions.py", line 119, in client_context await client.load_data_type_definitions() # -- entering library code here -- # File "python\lib\site-packages\asyncua\client\client.py", line 833, in load_data_type_definitions return await load_data_type_definitions(self, node, overwrite_existing=overwrite_existing) File "python\lib\site-packages\asyncua\common\structures104.py", line 461, in load_data_type_definitions new_objects.update(await load_enums(server, server.nodes.option_set_type, True)) # also load all optionsets File "python\lib\site-packages\asyncua\common\structures104.py", line 549, in load_enums env = await _generate_object(name, edef, enum=True, option_set=option_set) File "python\lib\site-packages\asyncua\common\structures104.py", line 294, in _generate_object code = make_enum_code(name, sdef, option_set) File "python\lib\site-packages\asyncua\common\structures104.py", line 532, in make_enum_code value = sfield.Value if not option_set else (1 << sfield.Value) AttributeError: 'StructureField' object has no attribute 'Value' **Version**<br /> Python-Version: 3.9.4<br /> opcua-asyncio Version (e.g. master branch, 0.9): tested with 1.0.3, 1.0.1 <br/> Tani Server 2.7.3
load_data_type_definitions crashes due to unexpected OptionSet data from server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1381/comments
4
2023-08-01T08:54:54Z
2023-09-29T10:18:25Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1381
1,830,782,436
1,381
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> When creating two subscriptions, `datachange_notification` does not report the correct node as source of the change. **To Reproduce**<br /> Create a `server.py` with two variables and regularly `write_value` to the nodes, e.g.: ```python import asyncio import asyncua import datetime async def serve(): server = asyncua.Server() await server.init() server.set_endpoint('opc.tcp://0.0.0.0:5840/freeopcua/server/') async with server: uri = "http://examples.freeopcua.github.io" idx = await server.register_namespace(uri) myobj = await server.nodes.objects.add_object(idx, "MyObject") current_value = 0 myvar = await myobj.add_variable(idx, "MyVariable", current_value) myvar2 = await myobj.add_variable(idx, "MyVariable2", current_value) while True: print(f'[{datetime.datetime.now().isoformat()}] writing value {2 * current_value} to MyVariable') await myvar.write_value(2 * current_value) await asyncio.sleep(1) print(f'[{datetime.datetime.now().isoformat()}] writing value {2 * current_value + 1} to MyVariable2') await myvar.write_value(2 * current_value + 1) current_value += 1 await asyncio.sleep(1) if __name__ == '__main__': asyncio.run(serve()) ``` Create a `client.py` that subscribes to the two variable nodes and prints some text on change notifications: ```python import asyncio import asyncua import datetime class SubscriptionHandler(asyncua.common.subscription.SubHandler): async def datachange_notification(self, node, value, data): print(f'[{datetime.datetime.now().isoformat()}] node {(await node.read_display_name()).Text}: value = {value}') def event_notification(self, event): print(f'[{datetime.datetime.now().isoformat()}] New event', event) async def listen(): async with asyncua.Client(url='opc.tcp://0.0.0.0:5840/freeopcua/server/') as client: subscriptions = [] for child in await (await client.nodes.objects.get_child('2:MyObject')).get_children(): handler = SubscriptionHandler() subscription = await client.create_subscription(10, handler) await subscription.subscribe_data_change(child) subscriptions.append(subscription) while True: await asyncio.sleep(0.1) if __name__ == '__main__': asyncio.run(listen()) ``` **Expected behavior**<br /> Expect the node in `datachange_notification` to be the node that triggered the datachange notification. That is the case on startup of the client. After that, the same node is always reported, irrelevant of the datachange. **Screenshots**<br /> ![Screenshot 2023-07-31 at 10 45 01](https://github.com/FreeOpcUa/opcua-asyncio/assets/40686064/bbe144fc-c4a5-4a30-a300-5bb88e2065ac) **Version**<br /> Python-Version: 3.10.12 opcua-asyncio Version (e.g. master branch, 0.9): 1.0.2
SubHandler.datachange_notification reports incorrect node when multiple subscriptions are opened
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1379/comments
3
2023-07-31T08:49:50Z
2023-07-31T11:25:00Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1379
1,828,704,467
1,379
[ "FreeOpcUa", "opcua-asyncio" ]
**Description** <br /> I am subscribing to node changes of an (non asyncua) OPC UA server. No matter what I am setting (see code below) for `subscription_interval_ms` the datachange_notification handler is roughly called every second, and not as specified in `subscription_interval_ms`. I am connecting to an OPC UA server of a simulation software and when connecting with [UaExpert ](https://www.unified-automation.com/de/produkte/entwicklerwerkzeuge/uaexpert.html)smaller intervals are possible. So it does not seem like that this restriction comes from the server. Could you kindly support and provide help to check if this is a bug or just wrong usage. If you need more information kindly let me know. Thanks in advance! **Code To Reproduce**<br /> Subscription ```python # sample value 200ms, but could be any other as well subscription_interval_ms = 200 # init subscription subscription = await client.create_subscription( subscription_interval_ms, log) # nodes contains the list of nodes to subscribe await subscription.subscribe_data_change(nodes) ``` Event notification handling ```python async def datachange_notification(self, node: Node, val, data): node_id = node.nodeid.to_string() event_time = data.monitored_item.Value.ServerTimestamp # used value: val ``` **Expected behavior**<br /> data changes notified in the provided subscription interval **Change Events Excerpt**<br /> 2023-07-27 21:09:10.576800,ns=6;s=::injet_u_pl:MpInjectPlastificationBasic_0.Info.Torque,0.018784865736961365 2023-07-27 21:09:11.578400,ns=6;s=::injet_u_pl:Position_injection,17.79 2023-07-27 21:09:11.578400,ns=6;s=::injet_u_pl:Position_plastification,15276415.65 2023-07-27 21:09:11.578400,ns=6;s=::injet_u_pl:MpInjectBasic_0.Info.Position,17.799474716186523 2023-07-27 21:09:11.578400,ns=6;s=::injet_u_pl:MpInjectPlastificationBasic_0.Info.Torque,0.018771233037114143 2023-07-27 21:09:12.578400,ns=6;s=::injet_u_pl:Position_injection,18.28 2023-07-27 21:09:12.578400,ns=6;s=::injet_u_pl:Position_plastification,15276425.65 2023-07-27 21:09:12.578400,ns=6;s=::injet_u_pl:MpInjectBasic_0.Info.Position,18.28558921813965 2023-07-27 21:09:12.578400,ns=6;s=::injet_u_pl:MpInjectBasic_0.Info.Velocity,0.4861224293708801 2023-07-27 21:09:13.579200,ns=6;s=::injet_u_pl:Position_injection,18.77 2023-07-27 21:09:13.579200,ns=6;s=::injet_u_pl:Position_plastification,15276435.67 2023-07-27 21:09:13.579200,ns=6;s=::injet_u_pl:MpInjectBasic_0.Info.Position,18.772483825683594 2023-07-27 21:09:13.579200,ns=6;s=::injet_u_pl:MpInjectBasic_0.Info.Velocity,0.48611313104629517 2023-07-27 21:09:13.579200,ns=6;s=::injet_u_pl:MpInjectPlastificationBasic_0.Info.Torque,0.01878511533141136 2023-07-27 21:09:14.580000,ns=6;s=::injet_u_pl:Position_injection,19.25 2023-07-27 21:09:14.580000,ns=6;s=::injet_u_pl:Position_plastification,15276445.67 2023-07-27 21:09:14.580000,ns=6;s=::injet_u_pl:MpInjectBasic_0.Info.Position,19.25859832763672 2023-07-27 21:09:15.580800,ns=6;s=::injet_u_pl:Position_injection,19.740000000000002 2023-07-27 21:09:15.580800,ns=6;s=::injet_u_pl:Position_plastification,15276455.68 2023-07-27 21:09:15.580800,ns=6;s=::injet_u_pl:MpInjectBasic_0.Info.Position,19.745492935180664 2023-07-27 21:09:15.580800,ns=6;s=::injet_u_pl:MpInjectPlastificationBasic_0.Info.Torque,0.018774066120386124 **Version**<br /> Python-Version: 3.10.6 opcua-asyncio Version (e.g. master branch, 0.9): asyncua==0.9.95
Data change events are not arriving according to the specified subscription interval
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1377/comments
2
2023-07-27T21:18:53Z
2023-07-28T08:07:02Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1377
1,825,244,514
1,377
[ "FreeOpcUa", "opcua-asyncio" ]
### Please read, before you post! To save some time, please provide us following informations, if possible: **Describe the bug** <br /> We use the class Client from asyncua with a timeout of 5 seconds. We create a subscription with the following params. ```async def opcua_subscription(): global client global subscription client = Client(url='opc.tcp://localhost:4840/', timeout=5) async with client: # Client Subscription with customized parameter values params = ua.CreateSubscriptionParameters() params.RequestedPublishingInterval = 100 # 200 params.RequestedLifetimeCount = 1000 params.RequestedMaxKeepAliveCount = 10000 params.MaxNotificationsPerPublish = 10000 params.PublishingEnabled = True params.Priority = 0 handler = SubscriptionHandler() subscription = await client.create_subscription(params, handler) await run_forever() #await asyncio.sleep(200) ``` We defined an asynchronous method with the following lines and execute it with asyncio.run. ``` testNode = client.get_node(ua.NodeId.from_string(nodeid)) result = await subscription.subscribe_data_change(nodes=[testNode]) ``` The result will be returned after the timeout of 5 seconds. ![image](https://github.com/FreeOpcUa/opcua-asyncio/assets/73021159/f27b87e9-4ecf-4c92-a133-5c6b06545ab4) We found out that the timeout occurs in the send_request method in asyncua.client.ua_client.UASocketProtocol. ![image](https://github.com/FreeOpcUa/opcua-asyncio/assets/73021159/14eb5e20-54db-4903-bf11-6765864abc8c) Using similiar functions that send a request leads to the same behaviour, e.g. when we request the user access level from the OPCUA server. ``` testNode = client.get_node(ua.NodeId.from_string(nodeid)) userAccessLvl = await testNode.get_user_access_level() ``` **To Reproduce**<br /> See code snippets above. **Expected behavior**<br /> The expected behaviour would be to get a response from send_request without running into a timeout. **Screenshots**<br /> If applicable, add screenshots to help explain your problem. <br /> See above. **Version**<br /> Python-Version: 3.8.10<br /> opcua-asyncio Version (e.g. master branch, 0.9): 1.0.2
Manually triggered requests only return after client timeout
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1372/comments
1
2023-07-21T12:30:19Z
2023-09-06T07:45:58Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1372
1,815,727,656
1,372
[ "FreeOpcUa", "opcua-asyncio" ]
Hi! The server simulates the value every second. The client is subscribed to this change with a period of 1 time per second. The values are not lost, but I see this message all the time. What does it mean? Thanks! `4 # read value 07/18/2023 15:03:01 Publish callback called with result: PublishResult(SubscriptionId=6, AvailableSequenceNumbers=[1], MoreNotifications=False, NotificationMessage_=NotificationMessage(SequenceNumber=1, PublishTime=datetime.datetime(2023, 7, 18, 6, 3, 1, 880000), NotificationData=[DataChangeNotification(MonitoredItems=[MonitoredItemNotification(ClientHandle=201, Value=DataValue(Value=Variant(Value=4, VariantType=<VariantType.Int32: 6>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1, 879000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=202, Value=DataValue(Value=Variant(Value=-0.4151183, VariantType=<VariantType.Double: 11>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1, 879000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=203, Value=DataValue(Value=Variant(Value=0.4, VariantType=<VariantType.Double: 11>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1, 879000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=204, Value=DataValue(Value=Variant(Value=0.4158233, VariantType=<VariantType.Double: 11>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1, 879000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=205, Value=DataValue(Value=Variant(Value=2.0, VariantType=<VariantType.Double: 11>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1, 879000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=206, Value=DataValue(Value=Variant(Value=0.2666666, VariantType=<VariantType.Double: 11>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1, 880000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=207, Value=DataValue(Value=Variant(Value=999999, VariantType=<VariantType.Int32: 6>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 5, 33, 16, 124000), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1, 880000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=208, Value=DataValue(Value=Variant(Value='ZXCC', VariantType=<VariantType.String: 12>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 5, 33, 16, 123000), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 1, 880000), SourcePicoseconds=None, ServerPicoseconds=None))], DiagnosticInfos=None)]), Results=[], DiagnosticInfos=None) 07/18/2023 15:03:02 Publish callback called with result: PublishResult(SubscriptionId=6, AvailableSequenceNumbers=[2], MoreNotifications=False, NotificationMessage_=NotificationMessage(SequenceNumber=2, PublishTime=datetime.datetime(2023, 7, 18, 6, 3, 2, 873000), NotificationData=[DataChangeNotification(MonitoredItems=[MonitoredItemNotification(ClientHandle=201, Value=DataValue(Value=Variant(Value=5, VariantType=<VariantType.Int32: 6>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2, 873000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=202, Value=DataValue(Value=Variant(Value=-0.3434533, VariantType=<VariantType.Double: 11>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2, 873000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=203, Value=DataValue(Value=Variant(Value=0.8, VariantType=<VariantType.Double: 11>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2, 873000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=204, Value=DataValue(Value=Variant(Value=0.8134732, VariantType=<VariantType.Double: 11>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2, 873000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=205, Value=DataValue(Value=Variant(Value=-2.0, VariantType=<VariantType.Double: 11>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2, 873000), SourcePicoseconds=None, ServerPicoseconds=None)), MonitoredItemNotification(ClientHandle=206, Value=DataValue(Value=Variant(Value=0.5333333, VariantType=<VariantType.Double: 11>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2), ServerTimestamp=datetime.datetime(2023, 7, 18, 6, 3, 2, 873000), SourcePicoseconds=None, ServerPicoseconds=None))], DiagnosticInfos=None)]), Results=[StatusCode(value=0)], DiagnosticInfos=None) 5 # read value`
Publish callback called with result...
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1365/comments
0
2023-07-18T06:00:56Z
2023-07-18T06:07:01Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1365
1,809,180,880
1,365
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** Calling `connect()` on `sync.Client` after `disconnect()` will raise `ThreadLoopNotRunning` error. **To Reproduce**<br /> ```python >>> client = Client('opc.tcp://localhost') >>> client.connect() >>> client.disconnect() >>> client.connect() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/project/venv/lib/python3.10/site-packages/asyncua/sync.py", line 95, in wrapper result = self.tloop.post(aio_func(*args, **kwargs)) File "/home/user/project/venv/lib/python3.10/site-packages/asyncua/sync.py", line 51, in post raise ThreadLoopNotRunning(f"could not post {coro}") asyncua.sync.ThreadLoopNotRunning: could not post <coroutine object Client.connect at 0x7faf0b51ace0> ``` **Expected behavior** (Re-)initialize `tloop` every time we call `connect()`. **Version** - Python-Version: 3.10 - opcua-asyncio Version (e.g. master branch, 0.9): 1.0.2
sync.Clinet is not reusable
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1364/comments
5
2023-07-18T03:11:11Z
2023-11-23T16:37:59Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1364
1,808,993,933
1,364
[ "FreeOpcUa", "opcua-asyncio" ]
Hi. I'm sorry if I'm wrong to ask you individually. I was having trouble connecting to the UNICORN OPC server, so I would appreciate it if you could support the connection method. **Describe the bug** <br /> When I access [UNICORN OPC server](https://cdn.cytivalifesciences.com/api/public/content/digi-17991-original), I got TimeoutError: **To Reproduce**<br /> 1. start UNICORN OPC server. 2. Run following code ``` from asyncua import Client server_ip ="xx.xx.xx.xx" # UNICORN OPC server IP server_port = "135" # UNICORN OPC server DCOM port clt = Client(f'opc.tcp://{server_ip}:{server_port}/Event/Curves/UV1') async with Client(f'opc.tcp://{server_ip}:{server_port}/Event/Curves/UV1') as client: while True: print("connected") # outputs --------------------------------------------------------------------------- [00:41:21] WARNING disconnect_socket was called but connection is closed [ua_client.py](file:///opt/conda/lib/python3.10/site-packages/asyncua/client/ua_client.py):[299](file:///opt/conda/lib/python3.10/site-packages/asyncua/client/ua_client.py#299) --------------------------------------------------------------------------- CancelledError Traceback (most recent call last) File /opt/conda/lib/python3.10/asyncio/tasks.py:456, in wait_for(fut, timeout) 455 try: --> 456 return fut.result() 457 except exceptions.CancelledError as exc: CancelledError: The above exception was the direct cause of the following exception: TimeoutError Traceback (most recent call last) Input In [26], in <cell line: 1>() ----> 1 async with Client(f'opc.tcp://{server_ip}:{server_port}/Event/Curves/UV1') as client: 2 while True: 3 print("conntected") File /opt/conda/lib/python3.10/site-packages/asyncua/client/client.py:88, in Client.__aenter__(self) 87 async def __aenter__(self): ---> 88 await self.connect() 89 return self File /opt/conda/lib/python3.10/site-packages/asyncua/client/client.py:286, in Client.connect(self) 284 await self.connect_socket() 285 try: --> 286 await self.send_hello() 287 await self.open_secure_channel() 288 try: File /opt/conda/lib/python3.10/site-packages/asyncua/client/client.py:357, in Client.send_hello(self) 353 async def send_hello(self): 354 """ 355 Send OPC-UA hello to server 356 """ --> 357 ack = await self.uaclient.send_hello(self.server_url.geturl(), self.max_messagesize, self.max_chunkcount) 358 if isinstance(ack, ua.UaStatusCodeError): 359 raise ack File /opt/conda/lib/python3.10/site-packages/asyncua/client/ua_client.py:305, in UaClient.send_hello(self, url, max_messagesize, max_chunkcount) 304 async def send_hello(self, url, max_messagesize: int = 0, max_chunkcount: int = 0): --> 305 await self.protocol.send_hello(url, max_messagesize, max_chunkcount) File /opt/conda/lib/python3.10/site-packages/asyncua/client/ua_client.py:216, in UASocketProtocol.send_hello(self, url, max_messagesize, max_chunkcount) 214 if self.transport is not None: 215 self.transport.write(uatcp_to_binary(ua.MessageType.Hello, hello)) --> 216 return await asyncio.wait_for(ack, self.timeout) File /opt/conda/lib/python3.10/asyncio/tasks.py:458, in wait_for(fut, timeout) 456 return fut.result() 457 except exceptions.CancelledError as exc: --> 458 raise exceptions.TimeoutError() from exc 459 finally: 460 timeout_handle.cancel() TimeoutError: **Expected behavior**<br /> Print "connected" **Screenshots**<br /> If applicable, add screenshots to help explain your problem. <br /> You can post Screenshots directly to github, please don't use 3rd Party webpages **Version**<br /> Python-Version: 3.10.5<br /> opcua-asyncio Version (e.g. master branch, 0.9): 1.0.2 Best regards.
TimeoutError was occur when access to UNICORN OPC server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1363/comments
1
2023-07-13T22:23:34Z
2023-07-14T06:13:57Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1363
1,803,840,308
1,363
[ "FreeOpcUa", "opcua-asyncio" ]
There is seemingly no way to get `ArrayDimensions` to be something else than None/Null when creating a fixed size array variable. The following does not work: ``` await cfg.add_variable(idx, "test", [1,2]) await cfg.add_variable(idx, "test", ua.Variant([1,2], ua.VariantType.Int32, 2)) await cfg.add_variable(idx, "test", ua.Variant([1,2], ua.VariantType.Int32, [2])) ``` or any combination of None for some arguments, in fact, the 2 last ones do not even set `is_array` to `true` These result in `ValueRank` set to `OneOrMoreDimensions` and `ArrayDimensions` set to `None` while I would expect to see `ValueRank = OneDimension` and `ArrayDimensions = [2]` It could be due to [this line](https://github.com/FreeOpcUa/opcua-asyncio/blob/a2f263611ec6891e3758462d07dc548b48523939/asyncua/ua/uatypes.py#L910C13-L911C61) which should maybe be `>=` instead of `>` Python 3.10.4 asyncua 1.0.2
Cannot get OPC attribute "ArrayDimensions" to show up with Python list
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1359/comments
0
2023-07-09T14:52:02Z
2023-07-09T14:52:02Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1359
1,795,434,660
1,359
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> A clear and concise description of what the bug is. If you use the default client-with-encryption.py with server-with-encryption.py you will get an error which you can find below in the "Terminal output" section. This error happened because the client in client-with-encryption.py does not have admin rights. It happens because server-with-encryption.py have ```python from asyncua.crypto.permission_rules import SimpleRoleRuleset class SimpleRoleRuleset(PermissionRuleset): """ Standard simple role-based ruleset. Admins alone can write, admins and users can read, and anonymous users can't do anything. """ def __init__(self): write_ids = list(map(ua.NodeId, WRITE_TYPES)) read_ids = list(map(ua.NodeId, READ_TYPES)) self._permission_dict = { UserRole.Admin: set().union(write_ids, read_ids), UserRole.User: set().union(read_ids), UserRole.Anonymous: set() } ``` If we will replace UserRole.User: set().union(rwrite_ids, read_ids), the default client will work fine. **To Reproduce**<br /> Steps to reproduce the behavior incl code: in the folder opcua-asyncio/examples run ```bash python ./server-with-encryption.py python ./client-with-encryption.py ``` **Expected behavior**<br /> Code work without errors. **Terminal output**<br /> ```bash INFO:asyncua.client.ua_client.UaClient:activate_session 2.2000000000000006 WARNING:asyncua.client.ua_client.UASocketProtocol:ServiceFault (BadUserAccessDenied, diagnostics: DiagnosticInfo(SymbolicId=None, NamespaceURI=None, Locale=None, LocalizedText=None, AdditionalInfo=None, InnerStatusCode=None, InnerDiagnosticInfo=None)) from server received in response to WriteRequest INFO:asyncua.client.client:disconnect INFO:asyncua.client.ua_client.UASocketProtocol:Socket has closed connection INFO:asyncua.client.ua_client.UaClient:close_session WARNING:asyncua.client.ua_client.UaClient:close_session was called but connection is closed WARNING:asyncua.client.ua_client.UaClient:close_secure_channel was called but connection is closed WARNING:asyncua.client.ua_client.UaClient:disconnect_socket was called but connection is closed Traceback (most recent call last): File "/home/user/opcua-asyncio/examples/./client-with-encryption.py", line 42, in <module> main() File "/home/user/opcua-asyncio/examples/./client-with-encryption.py", line 37, in main loop.run_until_complete(task(loop)) File "/home/user/miniconda3/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete return future.result() File "/home/user/opcua-asyncio/examples/./client-with-encryption.py", line 30, in task await child.set_value(42.0) File "/home/user/opcua-asyncio/examples/../asyncua/common/node.py", line 235, in write_value await self.write_attribute(ua.AttributeIds.Value, dv) File "/home/user/opcua-asyncio/examples/../asyncua/common/node.py", line 284, in write_attribute result = await self.session.write(params) File "/home/user/opcua-asyncio/examples/../asyncua/client/ua_client.py", line 407, in write data = await self.protocol.send_request(request) File "/home/user/opcua-asyncio/examples/../asyncua/client/ua_client.py", line 165, in send_request self.check_answer(data, f" in response to {request.__class__.__name__}") File "/home/user/opcua-asyncio/examples/../asyncua/client/ua_client.py", line 174, in check_answer hdr.ServiceResult.check() File "/home/user/opcua-asyncio/examples/../asyncua/ua/uatypes.py", line 345, in check raise UaStatusCodeError(self.value) asyncua.ua.uaerrors._auto.BadUserAccessDenied: "User does not have permission to perform the requested operation."(BadUserAccessDenied) ``` **Version**<br /> Python-Version: 3.9.13<br /> opcua-asyncio Version (e.g. master branch, 0.9): master branch (v1.0.2)
Update examples/client-with-encryption.py to have admin rights
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1358/comments
0
2023-07-05T12:50:02Z
2023-07-05T12:50:02Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1358
1,789,489,393
1,358
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> After upgrading asyncua to version 1.0.2, including commit 4e2389e824f951688ff2a0b29b7b994dc409c9b5, tests for OPC UA implementation regarding date time stopped working. The reason was that condition in win_epoch_to_datetime was changed to lower value (basically replacing leading 9s with 0s). **Version**<br /> Python-Version: 3.8, 3.9, ... opcua-asyncio Version (e.g. master branch, 0.9): 1.0.2 Sorry about very short problem description - I'll try to update that myself or ask coworkers to do that.
MAX_OPC_FILETIME limit changed in 1.0.2
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1353/comments
2
2023-06-27T12:50:15Z
2023-06-27T13:38:09Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1353
1,776,868,895
1,353
[ "FreeOpcUa", "opcua-asyncio" ]
When executing the asyncio.run(main()) command, a for loop occurs in which data is obtained to create a client, and then a subscription to changing variables occurs, but due to the presence of "while True:" the process is blocked and, in fact, only one connection is processed ```python class SubscriptionHandler: def __init__(self, variable): self.variable = variable print(self.variable) async def datachange_notification(self, node: Node, val, data): print(node, val) class OPCUAClient: def __init__(self, uri, namespace, connection_id): self.client = Client(url=uri) self.namespace = namespace self.connection_id = connection_id async def __aenter__(self): await self.client.connect() await set_connection_status(self.connection_id, 1) return self async def __aexit__(self, exc_type, exc_val, exc_tb): await self.client.disconnect() await set_connection_status(self.connection_id, 2) async def main(): for connection in await get_connections(): try: async with OPCUAClient(connection.connection_data['uri'], connection.connection_data['nsuri'], connection.id) as OPCClient: client = OPCClient.client nodes = await get_variables(connection.id) for variables in nodes: handler = SubscriptionHandler(variables.id) subscription = await client.create_subscription(100, handler) for nodeId in variables.variables: node = client.get_node(nodeId) handle = await subscription.subscribe_data_change(node) while True: await asyncio.sleep(1) except Exception as e: await set_connection_status(connection.id, 3) print(e) def run(*args): asyncio.run(main()) ``` ``` 4 Revised values returned differ from subscription values: CreateSubscriptionResult(SubscriptionId=221, RevisedPublishingInterval=100.0, RevisedLifetimeCount=81000, RevisedMaxKeepAliveCount=27000) ns=3;i=1006 -2.0 ns=3;i=1004 -0.4 ns=3;i=1004 0.0 ns=3;i=1006 2.0 ns=3;i=1004 0.4 ``` the output is only a subscription for one connection How can I split the threads so that all connections are processed?
Subscribing to data changes across multiple connections
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1352/comments
0
2023-06-27T07:43:19Z
2023-06-28T06:15:23Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1352
1,776,296,276
1,352
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> The uaclient tool does not start a python shell, as promised from its help. This makes it almost useless. **To Reproduce**<br /> uaclient **Expected behavior**<br /> It should start a python shell with `mynode` available **Observed behaviour**<br /> It immediately exits **Screenshots**<br /> ```sh (opc.venv) colin@putey:~$ uaclient (opc.venv) colin@putey:~$ ``` **Version**<br /> Python-Version: 3.10.6<br /> opcua-asyncio Version 1.0.2 (from pip) **Additional information** It looks like a call to `embed()` was removed in 51d34a7. Restoring it gets an interactive shell; but even that is not sufficient, since `locals()` - or at least `mynode` - from `_uaclient` need to be passed down to the interpreter
uaclient tool is non-functional - no interactive shell
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1340/comments
0
2023-06-19T06:48:01Z
2023-06-19T06:49:47Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1340
1,762,863,545
1,340
[ "FreeOpcUa", "opcua-asyncio" ]
In previous version I used: `call_method_full(parent_node, node, *arguments)` and I got an object containing the OutputArguments and a StatusCode object with doc, name and value. Now I call `parent_node.call_method(node, *arguments)` and the result is array of 3 items. The first is the result, and the other are two ints (with value 0 in my case).
get status code and description from call_method
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1339/comments
0
2023-06-16T17:11:21Z
2023-06-19T08:22:35Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1339
1,761,016,418
1,339
[ "FreeOpcUa", "opcua-asyncio" ]
Hello, I need write a value to the multi-dimensional array to specific index. I know how to overwrite whole array with this specific value inside of the new value of the array, but I don't know how to write the value to the specific index without overwriting of whole array. Can you tell me how I can do that? Thank you, Tomas
How can I write value to the specific index of the array
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1338/comments
11
2023-06-16T08:44:00Z
2023-06-19T13:52:39Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1338
1,760,198,125
1,338
[ "FreeOpcUa", "opcua-asyncio" ]
null
Can't write value to the opc server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1336/comments
2
2023-06-15T08:11:03Z
2023-06-15T11:10:19Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1336
1,758,283,930
1,336
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> In the asyncua package (Version: 1.0.2), there is still a bug in the state machine implementation. The id property of the CurrentState Variable has to be of DataType NodeId. In the implementation, however, an attempt is made to fill the property with a numerical value, which leads to an error (BadTypeMismatch). **To Reproduce**<br /> Try changing the state of the state machine using `change_state` method line 174. **Expected behavior**<br /> Line 205 `await self._current_state_id_node.write_value(state.id)` in `statemachine.py` throws an error BadTypeMismatch. **Version**<br /> Python-Version: 3.7.0 opcua-asyncio Version: 1.0.2 **Possible solution**<br /> A possible solution exists and can be added with pull request after discussion. Change lines 205 and 224 to following ```py # 205 new await self._current_state_id_node.write_value(state.node.nodeid, varianttype=ua.VariantType.NodeId) # 224 new await self._last_transition_id_node.write_value(transition.node.nodeid, varianttype=ua.VariantType.NodeId) ```
BadTypeMismatch in statemachine.py
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1334/comments
0
2023-06-13T07:15:11Z
2023-06-23T18:03:54Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1334
1,754,203,604
1,334
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> I have an experimental environment using [gopcua/opcua](https://github.com/gopcua/opcua) as the OPC UA client and [tools/uaserver](https://github.com/FreeOpcUa/opcua-asyncio/tree/master/tools/uaserver) as the server. When the network is disconnected and reconnected or the server is restarted, the session is frantically re-established between the client and the server. The following is a continuous logs(I split it according to the request type): 1. restore session(port not same, old authentication token is `1001`) ``` INFO:asyncua.server.binary_server_asyncio:New connection from ('172.26.192.1', 57784) DEBUG:asyncua.server.binary_server_asyncio:_process_received_message 51 51 INFO:asyncua.uaprotocol:updating server limits to: TransportLimits(max_recv_buffer=65535, max_send_buffer=65535, max_chunk_count=1601, max_message_size=104857600) DEBUG:asyncua.server.binary_server_asyncio:_process_received_message 120 120 DEBUG:asyncua.server.binary_server_asyncio:_process_received_message 102 102 DEBUG:asyncua.server.uaprocessor:process_message NodeId(Identifier=467, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>) RequestHeader(AuthenticationToken=NodeId(Identifier=1001, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>), Timestamp=datetime.datetime(2023, 6, 9, 2, 52, 57, 863188), RequestHandle=2, ReturnDiagnostics=0, AuditEntryId=None, TimeoutHint=10000, AdditionalHeader=ExtensionObject(TypeId=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Body=None)) INFO:asyncua.server.uaprocessor:Activate session request (None) INFO:asyncua.server.uaprocessor:request to activate non-existing session (None) ERROR:asyncua.server.uaprocessor:sending service fault response: "The session id is not valid." (BadSessionIdInvalid) ``` 2. re-create session(new auhentication token is `1002`) ``` DEBUG:asyncua.server.binary_server_asyncio:_process_received_message 254 254 DEBUG:asyncua.server.uaprocessor:process_message NodeId(Identifier=461, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>) RequestHeader(AuthenticationToken=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Timestamp=datetime.datetime(2023, 6, 9, 2, 52, 57, 865479), RequestHandle=3, ReturnDiagnostics=0, AuditEntryId=None, TimeoutHint=10000, AdditionalHeader=ExtensionObject(TypeId=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Body=None)) INFO:asyncua.server.uaprocessor:Create session request (None) INFO:asyncua.server.internal_session:Created internal session ('172.26.192.1', 57784) INFO:asyncua.server.internal_session:Create session request INFO:asyncua.server.internal_server:get endpoint ``` 3. activate session ``` DEBUG:asyncua.server.binary_server_asyncio:_process_received_message 102 102 DEBUG:asyncua.server.uaprocessor:process_message NodeId(Identifier=467, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>) RequestHeader(AuthenticationToken=NodeId(Identifier=1002, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>), Timestamp=datetime.datetime(2023, 6, 9, 2, 52, 57, 866984), RequestHandle=4, ReturnDiagnostics=0, AuditEntryId=None, TimeoutHint=10000, AdditionalHeader=ExtensionObject(TypeId=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Body=None)) INFO:asyncua.server.uaprocessor:Activate session request (None) INFO:asyncua.server.internal_session:activate session INFO:asyncua.server.internal_session:Activated internal session ('172.26.192.1', 57784) for user User(role=<UserRole.User: 3>, name=None) ``` 4. close old session(client wants to close `1001`, but server close `1002`) ``` DEBUG:asyncua.server.binary_server_asyncio:_process_received_message 48 48 DEBUG:asyncua.server.uaprocessor:process_message NodeId(Identifier=473, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>) RequestHeader(AuthenticationToken=NodeId(Identifier=1001, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>), Timestamp=datetime.datetime(2023, 6, 9, 2, 52, 57, 868298), RequestHandle=5, ReturnDiagnostics=0, AuditEntryId=None, TimeoutHint=10000, AdditionalHeader=ExtensionObject(TypeId=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Body=None)) INFO:asyncua.server.uaprocessor:Close session request (None) INFO:asyncua.server.internal_session:close session ('172.26.192.1', 57784) INFO:asyncua.server.subscription_service:delete subscriptions: [] INFO:asyncua.server.uaprocessor:sending close session response (None) ``` 5. read value with session `1002` ``` DEBUG:asyncua.server.binary_server_asyncio:_process_received_message 84 84 DEBUG:asyncua.server.uaprocessor:process_message NodeId(Identifier=631, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>) RequestHeader(AuthenticationToken=NodeId(Identifier=1002, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>), Timestamp=datetime.datetime(2023, 6, 9, 2, 52, 57, 869492), RequestHandle=6, ReturnDiagnostics=0, AuditEntryId=None, TimeoutHint=10000, AdditionalHeader=ExtensionObject(TypeId=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Body=None)) INFO:asyncua.server.uaprocessor:Request service that needs a activated session (User(role=<UserRole.User: 3>, name=None)) ERROR:asyncua.server.uaprocessor:sending service fault response: "The session cannot be used because ActivateSession has not been called." (BadSessionNotActivated) INFO:asyncua.server.binary_server_asyncio:Lost connection from ('172.26.192.1', 57784), None INFO:asyncua.server.uaprocessor:Cleanup client connection: ('172.26.192.1', 57784) INFO:asyncua.server.internal_session:close session ('172.26.192.1', 57784)(id=NodeId(Identifier=1002, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>)) INFO:asyncua.server.subscription_service:delete subscriptions: [] ``` 6. Then ```mermaid sequenceDiagram participant client participant server loop infinite client->>server: activate session `n` server-->>client: BadSessionIdInvalid(non-existing session) client->>server: create session server-->>client: new session authentication token is `n+1` client->>server: activate session `n+1` server-->>client: success activate session(`n+1`) client->>server: close session `n` server-->>client: success close session(`n+1`) client->>server: read value using session `n+1` server-->>client: BadSessionNotActivated end ``` According to the logs, the issue is due to the wrong session being closed. It should be closed according to the authenticationToken in the request header. I tried to avoid this issue by adding the following code to line 203 of `asyncua/server/uaprocessor.py`. ```python if requesthdr.AuthenticationToken!=self.session.auth_token: _logger.info("request to close non-existing session (%s)", user) raise ServiceError(ua.StatusCodes.BadSessionIdInvalid) ``` I'm not sure this is a good solution, but the reconnection mechanism works. **To Reproduce**<br /> 1. run `uaserver` as server and gopcua as client(like [this](https://gist.github.com/ljwun/e728f642efea0585a4cc3dc79d623056)) 2. Stop and restart `uaserver`. (Or disconnect and reconnect network) **Expected behavior**<br /> Check authenticationToken before close session. **Version**<br /> Python-Version: 3.8.16<br /> opcua-asyncio Version (e.g. master branch, 0.9): master branch
Session is closed after activation when the server is restarted
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1333/comments
2
2023-06-12T06:08:23Z
2023-06-15T06:54:51Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1333
1,751,974,403
1,333
[ "FreeOpcUa", "opcua-asyncio" ]
I have created testing_nodeset2.xml using siemens SiOME modelling editor , so first of all i imported opcua device , opcua machinery and opcua pump xml files into editor and then created own namespace using companion specification . finally i exported testing_noeset2.xml file. Now i want to import xml files. here is the code: import asyncio async def main(): server = Server() await server.init() server.set_endpoint("opc.tcp://192.168.1.216:4000") await server.import_xml("Opc.Ua.Nodeset2.xml") await server.import_xml("Opc.Ua.Di.Nodeset2.xml") await server.import_xml("Opc.Ua.Machinery.Nodeset2.xml") await server.import_xml("Opc.Ua.Pumps.Nodeset2.xml") await server.import_xml("testing_Nodeset.xml") await server.start() if __name__ == "__main__": asyncio.run(main()) here is the error i am getting : AddNodesItem: Requested NodeId NodeId(Identifier=3062, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) already exists failure adding node NodeData(nodeid:NodeId(Identifier=3062, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>)) "The requested node id is already used by another node."(BadNodeIdExists) Traceback (most recent call last): File "c:\Users\user\OneDrive\Desktop\thesis\opcua\opc_server\opc_server\nodeset file testing\nodeset.py", line 50, in <module> asyncio.run(main()) File "C:\Program Files\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "c:\Users\user\OneDrive\Desktop\thesis\opcua\opc_server\opc_server\nodeset file testing\nodeset.py", line 40, in main await server.import_xml("Opc.Ua.Nodeset2.xml") File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\asyncua\server\server.py", li node = await self._add_node_data(nodedata, no_namespace_migration=True) File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\asyncua\common\xmlimporter.py", line 228, in _add_node_data node = await self.add_object(nodedata, no_namespace_migration) File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\asyncua\common\xmlimporter.py", line 349, in add_object res[0].StatusCode.check() File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\asyncua\ua\uatypes.py", line 328, in check raise UaStatusCodeError(self.value) asyncua.ua.uaerrors._auto.BadNodeIdExists: "The requested node id is already used by another node."(BadNodeIdExists) does anybody has an idea , how can this error be solved? your advice and solution would be apreciated. ---
causes error while importing xml files
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1330/comments
16
2023-06-07T08:37:01Z
2023-06-07T17:39:31Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1330
1,745,359,897
1,330
[ "FreeOpcUa", "opcua-asyncio" ]
This is how I instantiate my object in the server. so far so good. ` #### instantiate objects in server self.device = await instantiate(await self.server.nodes.objects.get_child('3:Machines'), await self.server.nodes.base_object_type.get_child('4:WwMachineType'), bname = 'testServer_SA_OPCUA', dname = ua.LocalizedText('Dickenhobel'), idx = 4, instantiate_optional = False)` but i want to add some optional children of the node type such as variables and properties. I just don't know how to get there.
Trying to instantiate optionals
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1327/comments
10
2023-06-05T13:42:05Z
2023-06-05T15:32:55Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1327
1,741,820,143
1,327
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> xmlparser.py cannot parse `PublicationDate` if it is not given in different format than %Y-%m-%dT%H:%M:%SZ. Format with UTC Offset for example 2023-05-31T10:45:30+02:00 is also valid and leads to error while importing the nodeset. **To Reproduce**<br /> Import an xml with PublicationDate in UTC offset format eg. 2023-05-31T10:45:30+02:00 ```py await self.import_xml("xyz.xml") ``` **Expected behavior**<br /> xmlparser will throw an error saying the format does not match **Screenshots**<br /> ![grafik](https://github.com/FreeOpcUa/opcua-asyncio/assets/40856484/a2a31830-0573-4372-8d28-a4aad981b55a) **Version**<br /> Python-Version: 3.7.0 opcua-asyncio Version: 1.0.2 **Possible solution**<br /> A possible solution exists and can be added with pull request after discussion. ```py if date_time is None: date_time = ua.DateTime(1, 1, 1) elif date_time and date_time[-1]=="Z": date_time = ua.DateTime.strptime(date_time, "%Y-%m-%dT%H:%M:%SZ") else: date_time = ua.DateTime.strptime(date_time, "%Y-%m-%dT%H:%M:%S%z") ```
Bug in xmlparser.py for time format %Y-%m-%dT%H:%M:%S%z
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1324/comments
0
2023-06-01T09:42:31Z
2023-06-05T11:27:28Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1324
1,735,902,131
1,324
[ "FreeOpcUa", "opcua-asyncio" ]
FreeOpcUa / opcua-asyncio / asyncua / common / node.py / read_raw_history() has description: > Read raw history of a node > result code from server is checked and an exception is raised in case of error > If numvalues is > 0 and number of events in period is > numvalues > then result will be truncated Expected behavior: If non-zero value provided for numvalues then read_raw_history() should request from server and then return no more than numvalues historical values for a Node (OPC UA variable). This option is useful to manage memory usage on client side then reading huge amount of historical data in chunks. It is no always possible to predict memory usage by setting starttime and endtime values. So, numvalues is the solution. Actual behavior: read_raw_history() reads and returns all the historical data regardless of numvalues option. It does not provide result truncation as declared. Non-zero numvalues causes a series of history_read() requests instead of single request. But all of them performed within single read_raw_history() call, not allowing to control memory usage on client side with numvalues option. Please, consider to fix this behavior. Possible solution is to break from 'while True' loop inside read_raw_history() if numvalues is non-zero. Single call of history_read() should be enough if numvalues is non-zero and passed into details.NumValuesPerNode field. Something like adding at the end of 'while True' loop the following lines: `if numvalues > 0:` ` break` The above applicable to opcua-asyncio code in master branch on 1st of June, 2023. Documentation reference: https://reference.opcfoundation.org/v104/Core/docs/Part11/6.4.3/#6.4.3.1
Limitation for historical data read does not work
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1323/comments
5
2023-06-01T08:43:35Z
2023-09-29T10:42:33Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1323
1,735,791,722
1,323
[ "FreeOpcUa", "opcua-asyncio" ]
I am trying to subscribe to data changes for multiple nodes. Currently, if the same value is published twice on the server (change of `SourceTimestamp`) `datachange_notification` is not called. According to the OPC-UA [docs](https://reference.opcfoundation.org/v105/Core/docs/Part4/7.10/) this is default behaviour. For my use case I want to receive a notification with the current value if the `SourceTimestamp` changes. So I tried changing the trigger option of the `MonitoringFilter` to `StatusValueTimestamp` (which should trigger notifications on timestamp change as mentioned [here](https://reference.opcfoundation.org/v105/Core/docs/Part4/7.10/)): ```python3 async def main(): """ Main task of this Client-Subscription example. """ client = Client(url=UA_SERVER_URL) async with client: handler = SubscriptionHandler() # Create subscription subscription = await client.create_subscription(500, handler) # Retrieve nodes nodes = [] for node in ["ns=2;i=100", "ns=2;i=101"]: nodes.append(client.get_node(node)) # Subscribe data change mfilter = ua.DataChangeFilter(Trigger=ua.DataChangeTrigger.StatusValueTimestamp) await subscription._subscribe(nodes, attr=ua.AttributeIds.Value, mfilter=mfilter) # Run try: while True: _logger.info("waiting ...") await asyncio.sleep(30) except KeyboardInterrupt: await subscription.delete() if __name__ == "__main__": asyncio.run(main()) ``` However, there are still no incoming notifications if the `SourceTimestamp` of the subscribed node is changed. I used a third party client to confirm that the timestamp has changed. I am currently using a server created with asyncua too. Maybe this is a server-side issue? **System Specs** Python-Version: 3.8 opcua-asyncio Version: pypi, 1.0.2
Subscription notification not triggered by change of SourceTimestamp
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1322/comments
2
2023-05-31T12:34:39Z
2023-06-14T07:22:22Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1322
1,734,128,401
1,322
[ "FreeOpcUa", "opcua-asyncio" ]
In example client-subscription.py, I want to add an ID (int) in class SubscriptionHandler , and the ID is used for the increment operation. How can I do?
How to add an ID in SubscriptionHandler for increment operation?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1320/comments
0
2023-05-31T09:30:22Z
2023-05-31T09:54:17Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1320
1,733,763,454
1,320
[ "FreeOpcUa", "opcua-asyncio" ]
When I connect to an OPC UA server as a client and call `await client.load_data_type_definitions()`, I get this error: `error: Unknown datatype for field: StructureField(Name='ProposedRigParameters', Description=LocalizedText(Locale=None, Text=None), DataType=NodeId(Identifier=3008, NamespaceIndex=3, NodeIdType=<NodeIdType.FourByte: 1>), ValueRank=1, ArrayDimensions=[0], MaxStringLength=0, IsOptional=False) in structure:ActivityDataDataType, please report` When calling `await client.load_type_definitions() ` instead, it works fine but gives a warning `Deprecated since spec 1.04, call load_data_type_definitions`. The field 'MyCustomTypeArrayField' is an array of a custom data type (ns=3 i=3008, with only basic opc ua data types as fields) with an array size of 0 that is set dynamically at runtime. ![image](https://github.com/FreeOpcUa/opcua-asyncio/assets/132424909/f7066f77-439c-4875-a4c3-86499a8fa1e5) The server that I connect to uses the .NET SDK v3.3.0 from UnifiedAutomation which should actually support spec 1.05. versions: Python 3.11.0 ayncua 1.0.2
Unknown datatype when calling load_data_type_definitions
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1319/comments
8
2023-05-31T09:22:52Z
2024-08-29T14:14:58Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1319
1,733,750,847
1,319
[ "FreeOpcUa", "opcua-asyncio" ]
I was able to easily create a method handler and link it to a method node in the address space (as per the example). However, in my real world application I need to be able to return a different status code from the Call() if things don't go well. How do I do that from the method handler? Thanks
How to return status codes from method handlers
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1314/comments
1
2023-05-25T15:53:52Z
2023-06-02T08:49:35Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1314
1,726,087,522
1,314
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> A clear and concise description of what the bug is. When using the shelf_file in server init, an exception is raised: > Traceback (most recent call last): > File "test_server.py", line 20, in <module> > asyncio.run(main(), debug=True) > File "Python311\Lib\asyncio\runners.py", line 190, in run > return runner.run(main) > ^^^^^^^^^^^^^^^^ > File "Python311\Lib\asyncio\runners.py", line 118, in run > return self._loop.run_until_complete(task) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete > return future.result() > ^^^^^^^^^^^^^^^ > File "test_server.py", line 9, in main > await server.init(shelf_file="test") > File "opc_env\Lib\site-packages\asyncua\server\server.py", line 122, in init > await self.iserver.init(shelf_file) > File "opc_env\Lib\site-packages\asyncua\server\internal_server.py", line 80, in init > await self.load_standard_address_space(shelffile) > File "opc_env\Lib\site-packages\asyncua\server\internal_server.py", line 122, in load_standard_address_space > is_file = await asyncio.get_running_loop().run_in_executor( > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "Python311\Lib\concurrent\futures\thread.py", line 58, in run > result = self.fn(*self.args, **self.kwargs) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "Python311\Lib\pathlib.py", line 1267, in is_file > return S_ISREG(self.stat().st_mode) > ^^^^^^^^^ > AttributeError: 'str' object has no attribute 'stat' > My code: ``` from asyncua import Server, ua from asyncua.common.methods import uamethod from asyncua.common.structures104 import new_enum import asyncio async def main(): server = Server() await server.init(shelf_file="test") server.set_endpoint("opc.tcp://0.0.0.0:54840/server/") server.set_server_name("Test server") uri = "http://opcua.local" idx = await server.register_namespace(uri) main = await server.nodes.objects.add_object(idx, "Main") await main.add_variable(ua.NodeId('TestVar', NamespaceIndex=idx), 'TestVar', False, ua.Boolean) async with server: while True: await asyncio.sleep(1) asyncio.run(main(), debug=True) ``` This looks like it comes from #1179 : https://github.com/FreeOpcUa/opcua-asyncio/commit/9aad5a4d6d4c079f58c0050b97b683951edba5b3#diff-e3cf94bf54c801debe599da03a24c815720ce9b3f213a3474f145006ff352917
Server shelf_file not working
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1313/comments
3
2023-05-22T21:01:43Z
2024-02-13T11:28:40Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1313
1,720,535,055
1,313
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> I have an interface on a production s7 system I would like to simulate and run tests against. I tried to export the node layout via client.export_xml() but it fails with a not helpful error message. **To Reproduce**<br /> Connect to a s7 and attempt to dump the node layout: ``` """Dump the node layout from external S7.""" import asyncio from pathlib import Path from asyncua import Client from asyncua.common import ua_utils async def main(): client = Client(url='opc.tcp://user:password@192.168.1.1:4840') async with client: idx = await client.get_namespace_index('http://test.org') # Warning a complete dump must not be run during production # target_node = client.nodes.objects target_node = await client.nodes.objects.get_child(["3:ServerInterfaces", "{}:test.org".format(idx)]) nodes = await ua_utils.get_node_children(target_node) await client.export_xml(nodes, Path('opcua_connector/ua-export.xml'), export_values=False) if __name__ == "__main__": asyncio.run(main()) ``` **Expected behavior**<br /> I would expect the xml to be successfully written. Alternatively I would expect the xml to be written without the incompatible node. At least I would expect to get informed which node/attribute caused the issue. **Screenshots**<br /> ``` "The attribute is not supported for the specified Node."(BadAttributeIdInvalid) File "/home/jtatsch/.local/lib/python3.10/site-packages/asyncua/ua/uatypes.py", line 328, in check raise UaStatusCodeError(self.value) File "/home/jtatsch/.local/lib/python3.10/site-packages/asyncua/common/node.py", line 306, in read_attribute result[0].StatusCode.check() File "/home/jtatsch/.local/lib/python3.10/site-packages/asyncua/common/xmlexporter.py", line 271, in add_etree_variable var = await node.read_attribute(ua.AttributeIds.MinimumSamplingInterval) File "/home/jtatsch/.local/lib/python3.10/site-packages/asyncua/common/xmlexporter.py", line 160, in node_to_etree await self.add_etree_variable(node) File "/home/jtatsch/.local/lib/python3.10/site-packages/asyncua/common/xmlexporter.py", line 72, in build_etree await self.node_to_etree(node) File "/home/jtatsch/.local/lib/python3.10/site-packages/asyncua/client/client.py", line 736, in export_xml await exp.build_etree(nodes) File "/opt/opcua_connector/dump_xml.py", line 18, in main await client.export_xml(nodes, Path('opcua_connector/ua-export.xml'), export_values=False) File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete return future.result() File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/opt/opcua_connector/dump_xml.py", line 21, in <module> asyncio.run(main()) File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main (Current frame) return _run_code(code, main_globals, None, asyncua.ua.uaerrors._auto.BadAttributeIdInvalid: "The attribute is not supported for the specified Node."(BadAttributeIdInvalid) ``` The debugger seems to point to that line if that is helpful: ![image](https://github.com/FreeOpcUa/opcua-asyncio/assets/3080674/7a756bd6-d4df-435b-87f0-c884090f63cb) **Version**<br /> Python-Version: 3.10.6<br /> opcua-asyncio Version (e.g. master branch, 0.9): asyncua-1.0.2
client.export_xml fails with BadAttributeIdInvalid
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1312/comments
5
2023-05-19T07:05:57Z
2023-07-24T07:29:43Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1312
1,716,752,518
1,312
[ "FreeOpcUa", "opcua-asyncio" ]
my code from old `python-opcua` library: ``` ... // got asyncua.ua.uatypes.NodeId node_id and str url as params node = client.get_node(node_id) sub = client.create_subscription(1000, url) handle = sub.subscribe_data_change(node, queuesize=queue_size) // I want to modify the sampling interval and leave the publishing interval and queue size the same: sub.modify_monitored_item(handle, sampling_interval, new_queuesize=queue_size) ``` In the sync wrapper, I don't see a way to call modify_monitored_item on the subscription.
missing modify_monitored_item in sync Subscription
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1307/comments
0
2023-05-13T16:12:27Z
2023-05-13T16:12:27Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1307
1,708,670,646
1,307
[ "FreeOpcUa", "opcua-asyncio" ]
Hello I'm using the import_xml() function to load nodes and objects from a opc ua companion spec. I want to know if you can suggest some best practices to map values from the machine where also the opc ua server is hosted to the nodes generated by the companion spec. Best regards Simon
Best practice for mapping values to companion spec
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1303/comments
1
2023-05-11T13:22:18Z
2023-05-11T14:08:53Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1303
1,705,825,744
1,303
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> We have a python application that communicates through OPC-UA protocol. In this scenario the python application consumes from IGS (Industrial Gateway Server 7) which is a OPC-UA server. All tags in IGS have a good health status as follow at the screenshot below: ![image](https://github.com/FreeOpcUa/opcua-asyncio/assets/68090836/32883b70-0ca2-497a-9bc3-f522e67838bd) After some uncertain time we are facing some problems like reported below: `INFO:asyncua.common.subscription:Publish callback called with result: PublishResult(SubscriptionId=115803, AvailableSequenceNumbers=[14908], MoreNotifications=False, NotificationMessage_=NotificationMessage(SequenceNumber=14908, PublishTime=datetime.datetime(2023, 2, 27, 21, 52, 57, 396516), NotificationData=[DataChangeNotification(MonitoredItems=[MonitoredItemNotification(ClientHandle=223, Value=DataValue(Value=Variant(Value=0.771728515625, VariantType=<VariantType.Float: 10>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 2, 27, 21, 52, 57, 365274), ServerTimestamp=datetime.datetime(2023, 2, 27, 21, 52, 57, 365274), SourcePicoseconds=None, ServerPicoseconds=None))], DiagnosticInfos=[])]), Results=[StatusCode(value=0)], DiagnosticInfos=[]) DEBUG:asyncua.client.ua_client.UaClient:ReadResponse(TypeId=NodeId(Identifier=634, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>), ResponseHeader_=ResponseHeader(Timestamp=datetime.datetime(2023, 2, 27, 21, 52, 57, 318387), RequestHandle=16829, ServiceResult=StatusCode(value=0), ServiceDiagnostics=DiagnosticInfo(SymbolicId=None, NamespaceURI=None, Locale=None, LocalizedText=None, AdditionalInfo=None, InnerStatusCode=None, InnerDiagnosticInfo=None), StringTable=[], AdditionalHeader=ExtensionObject(TypeId=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Body=None)), Results=[DataValue(Value=Variant(Value=0, VariantType=<VariantType.Int32: 6>, Dimensions=None, is_array=False), StatusCode_=StatusCode(value=0), SourceTimestamp=datetime.datetime(2023, 2, 10, 11, 52, 54, 435066), ServerTimestamp=None, SourcePicoseconds=None, ServerPicoseconds=None)], DiagnosticInfos=[]) DEBUG:asyncua.client.ua_client.UASocketProtocol:We did not receive enough data from server. Need 62 got 4 DEBUG:asyncua.client.ua_client.UASocketProtocol:Sending: ReadRequest(TypeId=FourByteNodeId(Identifier=631, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>), RequestHeader_=RequestHeader(AuthenticationToken=NodeId(Identifier=4017216385, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), Timestamp=datetime.datetime(2023, 2, 27, 21, 59, 27, 355048), RequestHandle=16829, ReturnDiagnostics=0, AuditEntryId=None, TimeoutHint=4000, AdditionalHeader=ExtensionObject(TypeId=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Body=None)), Parameters=ReadParameters(MaxAge=0, TimestampsToReturn_=<TimestampsToReturn.Source: 0>, NodesToRead=[ReadValueId(NodeId_=NodeId(Identifier=2259, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>), AttributeId=<AttributeIds.Value: 13>, IndexRange=None, DataEncoding=QualifiedName(NamespaceIndex=0, Name=None))])) DEBUG:asyncua.client.ua_client.UaClient:read` `DEBUG:asyncua.client.ua_client.UASocketProtocol: We did not receive enough data from server. Need 62 got 4 DEBUG:asyncua.client.ua_client.UASocketProtocol: We did not receive enough data from server. Need 124 got 80 DEBUG:asyncua.client.ua_client.UASocketProtocol: We did not receive enough data from server. Need 50 got 15` After getting these errors the subscribe method stop working and then no more tags are collected. In addition we have tested the same IGS setup with node-red which works properly during our tests ``` async def connect(self): if not self.opc_sub_handler: self.opc_sub_handler = OpcuaSubHandler( callback=self.callback_function, opc_ua_host_address=self.opc_ua_host_address, fault_callback=self.fault_callback, heart_beat_ms=self.heartbeat_ms, tags=self.tags) task = asyncio.create_task(self.opc_sub_handler.subscribe()) return task async def subscribe(self): try: await self.client.connect() subscription = await self.client.create_subscription(period=self.polling_interval, handler=self) self.__instance_nodes(self.client) server_time_node = self.client.get_node(self.ping_node_address) await subscription.subscribe_data_change(self.nodes) while True: await server_time_node.read_value() await self.client.check_connection() await asyncio.sleep(self.heart_beat_ms) except Exception as exception: await self.client.disconnect() self.fault(exception) ``` **To Reproduce**<br /> Due uncertain time it's hard to reproduce this behavior. This uncertain time can be since minutes to days. **Expected behavior**<br /> Expected behavior would be not stoping the subscribe method. **Version**<br /> Python-Version: 3.11<br /> opcua-asyncio Version: 1.0.1:
We did not receive enough data from server.
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1301/comments
1
2023-05-09T13:29:43Z
2023-05-11T14:10:34Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1301
1,702,044,048
1,301
[ "FreeOpcUa", "opcua-asyncio" ]
I have two different versions of Simatic WinCC server in operation. With the newer version the capturing of alarms and conditions works fine: ``` updating client limits to: TransportLimits(max_recv_buffer=65536, max_send_buffer=65536, max_chunk_count=0, max_message_size=16777216) updating client limits to: TransportLimits(max_recv_buffer=65536, max_send_buffer=65536, max_chunk_count=0, max_message_size=16777216) updating client limits to: TransportLimits(max_recv_buffer=65536, max_send_buffer=65536, max_chunk_count=0, max_message_size=16777216) Revised values returned differ from subscription values: CreateSubscriptionResult(SubscriptionId=16, RevisedPublishingInterval=1000.0, RevisedLifetimeCount=120, RevisedMaxKeepAliveCount=360) ``` With the older version the capturing fails: ``` updating client limits to: TransportLimits(max_recv_buffer=65536, max_send_buffer=65536, max_chunk_count=0, max_message_size=0) Revised values returned differ from subscription values: CreateSubscriptionResult(SubscriptionId=24, RevisedPublishingInterval=1000.0, RevisedLifetimeCount=120, RevisedMaxKeepAliveCount=360) Error in watchdog loop ``` I checked the opc ua protocol of the subscription process with Wireshark. The problem occures in the message CreateMonitoredItemResponse with the error code: StatusCode: 0x80430000 [BadMonitoredItemFilterInvalid] The capturing program is exactly the same, only the server IP is different. I don't want to update the WinCC server to a newer version. What can I do to find the root cause of the problem?
subscribe_alarms_and_conditions fails at CreateMonitoredItemResponse with BadMonitoredItemFilterInvalid
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1294/comments
6
2023-04-27T18:31:07Z
2023-05-11T14:10:42Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1294
1,687,365,986
1,294
[ "FreeOpcUa", "opcua-asyncio" ]
Hi! How to check if node exists on the server? Thanks!
Writing a value to a non-existent node
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1288/comments
1
2023-04-19T15:12:32Z
2023-05-11T14:09:39Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1288
1,675,124,261
1,288
[ "FreeOpcUa", "opcua-asyncio" ]
Hello! Not issue, just question. How to get the value ua type in `datachange_notification(self, node: Node, val, data)` (int, float, bool etc)? I need to sort the monitored items received depending on their ua type Thanks a lot!
How to get type of subscribed node?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1286/comments
3
2023-04-17T06:14:11Z
2023-04-18T14:05:31Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1286
1,670,491,693
1,286
[ "FreeOpcUa", "opcua-asyncio" ]
I am using server-with-encryption.py and client-with-encryption.py for testing. First, I generated certificates and keys using generate_certificate.sh and only modified the IP addresses and .cer,.pemin these three files while leaving everything else unchanged. However, when I ran the client, the server displayed the message "name='test_name') attempted to do something they are not permitted to do". So, I added a statement to client.py: client.set_user("test_name"), but it didn't work. What am I doing wrong? I read that the server-side does not support user and passwd. the server info is: `INFO:asyncua.server.internal_session:activate session INFO:asyncua.server.internal_session:Activated internal session ('192.168.40.133', 44398) for user User(role=<UserRole.User: 3>, name='test_name') INFO:asyncua.server.uaprocessor:translate browsepaths to nodeids request (User(role=<UserRole.User: 3>, name='test_name')) INFO:asyncua.server.uaprocessor:Read request (User(role=<UserRole.User: 3>, name='test_name')) WARNING:asyncua.server.uaprocessor:User(role=<UserRole.User: 3>, name='test_name') attempted to do something they are not permitted to do INFO:asyncua.server.binary_server_asyncio:processor returned False, we close connection from ('192.168.40.133', 44398) INFO:asyncua.server.binary_server_asyncio:Lost connection from ('192.168.40.133', 44398), None INFO:asyncua.server.uaprocessor:Cleanup client connection: ('192.168.40.133', 44398) ` the client info is : ` result = await self.session.write(params) File "/home/lss/demo/python/opcua-asyncio/examples/../asyncua/client/ua_client.py", line 407, in write data = await self.protocol.send_request(request) File "/home/lss/demo/python/opcua-asyncio/examples/../asyncua/client/ua_client.py", line 165, in send_request self.check_answer(data, f" in response to {request.__class__.__name__}") File "/home/lss/demo/python/opcua-asyncio/examples/../asyncua/client/ua_client.py", line 174, in check_answer hdr.ServiceResult.check() File "/home/lss/demo/python/opcua-asyncio/examples/../asyncua/ua/uatypes.py", line 372, in check raise UaStatusCodeError(self.value) asyncua.ua.uaerrors._auto.BadUserAccessDenied: "User does not have permission to perform the requested operation."(BadUserAccessDenied) `
encryption:User does not have permission
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1284/comments
4
2023-04-14T14:02:52Z
2023-10-21T16:45:45Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1284
1,668,310,999
1,284
[ "FreeOpcUa", "opcua-asyncio" ]
### Please read, before you post! This is a _**BUG REPORT for issues in the existing code**_. If you have general questions, code handling problems or ideas, please use the: Discussionsboard: https://github.com/FreeOpcUa/opcua-asyncio/discussions <br/> or <br /> Gitter-Channel: https://gitter.im/FreeOpcUa/opcua-asyncio --- To save some time, please provide us following informations, if possible: **Describe the bug** <br /> I have opened the similar ticket for [python-opcua](https://github.com/FreeOpcUa/python-opcua/issues/1516). I am advised to use the opcua-asyncio. but same problem i cannot make it work also for opcua-asyncio since I am trying to build the image in arm32v7 docker container. but i found the error in installing cryptography for opcua-asyncio development for arm32v7/python3.8 base image but it does not work . **To Reproduce**<br /> here is my docker file: `FROM arm32v7/ubuntu:20.04 WORKDIR /sinewave RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ software-properties-common \ && add-apt-repository -y ppa:deadsnakes \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ python3.8-venv \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN python3.8 -m venv /venv ENV PATH=/venv/bin:$PATH #RUN apt-get install -y python3.8 RUN pip3 install asyncua CMD [ "python3", "client.py" ]` **Screenshots**<br /> ![image](https://user-images.githubusercontent.com/2738757/231982648-1d2a3867-effb-45f9-aa84-46e514c1ae62.png) **Version**<br /> Python-Version:<br /> opcua-asyncio Version (e.g. master branch, 0.9):
python OPCUA or opcua-asyncio package installation failed in Linux ARM32V7
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1283/comments
7
2023-04-14T08:02:09Z
2023-04-17T09:05:17Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1283
1,667,737,669
1,283
[ "FreeOpcUa", "opcua-asyncio" ]
In v0.9.96 https://github.com/FreeOpcUa/opcua-asyncio/pull/1005 introduced, > Strip credentials from server_url afterwards, preventing them to be sent unencrypted in e.g. send_hello. corresponding to [this line](https://github.com/FreeOpcUa/opcua-asyncio/blob/master/asyncua/client/client.py#L61). The problem with this change creating a connection to a [Ignition's OPCUA server](https://docs.inductiveautomation.com/display/DOC81/Ignition%27s+OPC+UA+Server) in `open_secure_channel` fails with a TimeoutError. <details> ```py Traceback (most recent call last): File "example.py", line 65, in main loop.run_until_complete(task(loop)) File "example.py", line 649, in run_until_complete return future.result() File "example.py", line 39, in task async with client: File "/app/opcua-asyncio/asyncua/client/client.py", line 88, in __aenter__ await self.connect() File "/app/opcua-asyncio/asyncua/client/client.py", line 287, in connect await self.open_secure_channel() File "/app/opcua-asyncio/asyncua/client/client.py", line 374, in open_secure_channel result = await self.uaclient.open_secure_channel(params) File "/app/opcua-asyncio/asyncua/client/ua_client.py", line 308, in open_secure_channel return await self.protocol.open_secure_channel(params) File "/app/opcua-asyncio/asyncua/client/ua_client.py", line 225, in open_secure_channel await asyncio.wait_for(self._send_request(request, message_type=ua.MessageType.SecureOpen), self.timeout) File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError ``` </details> If I remove that line, the connections works with `master` branch. With that line, I get a TimeoutError for any version later than v0.9.96 which introduced this change (including master) If it helps debugging the `params` sent to open_secure_channel look as follows, ``` OpenSecureChannelParameters(ClientProtocolVersion=0, RequestType=<SecurityTokenRequestType.Issue: 0>, SecurityMode=<MessageSecurityMode.SignAndEncrypt: 3>, ClientNonce=b'<some-binary-string>', RequestedLifetime=3600000) ``` While I cannot share a workable minimal example, the connection configuration looks something like the following, <details> ```py import sys from asyncua import Client, ua from asyncua.crypto.security_policies import SecurityPolicyBasic256Sha256 async def task(loop): url = "opc.tcp://<user>:<password>@<host>:<port>/discovery" client = Client(url=url, timeout=10) await client.set_security( SecurityPolicyBasic256Sha256, certificate=cert, private_key=private_key, mode=ua.MessageSecurityMode.SignAndEncrypt, server_certificate=server_cert, ) client.application_uri = "<some-urn>" async with client: ... def main(): loop = asyncio.get_event_loop() loop.set_debug(True) loop.run_until_complete(task(loop)) loop.close() ``` </details> So my request is either to remove that line or allow disabling it via for instance an extra parameter `Client(..., strip_credentials=False)`. (I can make a PR) **Version** Python-Version: 3.10 opcua-asyncio Version: master, and any version >= v0.9.96 cc @cziebuhr @oroulet
open_secure_channel fails with TimeoutError with stripped credentials
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1281/comments
2
2023-04-11T17:00:53Z
2023-09-13T10:44:43Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1281
1,662,901,793
1,281
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> When using the sync Client and creating a sync subscription, calls to the _make_monitored_item_request throw an exception. It appears that the required sampling_interval parameter is not being provided when calling the underlying async _make_monitored_item_request method. **To Reproduce**<br /> Attempt to call the sync subscription _make_monitored_item_request method. **Expected behavior**<br /> An exception is not thrown **Screenshots**<br /> N/A **Version**<br /> Python-Version: observed on 3.8, but appear to affect all versions opcua-asyncio Version (e.g. master branch, 0.9): observed on 1.0.1
Sync subscription _make_monitored_item_request missing param
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1273/comments
0
2023-04-04T18:38:50Z
2023-05-02T08:57:06Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1273
1,654,385,038
1,273
[ "FreeOpcUa", "opcua-asyncio" ]
Hello dear people, I have a variable here that is declared inside a loop. Now I want to change single values in the Get function. The loop goes from 0 to 14. I want to change NodeId 4. Can anyone help me, I would be very grateful for help. Here is my code: var WarningH = namespace3.addVariable({ componentOf: nr, browseName: "WarningH", dataType: opcua.DataType.Float, nodeId: "ns=3;s=" + "\"ZEEX_3111_Parameter\".\"udtEmPz\"" + "[" + i + "]" + ".\"rTempH\".\"Set\"", value: { get: function () { var WarningHNodeId = this.nodeId.value; return new opcua.Variant({ dataType: opcua.DataType.Float, value: serverValues[WarningHNodeId] }); }, set: function (variant) { const WarningHNodeId = this.nodeId.value; serverValues[WarningHNodeId] = parseFloat(variant.value); console.log(`Setter-Funktion aufgerufen für WarningH mit nodeId "${WarningHNodeId}": ${serverValues[WarningHNodeId]}`); console.log(`------------------------------------`); const neueNodeId = WarningHNodeId.replace("Set", "Min"); //Replace Funktion wurde hier zwei mal angewendet, zuerst Set durch min tauschen und dann rTempTolH auf rTempTolHH const AlarmHHMinNodeId = neueNodeId.replace("rTempH", "rTempHH"); serverValues[AlarmHHMinNodeId] = serverValues[WarningHNodeId] console.log(`AlarmHHMin nodeId:${AlarmHHMinNodeId}\nAlarmHHMin Wert: ${serverValues[AlarmHHMinNodeId]}\n`); // serverValues[rActNodeId] = serverValues[rSetNodeId]; return opcua.StatusCodes.Good; } } })
Change a single value of NodeId's within a loop
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1268/comments
1
2023-03-30T15:38:40Z
2023-03-30T15:42:51Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1268
1,647,869,559
1,268
[ "FreeOpcUa", "opcua-asyncio" ]
There is the theoretical risk of an endless loop and memory leakage, when the socket is still open, but no more publish requests are received: When lifetime limit is reached, the loop is not stopped. That leads to changes still queuing up and consuming more and more memory. In python-opcua the loop was stopped, but changes were still queuing up (https://github.com/FreeOpcUa/python-opcua/blob/master/opcua/server/internal_subscription.py#L313) If PublishingInterval is 0, trigger_statuschange even leads to an endless recursion. According to the spec (https://reference.opcfoundation.org/Core/Part4/v105/docs/5.13): > When this counter reaches the value calculated for the lifetime of a Subscription based on the MaxKeepAliveCount parameter in the CreateSubscription Service (5.13.2), the Subscription is closed.
Subscription loop is not stopped when LifetimeCount is reached
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1267/comments
5
2023-03-29T15:45:03Z
2024-06-12T16:40:32Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1267
1,646,081,368
1,267
[ "FreeOpcUa", "opcua-asyncio" ]
I'm trying to create alias for node. With using of examples.client-minimal.py i make my local OPC UA server with one variable - MyVariable. Variable in UaExpert ![image](https://user-images.githubusercontent.com/86944512/227904240-d982c689-e8a6-4ddd-b356-b00e665c9f2f.png) I set alias to MyVariable by this code: ``` async with Client(url="opc.tcp://admin@localhost:4840/freeopcua/server/") as client: var = await client.nodes.root.get_child( ["0:Objects", f"2:MyObject", f"2:MyVariable"] ) alias = ua.LocalizedText("MB0") await var.write_attribute(ua.AttributeIds.DisplayName, ua.DataValue(alias)) ``` After setting alias "MB0" i connect to server by UaExpert. When i use Root -> Objects -> Aliases -> FindAlias call with "MB0" ![image](https://user-images.githubusercontent.com/86944512/227904454-a17bc948-d4e6-4f59-9686-675e818e5021.png) There is a error: "BadNothingToDo". And this tells me that I created the alias incorrectly. What i am doing wrong and how can i fix alias setting?
Cannot create alias for node.
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1264/comments
3
2023-03-27T09:43:03Z
2023-04-13T11:02:15Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1264
1,641,764,306
1,264
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> asynctest is no longer supported and doesn't work with Python 3.11 (Martiusweb/asynctest#163). **To Reproduce**<br /> Run tests with Python 3.11 **Expected behavior**<br /> Test to pass on all Python releases **Version**<br /> Python-Version:> =3.11<br /> opcua-asyncio Version (e.g. master branch, 0.9): not relevat
Remove asynctest
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1263/comments
2
2023-03-27T08:04:36Z
2023-03-28T05:41:53Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1263
1,641,600,856
1,263
[ "FreeOpcUa", "opcua-asyncio" ]
I have no clue how to add new instances on a server, having already imported the xml files I need. I’ve been looking around and found some module called node management service, but I can’t import it. Is it an old module? I don’t find it in the docs either. Maybe someone can help me out! thanks in advance
Add instances from an imported xml file
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1261/comments
1
2023-03-27T05:35:01Z
2023-03-27T07:43:38Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1261
1,641,410,147
1,261
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, I am currently facing an issue with my opc ua server. I am trying to import the xml file of several Companion Specifications, as my information model relies on DataTypes that are specified within these specifications. Loading the xml File of DI, Machinery, PackML and IA seems to work fine. Loading the Scales nodeset does not work - my server script and the error message follows. All Nodesets come from the OPCF Github: https://github.com/OPCFoundation/UA-Nodeset Server: ``` import asyncio from asyncua import ua, Server import os # Define the path to the XML file containing the information model endpoint_url = "opc.tcp://localhost:4840/" DI_path = os.path.abspath("C:/Users/X/Documents/Demonstrator_Software/Server/Opc.Ua.Di.NodeSet2.xml") PackML_path = os.path.abspath("C:/Users/X/Documents/Demonstrator_Software/Server/Opc.Ua.PackML.NodeSet2.xml") IA_path = os.path.abspath("C:/Users/X/Documents/Demonstrator_Software/Server/Opc.Ua.IA.NodeSet2.xml") machinery_path = os.path.abspath("C:/Users/X/Documents/Demonstrator_Software/Server/Opc.Ua.Machinery.NodeSet2.xml") scales_path = os.path.abspath("C:/Users/X/Documents/Demonstrator_Software/Server/Opc.Ua.Scales.NodeSet2.xml") #nodeset_path = os.path.abspath("C:/Users/X/Documents/Demonstrator_Software/Server/opcuacs_demonstrator.xml") async def main(): # Initialize the OPC UA server server = Server() await server.init() server.set_endpoint(endpoint_url) server.set_server_name("Test Server") server.set_security_policy( [ ua.SecurityPolicyType.NoSecurity, #ua.SecurityPolicyType.Basic256Sha256_SignAndEncrypt, #ua.SecurityPolicyType.Basic256Sha256_Sign, ] ) # Load the information model from the XML file await server.import_xml(DI_path) print("DI loaded") await server.import_xml(PackML_path) print("PackML loaded") await server.import_xml(IA_path) print("IA loaded") await server.import_xml(machinery_path) print("Machinery loaded") await server.import_xml(scales_path) print("Scales loaded") print("Server started") async with server: while True: await asyncio.sleep(1) if __name__ == "__main__": asyncio.run(main()) ``` Error/Terminal output: ``` TESTSERVER_demonstrator_2.py qn: QualifiedName(NamespaceIndex=1, Name='Lock') qn: QualifiedName(NamespaceIndex=1, Name='SoftwareUpdate') NodeData(nodeid:NodeId(Identifier=333, NamespaceIndex=2, NodeIdType=<NodeIdType.Numeric: 2>)) has datatypedefinition and path [Node(NumericNodeId(Identifier=84, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>)), Node(NumericNodeId(Identifier=86, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>)), Node(NodeId(Identifier=90, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>)), Node(NumericNodeId(Identifier=24, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>)), Node(NumericNodeId(Identifier=26, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>)), Node(NumericNodeId(Identifier=28, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>)), Node(NodeId(Identifier=7, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>))] but we could not find out if this is a struct DI loaded PackML loaded IA loaded qn: QualifiedName(NamespaceIndex=2, Name='Identification') qn: QualifiedName(NamespaceIndex=2, Name='Identification') qn: QualifiedName(NamespaceIndex=1, Name='Components') qn: QualifiedName(NamespaceIndex=1, Name='MachineryItemState') qn: QualifiedName(NamespaceIndex=1, Name='MachineryOperationMode') Machinery loaded failure adding node NodeData(nodeid:NodeId(Identifier=53, NamespaceIndex=6, NodeIdType=<NodeIdType.Numeric: 2>)) object of type 'ExtObj' has no len() Traceback (most recent call last): File "c:\Users\X\Documents\Demonstrator_Software\Server\TESTSERVER_demonstrator_2.py", line 50, in <module> unners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "c:\Users\X\Documents\Demonstrator_Software\Server\TESTSERVER_demonstrator_2.py", line 39, in main await server.import_xml(scales_path) File "C:\Users\X\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\asyncua\server\server.py", line 616, in import_xml return await importer.import_xml(path, xmlstring) File "C:\Users\X\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\asyncua\common\xmlimporter.py", line 138, in import_xml node = await self._add_node_data(nodedata, no_namespace_migration=True) File "C:\Users\X\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\asyncua\common\xmlimporter.py", line 234, in _add_node_data node = await self.add_variable_type(nodedata, no_namespace_migration) File "C:\Users\X\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\asyncua\common\xmlimporter.py", line 512, in add_variable_type if obj.value and len(obj.value) == 1:TypeError: object of type 'ExtObj' has no len() ``` I hope i will be able to solve this as i am trying to get this to work before April. Thank you all in Advance.
Error in xmlimporter.py? Can not import the xml file of the Scales Companion Specification
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1256/comments
3
2023-03-23T10:42:03Z
2023-03-31T12:12:41Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1256
1,637,269,686
1,256
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> I am using the sync wrapper. Whenever i try to connect to an OPC UA Server with a certificate that the server is not trusting the Exception exceptions.TimeoutError is being raised. I expected that some better exception would be raised, e.g. BadCertificateUntrusted exception. asyncua.uaprotocol log gives `[WARNING] (asyncua.uaprotocol): Received an error: ErrorMessage(Error=StatusCode(value=2148728832), Reason=None)` The OPC UA Error Codes list says that 2148728832 is BadSecurityChecksFailed. So the library is identifying the issue correctly, but it seems that the sync wrapper is not passing this exception. **To Reproduce**<br /> try to connect to an OPC UA server whith an untrusted certificate. ``` from asyncua.sync import Client opcua_client = Client(self.opcua_address) opcua_client.set_security_string("Basic256Sha256,SignAndEncrypt,pubkey.der,privkey.pem") opcua_client.connect() ``` **Expected behavior**<br /> Not to raise TimeoutError but raise something like BadCertificateUntrusted **Version**<br /> Python-Version:3.8.12<br /> opcua-asyncio Version master branch, 1.0.1
sync wrapper: connecting with wrong certificate will lead to TimeoutError
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1254/comments
1
2023-03-22T14:22:18Z
2023-03-29T12:44:57Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1254
1,635,865,439
1,254
[ "FreeOpcUa", "opcua-asyncio" ]
Hii, my server runs 24/7, but my client is dying after receiving little data from server, my client should also run 24/7. Please find my client below. ``` import asyncio from asyncua import ua from asyncua import Client import requests import json class SubHandler(object): """Subscription Handler. To receive events from server for a subscription""" def datachange_notification(self, node, val, data): csv_url = "http://localhost:3001/pushprocesseddata" """This functions gets he notifications when data is changed""" sdt = data.monitored_item.Value.SourceTimestamp.strftime("%Y-%m-%d %H:%M:%S:%f")[:-3] row = {"RECORDED_DTTM": sdt, "POINT_ID": str(node).split("s=")[2], "RECORDED_VALUE": val} print(row) async def main(): """This is the main function for the client""" url = "opc.tcp://admin@localhost:4849" async with Client(url=url) as client: print("Root node is: %r", client.nodes.root) print("Objects node is: %r", client.nodes.objects) print("Children of root are: %r", await client.nodes.root.get_children()) uri = "Softsensor_OPC_Server_2" idx = await client.get_namespace_index(uri) print("idx",idx) myvar = await client.get_node("ns=2;i=1").get_children() # myvar_predicted = await client.get_node("ns=3;i=1").get_children() handler = SubHandler() sub = await client.create_subscription(10, handler) **#When I give 10, I'm receving ~1400 records. When using 100, I'm receving 14000 records. When I give 200, no result and client is just terminating with out any errors.** handle = await sub.subscribe_data_change(myvar) print("handle",handle) await asyncio.sleep(0.1) await sub.subscribe_events() ```
Client is dying after receiving little data
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1252/comments
28
2023-03-20T14:33:36Z
2023-03-23T16:57:49Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1252
1,632,240,716
1,252
[ "FreeOpcUa", "opcua-asyncio" ]
Hi folks, It seems to me from code that JWT is not supported, is that correct? If so, do you plan to introduce it? Cheers, JK
JSON Web Token support
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1247/comments
0
2023-03-16T11:43:40Z
2023-03-16T12:41:41Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1247
1,627,300,976
1,247
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> In case when the server has a certificate signed by CA root while the client is opening a secure connection to a server, the server sends a certificate chain to the client. The `opcua-asyncio` client is unable to parse such cefrtyficate chain and fails. This issue was already reported here: [https://github.com/FreeOpcUa/opcua-asyncio/issues/1148](https://github.com/FreeOpcUa/opcua-asyncio/issues/1148) and as a continuation here (I added my observations there): [https://github.com/pyca/cryptography/issues/7901](https://github.com/pyca/cryptography/issues/7901) **To Reproduce**<br /> - as a server is used `C++ SDK Demo Server` with the certificate "signed by" `UAGDS security management` (server contains on certificate signed by CA root and CA root certificate) - the following code is used: ``` import asyncio import logging import sys sys.path.insert(0, "..") from asyncua import Client, Node, ua from asyncua.crypto.security_policies import SecurityPolicyBasic256Sha256 logging.basicConfig(level=logging.INFO) _logger = logging.getLogger("asyncua") async def task(loop): url = "opc.tcp://@2V43YK2:48010" # UA Demo Server Cpp client = Client(url=url) client.set_user('root') client.set_password('secret') await client.set_security( SecurityPolicyBasic256Sha256, certificate=r"C:\other\opcua-asyncio\examples\certs_pisz\cert.der", private_key=r"C:\other\opcua-asyncio\examples\certs_pisz\pkey.pem", ) async with client: objects = client.nodes.objects child = await objects.get_children() print(child) def main(): loop = asyncio.get_event_loop() loop.set_debug(True) loop.run_until_complete(task(loop)) loop.close() if __name__ == "__main__": main() ``` it results: ``` C:\Users\PSznapk\AppData\Local\Programs\Python\Python310-32\python.exe C:\other\opcua-asyncio\examples\client-with-encryption.py C:\Users\PSznapk\AppData\Local\Programs\Python\Python310-32\lib\site-packages\cryptography\hazmat\backends\openssl\backend.py:61: UserWarning: You are using cryptography on a 32-bit Python on a 64-bit Windows Operating System. Cryptography will be significantly faster if you switch to using a 64-bit Python. from cryptography.hazmat.bindings.openssl import binding C:\other\opcua-asyncio\examples\client-with-encryption.py:29: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() INFO:asyncua.client.ua_client.UaClient:opening connection INFO:asyncua.uaprotocol:updating client limits to: TransportLimits(max_recv_buffer=65536, max_send_buffer=65536, max_chunk_count=256, max_message_size=16777216) INFO:asyncua.client.ua_client.UASocketProtocol:open_secure_channel INFO:asyncua.client.ua_client.UASocketProtocol:close_secure_channel INFO:asyncua.client.ua_client.UASocketProtocol:Request to close socket received INFO:asyncua.client.client:find_endpoint [EndpointDescription(EndpointUrl='opc.tcp://2V43YK2:48010', Server=ApplicationDescription(ApplicationUri='urn:2V43YK2:UnifiedAutomation:UaServerCpp', ProductUri='urn:UnifiedAutomation:UaServerCpp', ApplicationName=LocalizedText(Locale='en', Text='UaServerCpp@2V43YK2'), ApplicationType_=<ApplicationType.Server: 0>, GatewayServerUri=None, DiscoveryProfileUri=None, DiscoveryUrls=['opc.tcp://2V43YK2:48010']), ServerCertificate=b'0\x82\x04{0\x82\x03c\xa0\x03\x02\x01\x02\x02\x0f\x145\x87\x83pBq6C\x10\x00\x00\x00\x00\t0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230314075636Z\x17\r240320075636Z0\x81\x811\x170\x15\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x072V43YK21\x0b0\t\x06\x03U\x04\x06\x13\x02DE1\x150\x13\x06\x03U\x04\x07\x0c\x0cLocationName1\x150\x13\x06\x03U\x04\n\x0c\x0cOrganization1\r0\x0b\x06\x03U\x04\x0b\x0c\x04Unit1\x1c0\x1a\x06\x03U\x04\x03\x0c\x13UaServerCpp@2V43YK20\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xd3\x84\xeap\xbf.\x1c\xc3\xb7\xe2\xf8q\xae\xa1Z\x1b\\9\xfa\xf2\xb9D\x91C\xd6\xb3\xc3\xf7\x95d\x1a\xbanz\xd1}T\x07\xf7U\xa2T@\x94~^\x06\r\x87\xee\xc5\xeb\x0c[KE\xa2\xc3\xde\xe8\x17\r-xT\x98N\x98\xf2\x1c\xaf\xce~n\xdc7#\xb1gTU\xc0m\x80\xb1\xed\xf0\x92?F\x9fS4v\x88\xcf3G\x05xwI6\xeb\x03\x0c\x9b\xda\xb4\xd5\xf5i\xfepN\xf6!,\xd0*\xf3\x13UNd\xdc\x86+\x02\x8a;8\x87\x1f\x04\xc4\x90\x08\xbf\x855\x1e\x01s\xb8h\xa7\x84\xda\xc5\x1c\x145\xe5]\r\xe0+\xe2\xdf$\x0b,\xcfK\xa5ew\x10\r\x82\x1d\xaa\xec\x90\xa5\x7f\x07C\xc4+\x83\xd0\x9b\x0f\xfe\xb1:\x07\x08*\xbb\xa0{R\x17\x01\xee\x8c\xe3W\xf4^\xe2X\x1b(\xa7\xa0j\r\x13\xb1\x81\xcc\x15;\x9fLe\xf2:\xacy!5\x97\x08ZL\xd1\x84"\x89!H\x9buv>\x15\x10\xe3>\x0f\x85\xae\x7f\xb27>j\xb5\t\x96\x85\x02\x03\x01\x00\x01\xa3\x82\x01=0\x82\x0190\x0c\x06\x03U\x1d\x13\x01\x01\xff\x04\x020\x0000\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xaf3\xc4\xe8\x82.\x17\xc0vz\xb0\x06\x98\x89c(\x11\x8d\x9a\x1c0g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x04\xf00 \x06\x03U\x1d%\x01\x01\xff\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020=\x06\x03U\x1d\x11\x04604\x86)urn:2V43YK2:UnifiedAutomation:UaServerCpp\x82\x072V43YK20\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00\x8e]9\x16\xbb\xa0\xa99\xa4\x9e\xd9_\xc9\xbb\xad\r\xb5\xff\xf94\xdd\x8d\x97\xa3y\'I\x17\xf5\x8c\x12\x02\xe5\xfc]\xe0\xa2\x8d>)\x9a\x08+\xf1\xe1\x0ew\xa6[\x10\x91\x9a\xae!\xf6\x0f\xa3\r\x88\x96\xc9\xe6\xee\xd5:\x98S\xfb\xc8\xf4h\x9d\x81\x83\x15q\xb7aG)J\x8d\x7f\xb6\xffZY\x13\xc6mPM\xc5\xbc\xd7\xc9%\x1aqK\xf1\xc9\xe3K\xd2\xfd\x93\xec\x05\xfd\xa4\x1d\x1d\x9e\xdeR\x96\x85@\xa9\xe5H\x98\xde\xbax\x01\x81\x01\xb9\xaf2\x04J`\xad\xdcD\xc7)\xd4V\x18\xf2kU\xd8\xe6\xb4\x06*b\x97\xf5\x85\xdb&T\x8b\xbec\x97XNP\xe6ng\x93\x8c\ne\x0ej\xe6\x96%\xa37\xab\x7fz\xfc\xe6\xe1\xcc\x1c\xcb\xa4\x9eck 7\xd9N\x08\x88\xfc\x8d\x9e\xdc(z09\x885u\xb5r\x94FN\x1e\xd6/\x19?\x18!\x0b\xe0\x89\x04/\x080\xa2\xefj\x08\rp\rl\xb9\x1b\x7f\xbb\xa3\x13\x8d\x1f\n\xa7r\xd5\xe0\x8e\xc5:\x96\x05q\x870\x82\x04"0\x82\x03\n\xa0\x03\x02\x01\x02\x02\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230301105339Z\x17\r250228105339Z011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xec\xfbu\x15\x17$\xcb\xd8\xed%E\x8d\xad8\x8a\xc8\x87\xb0F(\x93\x12\xa4WXPsZ\xd0E\xfd\x8c\x0c\xd5\x979\xe1\xc1[\xfe\x85*k\xf1\xfe\xc6\x91\xc5\x07\xf6\xeep6p.\xb64z\xd5\x1c\xa6\xc6\x8bx\xee\x03\x7f\x94\xe6#c2\x16l\x06\x17F\xc1\xca:\x10\xecdL\x85.\xc8\x8a\x00v\xe6\x16\x19\xe9:\xa0\x0c\xfd\x86^\x83*B\xca)\xd1\x8b\xa7\xb9\xe2\x18$\xe62\x96\xc4#\x87\xdc\xc9\\k\x0f)0\xd7\xc6\x9aT5\x11\x89\xdet\x10^\xd3\x9a\xefB\x8ff,\xfeZI8~\xd7\xa5;\x1d\xe3\xab7\xbd\xf2\x9c{0\xb7:\xd9qf\xe7\xc3p\xb9\x97o9\xe0\xe2\xa5\x9b\xdb 3\x08\x90\xfc\xfeI\x97\x7f\x9c\xad\n\xc4\x9d\x9e\xfe\x04\xad\rK\xfbD\xcc\x81\xaf\x9f\xd2s\xc8R|ZN\xc78X\x04o\xea\xd3-\xa4\xa5\xf7*\xb1\xe6+\x89\x9d\xcb\xb9W\xa0{\xef\xe5\x08\xf4\x16)8\xfa\x14\xf3f4@t\xa99\x9dVdI3G\xfe\xf3\x02\x03\x01\x00\x01\xa3\x82\x0150\x82\x0110\x0f\x06\x03U\x1d\x13\x01\x01\xff\x04\x050\x03\x01\x01\xff00\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x8310g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\xe60T\x06\x03U\x1d\x11\x04M0K\x865urn:UnifiedAutomation:UaGds:Server:2V43YK2.ra-int.com\x82\x122V43YK2.ra-int.com0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00L\xe5%WBr\x1914\xd0%\xb2\x8a\x80\xbd\xccLR\x9f|\xd3\xabS!~\x83\xe0\xc23\x1e\xdc\xc8Yb\xce\xc9@\x83\x9a\x84s\x08u\xfa"K\xe1\x92\xbd\xd2\xf3\xdb\x7f8\xa1\xee\xfak9\x1e\xe4\xf8\x183nr5/\xe5\xca\x11\x11vbN\n\x7f\xc3\x04\x83i\xa9P\x9d\x83R\xe9o\xbc\xce\x8a\x945\xaf\x8c\xfa\x0b\xd8*&\n\xe7\xb7b\xdeV\xfa\xf7\xd3\xbb\x82\x03\xcd\x00\xa6t\x92\xef\xd1V\x93\xd60\xff\xee\x84\x81Mb\xdbG:\xfcCW\x05\xc2T_\x1d\xa1y\\\xfa\x87\xb8\xad\xf9EYJ\xd5X\x0ehE\xdf\x99\xabI\x01\x91\x83"C\xb1~Hc\x06P\x9dsQ\xed\xf39"\xa6\x14O\x07:\xe6<n\xf9fZ\xd9\xe4eX5\x03\x10\x99\xc8\xfcA\x94\x16r\xff\xf1\x90"[\xb0\xd3\xc5\xfbo\x9cI*\x0b:/\xde\x05.\xb1\xa7\x81\xd5\xa1\xb6(9s\xa0\x95\x01\xb0\x02\xadD\x05*\xa1\xfa"\r\x05I\x9b\xd3i6\xc8\x97\x91\x0b="', SecurityMode=<MessageSecurityMode.None_: 1>, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#None', UserIdentityTokens=[UserTokenPolicy(PolicyId='Anonymous-[0]-None-None', TokenType=<UserTokenType.Anonymous: 0>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri=None), UserTokenPolicy(PolicyId='UserName-[0]-None-None', TokenType=<UserTokenType.UserName: 1>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256'), UserTokenPolicy(PolicyId='Certificate-[0]-None-None', TokenType=<UserTokenType.Certificate: 2>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256')], TransportProfileUri='http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary', SecurityLevel=0), EndpointDescription(EndpointUrl='opc.tcp://2V43YK2:48010', Server=ApplicationDescription(ApplicationUri='urn:2V43YK2:UnifiedAutomation:UaServerCpp', ProductUri='urn:UnifiedAutomation:UaServerCpp', ApplicationName=LocalizedText(Locale='en', Text='UaServerCpp@2V43YK2'), ApplicationType_=<ApplicationType.Server: 0>, GatewayServerUri=None, DiscoveryProfileUri=None, DiscoveryUrls=['opc.tcp://2V43YK2:48010']), ServerCertificate=b'0\x82\x04{0\x82\x03c\xa0\x03\x02\x01\x02\x02\x0f\x145\x87\x83pBq6C\x10\x00\x00\x00\x00\t0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230314075636Z\x17\r240320075636Z0\x81\x811\x170\x15\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x072V43YK21\x0b0\t\x06\x03U\x04\x06\x13\x02DE1\x150\x13\x06\x03U\x04\x07\x0c\x0cLocationName1\x150\x13\x06\x03U\x04\n\x0c\x0cOrganization1\r0\x0b\x06\x03U\x04\x0b\x0c\x04Unit1\x1c0\x1a\x06\x03U\x04\x03\x0c\x13UaServerCpp@2V43YK20\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xd3\x84\xeap\xbf.\x1c\xc3\xb7\xe2\xf8q\xae\xa1Z\x1b\\9\xfa\xf2\xb9D\x91C\xd6\xb3\xc3\xf7\x95d\x1a\xbanz\xd1}T\x07\xf7U\xa2T@\x94~^\x06\r\x87\xee\xc5\xeb\x0c[KE\xa2\xc3\xde\xe8\x17\r-xT\x98N\x98\xf2\x1c\xaf\xce~n\xdc7#\xb1gTU\xc0m\x80\xb1\xed\xf0\x92?F\x9fS4v\x88\xcf3G\x05xwI6\xeb\x03\x0c\x9b\xda\xb4\xd5\xf5i\xfepN\xf6!,\xd0*\xf3\x13UNd\xdc\x86+\x02\x8a;8\x87\x1f\x04\xc4\x90\x08\xbf\x855\x1e\x01s\xb8h\xa7\x84\xda\xc5\x1c\x145\xe5]\r\xe0+\xe2\xdf$\x0b,\xcfK\xa5ew\x10\r\x82\x1d\xaa\xec\x90\xa5\x7f\x07C\xc4+\x83\xd0\x9b\x0f\xfe\xb1:\x07\x08*\xbb\xa0{R\x17\x01\xee\x8c\xe3W\xf4^\xe2X\x1b(\xa7\xa0j\r\x13\xb1\x81\xcc\x15;\x9fLe\xf2:\xacy!5\x97\x08ZL\xd1\x84"\x89!H\x9buv>\x15\x10\xe3>\x0f\x85\xae\x7f\xb27>j\xb5\t\x96\x85\x02\x03\x01\x00\x01\xa3\x82\x01=0\x82\x0190\x0c\x06\x03U\x1d\x13\x01\x01\xff\x04\x020\x0000\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xaf3\xc4\xe8\x82.\x17\xc0vz\xb0\x06\x98\x89c(\x11\x8d\x9a\x1c0g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x04\xf00 \x06\x03U\x1d%\x01\x01\xff\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020=\x06\x03U\x1d\x11\x04604\x86)urn:2V43YK2:UnifiedAutomation:UaServerCpp\x82\x072V43YK20\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00\x8e]9\x16\xbb\xa0\xa99\xa4\x9e\xd9_\xc9\xbb\xad\r\xb5\xff\xf94\xdd\x8d\x97\xa3y\'I\x17\xf5\x8c\x12\x02\xe5\xfc]\xe0\xa2\x8d>)\x9a\x08+\xf1\xe1\x0ew\xa6[\x10\x91\x9a\xae!\xf6\x0f\xa3\r\x88\x96\xc9\xe6\xee\xd5:\x98S\xfb\xc8\xf4h\x9d\x81\x83\x15q\xb7aG)J\x8d\x7f\xb6\xffZY\x13\xc6mPM\xc5\xbc\xd7\xc9%\x1aqK\xf1\xc9\xe3K\xd2\xfd\x93\xec\x05\xfd\xa4\x1d\x1d\x9e\xdeR\x96\x85@\xa9\xe5H\x98\xde\xbax\x01\x81\x01\xb9\xaf2\x04J`\xad\xdcD\xc7)\xd4V\x18\xf2kU\xd8\xe6\xb4\x06*b\x97\xf5\x85\xdb&T\x8b\xbec\x97XNP\xe6ng\x93\x8c\ne\x0ej\xe6\x96%\xa37\xab\x7fz\xfc\xe6\xe1\xcc\x1c\xcb\xa4\x9eck 7\xd9N\x08\x88\xfc\x8d\x9e\xdc(z09\x885u\xb5r\x94FN\x1e\xd6/\x19?\x18!\x0b\xe0\x89\x04/\x080\xa2\xefj\x08\rp\rl\xb9\x1b\x7f\xbb\xa3\x13\x8d\x1f\n\xa7r\xd5\xe0\x8e\xc5:\x96\x05q\x870\x82\x04"0\x82\x03\n\xa0\x03\x02\x01\x02\x02\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230301105339Z\x17\r250228105339Z011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xec\xfbu\x15\x17$\xcb\xd8\xed%E\x8d\xad8\x8a\xc8\x87\xb0F(\x93\x12\xa4WXPsZ\xd0E\xfd\x8c\x0c\xd5\x979\xe1\xc1[\xfe\x85*k\xf1\xfe\xc6\x91\xc5\x07\xf6\xeep6p.\xb64z\xd5\x1c\xa6\xc6\x8bx\xee\x03\x7f\x94\xe6#c2\x16l\x06\x17F\xc1\xca:\x10\xecdL\x85.\xc8\x8a\x00v\xe6\x16\x19\xe9:\xa0\x0c\xfd\x86^\x83*B\xca)\xd1\x8b\xa7\xb9\xe2\x18$\xe62\x96\xc4#\x87\xdc\xc9\\k\x0f)0\xd7\xc6\x9aT5\x11\x89\xdet\x10^\xd3\x9a\xefB\x8ff,\xfeZI8~\xd7\xa5;\x1d\xe3\xab7\xbd\xf2\x9c{0\xb7:\xd9qf\xe7\xc3p\xb9\x97o9\xe0\xe2\xa5\x9b\xdb 3\x08\x90\xfc\xfeI\x97\x7f\x9c\xad\n\xc4\x9d\x9e\xfe\x04\xad\rK\xfbD\xcc\x81\xaf\x9f\xd2s\xc8R|ZN\xc78X\x04o\xea\xd3-\xa4\xa5\xf7*\xb1\xe6+\x89\x9d\xcb\xb9W\xa0{\xef\xe5\x08\xf4\x16)8\xfa\x14\xf3f4@t\xa99\x9dVdI3G\xfe\xf3\x02\x03\x01\x00\x01\xa3\x82\x0150\x82\x0110\x0f\x06\x03U\x1d\x13\x01\x01\xff\x04\x050\x03\x01\x01\xff00\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x8310g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\xe60T\x06\x03U\x1d\x11\x04M0K\x865urn:UnifiedAutomation:UaGds:Server:2V43YK2.ra-int.com\x82\x122V43YK2.ra-int.com0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00L\xe5%WBr\x1914\xd0%\xb2\x8a\x80\xbd\xccLR\x9f|\xd3\xabS!~\x83\xe0\xc23\x1e\xdc\xc8Yb\xce\xc9@\x83\x9a\x84s\x08u\xfa"K\xe1\x92\xbd\xd2\xf3\xdb\x7f8\xa1\xee\xfak9\x1e\xe4\xf8\x183nr5/\xe5\xca\x11\x11vbN\n\x7f\xc3\x04\x83i\xa9P\x9d\x83R\xe9o\xbc\xce\x8a\x945\xaf\x8c\xfa\x0b\xd8*&\n\xe7\xb7b\xdeV\xfa\xf7\xd3\xbb\x82\x03\xcd\x00\xa6t\x92\xef\xd1V\x93\xd60\xff\xee\x84\x81Mb\xdbG:\xfcCW\x05\xc2T_\x1d\xa1y\\\xfa\x87\xb8\xad\xf9EYJ\xd5X\x0ehE\xdf\x99\xabI\x01\x91\x83"C\xb1~Hc\x06P\x9dsQ\xed\xf39"\xa6\x14O\x07:\xe6<n\xf9fZ\xd9\xe4eX5\x03\x10\x99\xc8\xfcA\x94\x16r\xff\xf1\x90"[\xb0\xd3\xc5\xfbo\x9cI*\x0b:/\xde\x05.\xb1\xa7\x81\xd5\xa1\xb6(9s\xa0\x95\x01\xb0\x02\xadD\x05*\xa1\xfa"\r\x05I\x9b\xd3i6\xc8\x97\x91\x0b="', SecurityMode=<MessageSecurityMode.Sign: 2>, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256', UserIdentityTokens=[UserTokenPolicy(PolicyId='Anonymous-[0]-Sign-Basic256Sha256', TokenType=<UserTokenType.Anonymous: 0>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri=None), UserTokenPolicy(PolicyId='UserName-[0]-Sign-Basic256Sha256', TokenType=<UserTokenType.UserName: 1>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256'), UserTokenPolicy(PolicyId='Certificate-[0]-Sign-Basic256Sha256', TokenType=<UserTokenType.Certificate: 2>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256')], TransportProfileUri='http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary', SecurityLevel=65), EndpointDescription(EndpointUrl='opc.tcp://2V43YK2:48010', Server=ApplicationDescription(ApplicationUri='urn:2V43YK2:UnifiedAutomation:UaServerCpp', ProductUri='urn:UnifiedAutomation:UaServerCpp', ApplicationName=LocalizedText(Locale='en', Text='UaServerCpp@2V43YK2'), ApplicationType_=<ApplicationType.Server: 0>, GatewayServerUri=None, DiscoveryProfileUri=None, DiscoveryUrls=['opc.tcp://2V43YK2:48010']), ServerCertificate=b'0\x82\x04{0\x82\x03c\xa0\x03\x02\x01\x02\x02\x0f\x145\x87\x83pBq6C\x10\x00\x00\x00\x00\t0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230314075636Z\x17\r240320075636Z0\x81\x811\x170\x15\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x072V43YK21\x0b0\t\x06\x03U\x04\x06\x13\x02DE1\x150\x13\x06\x03U\x04\x07\x0c\x0cLocationName1\x150\x13\x06\x03U\x04\n\x0c\x0cOrganization1\r0\x0b\x06\x03U\x04\x0b\x0c\x04Unit1\x1c0\x1a\x06\x03U\x04\x03\x0c\x13UaServerCpp@2V43YK20\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xd3\x84\xeap\xbf.\x1c\xc3\xb7\xe2\xf8q\xae\xa1Z\x1b\\9\xfa\xf2\xb9D\x91C\xd6\xb3\xc3\xf7\x95d\x1a\xbanz\xd1}T\x07\xf7U\xa2T@\x94~^\x06\r\x87\xee\xc5\xeb\x0c[KE\xa2\xc3\xde\xe8\x17\r-xT\x98N\x98\xf2\x1c\xaf\xce~n\xdc7#\xb1gTU\xc0m\x80\xb1\xed\xf0\x92?F\x9fS4v\x88\xcf3G\x05xwI6\xeb\x03\x0c\x9b\xda\xb4\xd5\xf5i\xfepN\xf6!,\xd0*\xf3\x13UNd\xdc\x86+\x02\x8a;8\x87\x1f\x04\xc4\x90\x08\xbf\x855\x1e\x01s\xb8h\xa7\x84\xda\xc5\x1c\x145\xe5]\r\xe0+\xe2\xdf$\x0b,\xcfK\xa5ew\x10\r\x82\x1d\xaa\xec\x90\xa5\x7f\x07C\xc4+\x83\xd0\x9b\x0f\xfe\xb1:\x07\x08*\xbb\xa0{R\x17\x01\xee\x8c\xe3W\xf4^\xe2X\x1b(\xa7\xa0j\r\x13\xb1\x81\xcc\x15;\x9fLe\xf2:\xacy!5\x97\x08ZL\xd1\x84"\x89!H\x9buv>\x15\x10\xe3>\x0f\x85\xae\x7f\xb27>j\xb5\t\x96\x85\x02\x03\x01\x00\x01\xa3\x82\x01=0\x82\x0190\x0c\x06\x03U\x1d\x13\x01\x01\xff\x04\x020\x0000\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xaf3\xc4\xe8\x82.\x17\xc0vz\xb0\x06\x98\x89c(\x11\x8d\x9a\x1c0g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x04\xf00 \x06\x03U\x1d%\x01\x01\xff\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020=\x06\x03U\x1d\x11\x04604\x86)urn:2V43YK2:UnifiedAutomation:UaServerCpp\x82\x072V43YK20\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00\x8e]9\x16\xbb\xa0\xa99\xa4\x9e\xd9_\xc9\xbb\xad\r\xb5\xff\xf94\xdd\x8d\x97\xa3y\'I\x17\xf5\x8c\x12\x02\xe5\xfc]\xe0\xa2\x8d>)\x9a\x08+\xf1\xe1\x0ew\xa6[\x10\x91\x9a\xae!\xf6\x0f\xa3\r\x88\x96\xc9\xe6\xee\xd5:\x98S\xfb\xc8\xf4h\x9d\x81\x83\x15q\xb7aG)J\x8d\x7f\xb6\xffZY\x13\xc6mPM\xc5\xbc\xd7\xc9%\x1aqK\xf1\xc9\xe3K\xd2\xfd\x93\xec\x05\xfd\xa4\x1d\x1d\x9e\xdeR\x96\x85@\xa9\xe5H\x98\xde\xbax\x01\x81\x01\xb9\xaf2\x04J`\xad\xdcD\xc7)\xd4V\x18\xf2kU\xd8\xe6\xb4\x06*b\x97\xf5\x85\xdb&T\x8b\xbec\x97XNP\xe6ng\x93\x8c\ne\x0ej\xe6\x96%\xa37\xab\x7fz\xfc\xe6\xe1\xcc\x1c\xcb\xa4\x9eck 7\xd9N\x08\x88\xfc\x8d\x9e\xdc(z09\x885u\xb5r\x94FN\x1e\xd6/\x19?\x18!\x0b\xe0\x89\x04/\x080\xa2\xefj\x08\rp\rl\xb9\x1b\x7f\xbb\xa3\x13\x8d\x1f\n\xa7r\xd5\xe0\x8e\xc5:\x96\x05q\x870\x82\x04"0\x82\x03\n\xa0\x03\x02\x01\x02\x02\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230301105339Z\x17\r250228105339Z011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xec\xfbu\x15\x17$\xcb\xd8\xed%E\x8d\xad8\x8a\xc8\x87\xb0F(\x93\x12\xa4WXPsZ\xd0E\xfd\x8c\x0c\xd5\x979\xe1\xc1[\xfe\x85*k\xf1\xfe\xc6\x91\xc5\x07\xf6\xeep6p.\xb64z\xd5\x1c\xa6\xc6\x8bx\xee\x03\x7f\x94\xe6#c2\x16l\x06\x17F\xc1\xca:\x10\xecdL\x85.\xc8\x8a\x00v\xe6\x16\x19\xe9:\xa0\x0c\xfd\x86^\x83*B\xca)\xd1\x8b\xa7\xb9\xe2\x18$\xe62\x96\xc4#\x87\xdc\xc9\\k\x0f)0\xd7\xc6\x9aT5\x11\x89\xdet\x10^\xd3\x9a\xefB\x8ff,\xfeZI8~\xd7\xa5;\x1d\xe3\xab7\xbd\xf2\x9c{0\xb7:\xd9qf\xe7\xc3p\xb9\x97o9\xe0\xe2\xa5\x9b\xdb 3\x08\x90\xfc\xfeI\x97\x7f\x9c\xad\n\xc4\x9d\x9e\xfe\x04\xad\rK\xfbD\xcc\x81\xaf\x9f\xd2s\xc8R|ZN\xc78X\x04o\xea\xd3-\xa4\xa5\xf7*\xb1\xe6+\x89\x9d\xcb\xb9W\xa0{\xef\xe5\x08\xf4\x16)8\xfa\x14\xf3f4@t\xa99\x9dVdI3G\xfe\xf3\x02\x03\x01\x00\x01\xa3\x82\x0150\x82\x0110\x0f\x06\x03U\x1d\x13\x01\x01\xff\x04\x050\x03\x01\x01\xff00\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x8310g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\xe60T\x06\x03U\x1d\x11\x04M0K\x865urn:UnifiedAutomation:UaGds:Server:2V43YK2.ra-int.com\x82\x122V43YK2.ra-int.com0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00L\xe5%WBr\x1914\xd0%\xb2\x8a\x80\xbd\xccLR\x9f|\xd3\xabS!~\x83\xe0\xc23\x1e\xdc\xc8Yb\xce\xc9@\x83\x9a\x84s\x08u\xfa"K\xe1\x92\xbd\xd2\xf3\xdb\x7f8\xa1\xee\xfak9\x1e\xe4\xf8\x183nr5/\xe5\xca\x11\x11vbN\n\x7f\xc3\x04\x83i\xa9P\x9d\x83R\xe9o\xbc\xce\x8a\x945\xaf\x8c\xfa\x0b\xd8*&\n\xe7\xb7b\xdeV\xfa\xf7\xd3\xbb\x82\x03\xcd\x00\xa6t\x92\xef\xd1V\x93\xd60\xff\xee\x84\x81Mb\xdbG:\xfcCW\x05\xc2T_\x1d\xa1y\\\xfa\x87\xb8\xad\xf9EYJ\xd5X\x0ehE\xdf\x99\xabI\x01\x91\x83"C\xb1~Hc\x06P\x9dsQ\xed\xf39"\xa6\x14O\x07:\xe6<n\xf9fZ\xd9\xe4eX5\x03\x10\x99\xc8\xfcA\x94\x16r\xff\xf1\x90"[\xb0\xd3\xc5\xfbo\x9cI*\x0b:/\xde\x05.\xb1\xa7\x81\xd5\xa1\xb6(9s\xa0\x95\x01\xb0\x02\xadD\x05*\xa1\xfa"\r\x05I\x9b\xd3i6\xc8\x97\x91\x0b="', SecurityMode=<MessageSecurityMode.SignAndEncrypt: 3>, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256', UserIdentityTokens=[UserTokenPolicy(PolicyId='Anonymous-[0]-SignAndEncrypt-Basic256Sha256', TokenType=<UserTokenType.Anonymous: 0>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri=None), UserTokenPolicy(PolicyId='UserName-[0]-SignAndEncrypt-Basic256Sha256', TokenType=<UserTokenType.UserName: 1>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256'), UserTokenPolicy(PolicyId='Certificate-[0]-SignAndEncrypt-Basic256Sha256', TokenType=<UserTokenType.Certificate: 2>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256')], TransportProfileUri='http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary', SecurityLevel=115), EndpointDescription(EndpointUrl='opc.tcp://2V43YK2:48010', Server=ApplicationDescription(ApplicationUri='urn:2V43YK2:UnifiedAutomation:UaServerCpp', ProductUri='urn:UnifiedAutomation:UaServerCpp', ApplicationName=LocalizedText(Locale='en', Text='UaServerCpp@2V43YK2'), ApplicationType_=<ApplicationType.Server: 0>, GatewayServerUri=None, DiscoveryProfileUri=None, DiscoveryUrls=['opc.tcp://2V43YK2:48010']), ServerCertificate=b'0\x82\x04{0\x82\x03c\xa0\x03\x02\x01\x02\x02\x0f\x145\x87\x83pBq6C\x10\x00\x00\x00\x00\t0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230314075636Z\x17\r240320075636Z0\x81\x811\x170\x15\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x072V43YK21\x0b0\t\x06\x03U\x04\x06\x13\x02DE1\x150\x13\x06\x03U\x04\x07\x0c\x0cLocationName1\x150\x13\x06\x03U\x04\n\x0c\x0cOrganization1\r0\x0b\x06\x03U\x04\x0b\x0c\x04Unit1\x1c0\x1a\x06\x03U\x04\x03\x0c\x13UaServerCpp@2V43YK20\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xd3\x84\xeap\xbf.\x1c\xc3\xb7\xe2\xf8q\xae\xa1Z\x1b\\9\xfa\xf2\xb9D\x91C\xd6\xb3\xc3\xf7\x95d\x1a\xbanz\xd1}T\x07\xf7U\xa2T@\x94~^\x06\r\x87\xee\xc5\xeb\x0c[KE\xa2\xc3\xde\xe8\x17\r-xT\x98N\x98\xf2\x1c\xaf\xce~n\xdc7#\xb1gTU\xc0m\x80\xb1\xed\xf0\x92?F\x9fS4v\x88\xcf3G\x05xwI6\xeb\x03\x0c\x9b\xda\xb4\xd5\xf5i\xfepN\xf6!,\xd0*\xf3\x13UNd\xdc\x86+\x02\x8a;8\x87\x1f\x04\xc4\x90\x08\xbf\x855\x1e\x01s\xb8h\xa7\x84\xda\xc5\x1c\x145\xe5]\r\xe0+\xe2\xdf$\x0b,\xcfK\xa5ew\x10\r\x82\x1d\xaa\xec\x90\xa5\x7f\x07C\xc4+\x83\xd0\x9b\x0f\xfe\xb1:\x07\x08*\xbb\xa0{R\x17\x01\xee\x8c\xe3W\xf4^\xe2X\x1b(\xa7\xa0j\r\x13\xb1\x81\xcc\x15;\x9fLe\xf2:\xacy!5\x97\x08ZL\xd1\x84"\x89!H\x9buv>\x15\x10\xe3>\x0f\x85\xae\x7f\xb27>j\xb5\t\x96\x85\x02\x03\x01\x00\x01\xa3\x82\x01=0\x82\x0190\x0c\x06\x03U\x1d\x13\x01\x01\xff\x04\x020\x0000\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xaf3\xc4\xe8\x82.\x17\xc0vz\xb0\x06\x98\x89c(\x11\x8d\x9a\x1c0g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x04\xf00 \x06\x03U\x1d%\x01\x01\xff\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020=\x06\x03U\x1d\x11\x04604\x86)urn:2V43YK2:UnifiedAutomation:UaServerCpp\x82\x072V43YK20\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00\x8e]9\x16\xbb\xa0\xa99\xa4\x9e\xd9_\xc9\xbb\xad\r\xb5\xff\xf94\xdd\x8d\x97\xa3y\'I\x17\xf5\x8c\x12\x02\xe5\xfc]\xe0\xa2\x8d>)\x9a\x08+\xf1\xe1\x0ew\xa6[\x10\x91\x9a\xae!\xf6\x0f\xa3\r\x88\x96\xc9\xe6\xee\xd5:\x98S\xfb\xc8\xf4h\x9d\x81\x83\x15q\xb7aG)J\x8d\x7f\xb6\xffZY\x13\xc6mPM\xc5\xbc\xd7\xc9%\x1aqK\xf1\xc9\xe3K\xd2\xfd\x93\xec\x05\xfd\xa4\x1d\x1d\x9e\xdeR\x96\x85@\xa9\xe5H\x98\xde\xbax\x01\x81\x01\xb9\xaf2\x04J`\xad\xdcD\xc7)\xd4V\x18\xf2kU\xd8\xe6\xb4\x06*b\x97\xf5\x85\xdb&T\x8b\xbec\x97XNP\xe6ng\x93\x8c\ne\x0ej\xe6\x96%\xa37\xab\x7fz\xfc\xe6\xe1\xcc\x1c\xcb\xa4\x9eck 7\xd9N\x08\x88\xfc\x8d\x9e\xdc(z09\x885u\xb5r\x94FN\x1e\xd6/\x19?\x18!\x0b\xe0\x89\x04/\x080\xa2\xefj\x08\rp\rl\xb9\x1b\x7f\xbb\xa3\x13\x8d\x1f\n\xa7r\xd5\xe0\x8e\xc5:\x96\x05q\x870\x82\x04"0\x82\x03\n\xa0\x03\x02\x01\x02\x02\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230301105339Z\x17\r250228105339Z011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xec\xfbu\x15\x17$\xcb\xd8\xed%E\x8d\xad8\x8a\xc8\x87\xb0F(\x93\x12\xa4WXPsZ\xd0E\xfd\x8c\x0c\xd5\x979\xe1\xc1[\xfe\x85*k\xf1\xfe\xc6\x91\xc5\x07\xf6\xeep6p.\xb64z\xd5\x1c\xa6\xc6\x8bx\xee\x03\x7f\x94\xe6#c2\x16l\x06\x17F\xc1\xca:\x10\xecdL\x85.\xc8\x8a\x00v\xe6\x16\x19\xe9:\xa0\x0c\xfd\x86^\x83*B\xca)\xd1\x8b\xa7\xb9\xe2\x18$\xe62\x96\xc4#\x87\xdc\xc9\\k\x0f)0\xd7\xc6\x9aT5\x11\x89\xdet\x10^\xd3\x9a\xefB\x8ff,\xfeZI8~\xd7\xa5;\x1d\xe3\xab7\xbd\xf2\x9c{0\xb7:\xd9qf\xe7\xc3p\xb9\x97o9\xe0\xe2\xa5\x9b\xdb 3\x08\x90\xfc\xfeI\x97\x7f\x9c\xad\n\xc4\x9d\x9e\xfe\x04\xad\rK\xfbD\xcc\x81\xaf\x9f\xd2s\xc8R|ZN\xc78X\x04o\xea\xd3-\xa4\xa5\xf7*\xb1\xe6+\x89\x9d\xcb\xb9W\xa0{\xef\xe5\x08\xf4\x16)8\xfa\x14\xf3f4@t\xa99\x9dVdI3G\xfe\xf3\x02\x03\x01\x00\x01\xa3\x82\x0150\x82\x0110\x0f\x06\x03U\x1d\x13\x01\x01\xff\x04\x050\x03\x01\x01\xff00\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x8310g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\xe60T\x06\x03U\x1d\x11\x04M0K\x865urn:UnifiedAutomation:UaGds:Server:2V43YK2.ra-int.com\x82\x122V43YK2.ra-int.com0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00L\xe5%WBr\x1914\xd0%\xb2\x8a\x80\xbd\xccLR\x9f|\xd3\xabS!~\x83\xe0\xc23\x1e\xdc\xc8Yb\xce\xc9@\x83\x9a\x84s\x08u\xfa"K\xe1\x92\xbd\xd2\xf3\xdb\x7f8\xa1\xee\xfak9\x1e\xe4\xf8\x183nr5/\xe5\xca\x11\x11vbN\n\x7f\xc3\x04\x83i\xa9P\x9d\x83R\xe9o\xbc\xce\x8a\x945\xaf\x8c\xfa\x0b\xd8*&\n\xe7\xb7b\xdeV\xfa\xf7\xd3\xbb\x82\x03\xcd\x00\xa6t\x92\xef\xd1V\x93\xd60\xff\xee\x84\x81Mb\xdbG:\xfcCW\x05\xc2T_\x1d\xa1y\\\xfa\x87\xb8\xad\xf9EYJ\xd5X\x0ehE\xdf\x99\xabI\x01\x91\x83"C\xb1~Hc\x06P\x9dsQ\xed\xf39"\xa6\x14O\x07:\xe6<n\xf9fZ\xd9\xe4eX5\x03\x10\x99\xc8\xfcA\x94\x16r\xff\xf1\x90"[\xb0\xd3\xc5\xfbo\x9cI*\x0b:/\xde\x05.\xb1\xa7\x81\xd5\xa1\xb6(9s\xa0\x95\x01\xb0\x02\xadD\x05*\xa1\xfa"\r\x05I\x9b\xd3i6\xc8\x97\x91\x0b="', SecurityMode=<MessageSecurityMode.Sign: 2>, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep', UserIdentityTokens=[UserTokenPolicy(PolicyId='Anonymous-[0]-Sign-Aes128_Sha256_RsaOaep', TokenType=<UserTokenType.Anonymous: 0>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri=None), UserTokenPolicy(PolicyId='UserName-[0]-Sign-Aes128_Sha256_RsaOaep', TokenType=<UserTokenType.UserName: 1>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep'), UserTokenPolicy(PolicyId='Certificate-[0]-Sign-Aes128_Sha256_RsaOaep', TokenType=<UserTokenType.Certificate: 2>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep')], TransportProfileUri='http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary', SecurityLevel=70), EndpointDescription(EndpointUrl='opc.tcp://2V43YK2:48010', Server=ApplicationDescription(ApplicationUri='urn:2V43YK2:UnifiedAutomation:UaServerCpp', ProductUri='urn:UnifiedAutomation:UaServerCpp', ApplicationName=LocalizedText(Locale='en', Text='UaServerCpp@2V43YK2'), ApplicationType_=<ApplicationType.Server: 0>, GatewayServerUri=None, DiscoveryProfileUri=None, DiscoveryUrls=['opc.tcp://2V43YK2:48010']), ServerCertificate=b'0\x82\x04{0\x82\x03c\xa0\x03\x02\x01\x02\x02\x0f\x145\x87\x83pBq6C\x10\x00\x00\x00\x00\t0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230314075636Z\x17\r240320075636Z0\x81\x811\x170\x15\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x072V43YK21\x0b0\t\x06\x03U\x04\x06\x13\x02DE1\x150\x13\x06\x03U\x04\x07\x0c\x0cLocationName1\x150\x13\x06\x03U\x04\n\x0c\x0cOrganization1\r0\x0b\x06\x03U\x04\x0b\x0c\x04Unit1\x1c0\x1a\x06\x03U\x04\x03\x0c\x13UaServerCpp@2V43YK20\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xd3\x84\xeap\xbf.\x1c\xc3\xb7\xe2\xf8q\xae\xa1Z\x1b\\9\xfa\xf2\xb9D\x91C\xd6\xb3\xc3\xf7\x95d\x1a\xbanz\xd1}T\x07\xf7U\xa2T@\x94~^\x06\r\x87\xee\xc5\xeb\x0c[KE\xa2\xc3\xde\xe8\x17\r-xT\x98N\x98\xf2\x1c\xaf\xce~n\xdc7#\xb1gTU\xc0m\x80\xb1\xed\xf0\x92?F\x9fS4v\x88\xcf3G\x05xwI6\xeb\x03\x0c\x9b\xda\xb4\xd5\xf5i\xfepN\xf6!,\xd0*\xf3\x13UNd\xdc\x86+\x02\x8a;8\x87\x1f\x04\xc4\x90\x08\xbf\x855\x1e\x01s\xb8h\xa7\x84\xda\xc5\x1c\x145\xe5]\r\xe0+\xe2\xdf$\x0b,\xcfK\xa5ew\x10\r\x82\x1d\xaa\xec\x90\xa5\x7f\x07C\xc4+\x83\xd0\x9b\x0f\xfe\xb1:\x07\x08*\xbb\xa0{R\x17\x01\xee\x8c\xe3W\xf4^\xe2X\x1b(\xa7\xa0j\r\x13\xb1\x81\xcc\x15;\x9fLe\xf2:\xacy!5\x97\x08ZL\xd1\x84"\x89!H\x9buv>\x15\x10\xe3>\x0f\x85\xae\x7f\xb27>j\xb5\t\x96\x85\x02\x03\x01\x00\x01\xa3\x82\x01=0\x82\x0190\x0c\x06\x03U\x1d\x13\x01\x01\xff\x04\x020\x0000\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xaf3\xc4\xe8\x82.\x17\xc0vz\xb0\x06\x98\x89c(\x11\x8d\x9a\x1c0g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x04\xf00 \x06\x03U\x1d%\x01\x01\xff\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020=\x06\x03U\x1d\x11\x04604\x86)urn:2V43YK2:UnifiedAutomation:UaServerCpp\x82\x072V43YK20\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00\x8e]9\x16\xbb\xa0\xa99\xa4\x9e\xd9_\xc9\xbb\xad\r\xb5\xff\xf94\xdd\x8d\x97\xa3y\'I\x17\xf5\x8c\x12\x02\xe5\xfc]\xe0\xa2\x8d>)\x9a\x08+\xf1\xe1\x0ew\xa6[\x10\x91\x9a\xae!\xf6\x0f\xa3\r\x88\x96\xc9\xe6\xee\xd5:\x98S\xfb\xc8\xf4h\x9d\x81\x83\x15q\xb7aG)J\x8d\x7f\xb6\xffZY\x13\xc6mPM\xc5\xbc\xd7\xc9%\x1aqK\xf1\xc9\xe3K\xd2\xfd\x93\xec\x05\xfd\xa4\x1d\x1d\x9e\xdeR\x96\x85@\xa9\xe5H\x98\xde\xbax\x01\x81\x01\xb9\xaf2\x04J`\xad\xdcD\xc7)\xd4V\x18\xf2kU\xd8\xe6\xb4\x06*b\x97\xf5\x85\xdb&T\x8b\xbec\x97XNP\xe6ng\x93\x8c\ne\x0ej\xe6\x96%\xa37\xab\x7fz\xfc\xe6\xe1\xcc\x1c\xcb\xa4\x9eck 7\xd9N\x08\x88\xfc\x8d\x9e\xdc(z09\x885u\xb5r\x94FN\x1e\xd6/\x19?\x18!\x0b\xe0\x89\x04/\x080\xa2\xefj\x08\rp\rl\xb9\x1b\x7f\xbb\xa3\x13\x8d\x1f\n\xa7r\xd5\xe0\x8e\xc5:\x96\x05q\x870\x82\x04"0\x82\x03\n\xa0\x03\x02\x01\x02\x02\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230301105339Z\x17\r250228105339Z011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xec\xfbu\x15\x17$\xcb\xd8\xed%E\x8d\xad8\x8a\xc8\x87\xb0F(\x93\x12\xa4WXPsZ\xd0E\xfd\x8c\x0c\xd5\x979\xe1\xc1[\xfe\x85*k\xf1\xfe\xc6\x91\xc5\x07\xf6\xeep6p.\xb64z\xd5\x1c\xa6\xc6\x8bx\xee\x03\x7f\x94\xe6#c2\x16l\x06\x17F\xc1\xca:\x10\xecdL\x85.\xc8\x8a\x00v\xe6\x16\x19\xe9:\xa0\x0c\xfd\x86^\x83*B\xca)\xd1\x8b\xa7\xb9\xe2\x18$\xe62\x96\xc4#\x87\xdc\xc9\\k\x0f)0\xd7\xc6\x9aT5\x11\x89\xdet\x10^\xd3\x9a\xefB\x8ff,\xfeZI8~\xd7\xa5;\x1d\xe3\xab7\xbd\xf2\x9c{0\xb7:\xd9qf\xe7\xc3p\xb9\x97o9\xe0\xe2\xa5\x9b\xdb 3\x08\x90\xfc\xfeI\x97\x7f\x9c\xad\n\xc4\x9d\x9e\xfe\x04\xad\rK\xfbD\xcc\x81\xaf\x9f\xd2s\xc8R|ZN\xc78X\x04o\xea\xd3-\xa4\xa5\xf7*\xb1\xe6+\x89\x9d\xcb\xb9W\xa0{\xef\xe5\x08\xf4\x16)8\xfa\x14\xf3f4@t\xa99\x9dVdI3G\xfe\xf3\x02\x03\x01\x00\x01\xa3\x82\x0150\x82\x0110\x0f\x06\x03U\x1d\x13\x01\x01\xff\x04\x050\x03\x01\x01\xff00\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x8310g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\xe60T\x06\x03U\x1d\x11\x04M0K\x865urn:UnifiedAutomation:UaGds:Server:2V43YK2.ra-int.com\x82\x122V43YK2.ra-int.com0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00L\xe5%WBr\x1914\xd0%\xb2\x8a\x80\xbd\xccLR\x9f|\xd3\xabS!~\x83\xe0\xc23\x1e\xdc\xc8Yb\xce\xc9@\x83\x9a\x84s\x08u\xfa"K\xe1\x92\xbd\xd2\xf3\xdb\x7f8\xa1\xee\xfak9\x1e\xe4\xf8\x183nr5/\xe5\xca\x11\x11vbN\n\x7f\xc3\x04\x83i\xa9P\x9d\x83R\xe9o\xbc\xce\x8a\x945\xaf\x8c\xfa\x0b\xd8*&\n\xe7\xb7b\xdeV\xfa\xf7\xd3\xbb\x82\x03\xcd\x00\xa6t\x92\xef\xd1V\x93\xd60\xff\xee\x84\x81Mb\xdbG:\xfcCW\x05\xc2T_\x1d\xa1y\\\xfa\x87\xb8\xad\xf9EYJ\xd5X\x0ehE\xdf\x99\xabI\x01\x91\x83"C\xb1~Hc\x06P\x9dsQ\xed\xf39"\xa6\x14O\x07:\xe6<n\xf9fZ\xd9\xe4eX5\x03\x10\x99\xc8\xfcA\x94\x16r\xff\xf1\x90"[\xb0\xd3\xc5\xfbo\x9cI*\x0b:/\xde\x05.\xb1\xa7\x81\xd5\xa1\xb6(9s\xa0\x95\x01\xb0\x02\xadD\x05*\xa1\xfa"\r\x05I\x9b\xd3i6\xc8\x97\x91\x0b="', SecurityMode=<MessageSecurityMode.SignAndEncrypt: 3>, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep', UserIdentityTokens=[UserTokenPolicy(PolicyId='Anonymous-[0]-SignAndEncrypt-Aes128_Sha256_RsaOaep', TokenType=<UserTokenType.Anonymous: 0>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri=None), UserTokenPolicy(PolicyId='UserName-[0]-SignAndEncrypt-Aes128_Sha256_RsaOaep', TokenType=<UserTokenType.UserName: 1>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep'), UserTokenPolicy(PolicyId='Certificate-[0]-SignAndEncrypt-Aes128_Sha256_RsaOaep', TokenType=<UserTokenType.Certificate: 2>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep')], TransportProfileUri='http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary', SecurityLevel=120), EndpointDescription(EndpointUrl='opc.tcp://2V43YK2:48010', Server=ApplicationDescription(ApplicationUri='urn:2V43YK2:UnifiedAutomation:UaServerCpp', ProductUri='urn:UnifiedAutomation:UaServerCpp', ApplicationName=LocalizedText(Locale='en', Text='UaServerCpp@2V43YK2'), ApplicationType_=<ApplicationType.Server: 0>, GatewayServerUri=None, DiscoveryProfileUri=None, DiscoveryUrls=['opc.tcp://2V43YK2:48010']), ServerCertificate=b'0\x82\x04{0\x82\x03c\xa0\x03\x02\x01\x02\x02\x0f\x145\x87\x83pBq6C\x10\x00\x00\x00\x00\t0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230314075636Z\x17\r240320075636Z0\x81\x811\x170\x15\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x072V43YK21\x0b0\t\x06\x03U\x04\x06\x13\x02DE1\x150\x13\x06\x03U\x04\x07\x0c\x0cLocationName1\x150\x13\x06\x03U\x04\n\x0c\x0cOrganization1\r0\x0b\x06\x03U\x04\x0b\x0c\x04Unit1\x1c0\x1a\x06\x03U\x04\x03\x0c\x13UaServerCpp@2V43YK20\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xd3\x84\xeap\xbf.\x1c\xc3\xb7\xe2\xf8q\xae\xa1Z\x1b\\9\xfa\xf2\xb9D\x91C\xd6\xb3\xc3\xf7\x95d\x1a\xbanz\xd1}T\x07\xf7U\xa2T@\x94~^\x06\r\x87\xee\xc5\xeb\x0c[KE\xa2\xc3\xde\xe8\x17\r-xT\x98N\x98\xf2\x1c\xaf\xce~n\xdc7#\xb1gTU\xc0m\x80\xb1\xed\xf0\x92?F\x9fS4v\x88\xcf3G\x05xwI6\xeb\x03\x0c\x9b\xda\xb4\xd5\xf5i\xfepN\xf6!,\xd0*\xf3\x13UNd\xdc\x86+\x02\x8a;8\x87\x1f\x04\xc4\x90\x08\xbf\x855\x1e\x01s\xb8h\xa7\x84\xda\xc5\x1c\x145\xe5]\r\xe0+\xe2\xdf$\x0b,\xcfK\xa5ew\x10\r\x82\x1d\xaa\xec\x90\xa5\x7f\x07C\xc4+\x83\xd0\x9b\x0f\xfe\xb1:\x07\x08*\xbb\xa0{R\x17\x01\xee\x8c\xe3W\xf4^\xe2X\x1b(\xa7\xa0j\r\x13\xb1\x81\xcc\x15;\x9fLe\xf2:\xacy!5\x97\x08ZL\xd1\x84"\x89!H\x9buv>\x15\x10\xe3>\x0f\x85\xae\x7f\xb27>j\xb5\t\x96\x85\x02\x03\x01\x00\x01\xa3\x82\x01=0\x82\x0190\x0c\x06\x03U\x1d\x13\x01\x01\xff\x04\x020\x0000\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xaf3\xc4\xe8\x82.\x17\xc0vz\xb0\x06\x98\x89c(\x11\x8d\x9a\x1c0g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x04\xf00 \x06\x03U\x1d%\x01\x01\xff\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020=\x06\x03U\x1d\x11\x04604\x86)urn:2V43YK2:UnifiedAutomation:UaServerCpp\x82\x072V43YK20\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00\x8e]9\x16\xbb\xa0\xa99\xa4\x9e\xd9_\xc9\xbb\xad\r\xb5\xff\xf94\xdd\x8d\x97\xa3y\'I\x17\xf5\x8c\x12\x02\xe5\xfc]\xe0\xa2\x8d>)\x9a\x08+\xf1\xe1\x0ew\xa6[\x10\x91\x9a\xae!\xf6\x0f\xa3\r\x88\x96\xc9\xe6\xee\xd5:\x98S\xfb\xc8\xf4h\x9d\x81\x83\x15q\xb7aG)J\x8d\x7f\xb6\xffZY\x13\xc6mPM\xc5\xbc\xd7\xc9%\x1aqK\xf1\xc9\xe3K\xd2\xfd\x93\xec\x05\xfd\xa4\x1d\x1d\x9e\xdeR\x96\x85@\xa9\xe5H\x98\xde\xbax\x01\x81\x01\xb9\xaf2\x04J`\xad\xdcD\xc7)\xd4V\x18\xf2kU\xd8\xe6\xb4\x06*b\x97\xf5\x85\xdb&T\x8b\xbec\x97XNP\xe6ng\x93\x8c\ne\x0ej\xe6\x96%\xa37\xab\x7fz\xfc\xe6\xe1\xcc\x1c\xcb\xa4\x9eck 7\xd9N\x08\x88\xfc\x8d\x9e\xdc(z09\x885u\xb5r\x94FN\x1e\xd6/\x19?\x18!\x0b\xe0\x89\x04/\x080\xa2\xefj\x08\rp\rl\xb9\x1b\x7f\xbb\xa3\x13\x8d\x1f\n\xa7r\xd5\xe0\x8e\xc5:\x96\x05q\x870\x82\x04"0\x82\x03\n\xa0\x03\x02\x01\x02\x02\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230301105339Z\x17\r250228105339Z011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xec\xfbu\x15\x17$\xcb\xd8\xed%E\x8d\xad8\x8a\xc8\x87\xb0F(\x93\x12\xa4WXPsZ\xd0E\xfd\x8c\x0c\xd5\x979\xe1\xc1[\xfe\x85*k\xf1\xfe\xc6\x91\xc5\x07\xf6\xeep6p.\xb64z\xd5\x1c\xa6\xc6\x8bx\xee\x03\x7f\x94\xe6#c2\x16l\x06\x17F\xc1\xca:\x10\xecdL\x85.\xc8\x8a\x00v\xe6\x16\x19\xe9:\xa0\x0c\xfd\x86^\x83*B\xca)\xd1\x8b\xa7\xb9\xe2\x18$\xe62\x96\xc4#\x87\xdc\xc9\\k\x0f)0\xd7\xc6\x9aT5\x11\x89\xdet\x10^\xd3\x9a\xefB\x8ff,\xfeZI8~\xd7\xa5;\x1d\xe3\xab7\xbd\xf2\x9c{0\xb7:\xd9qf\xe7\xc3p\xb9\x97o9\xe0\xe2\xa5\x9b\xdb 3\x08\x90\xfc\xfeI\x97\x7f\x9c\xad\n\xc4\x9d\x9e\xfe\x04\xad\rK\xfbD\xcc\x81\xaf\x9f\xd2s\xc8R|ZN\xc78X\x04o\xea\xd3-\xa4\xa5\xf7*\xb1\xe6+\x89\x9d\xcb\xb9W\xa0{\xef\xe5\x08\xf4\x16)8\xfa\x14\xf3f4@t\xa99\x9dVdI3G\xfe\xf3\x02\x03\x01\x00\x01\xa3\x82\x0150\x82\x0110\x0f\x06\x03U\x1d\x13\x01\x01\xff\x04\x050\x03\x01\x01\xff00\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x8310g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\xe60T\x06\x03U\x1d\x11\x04M0K\x865urn:UnifiedAutomation:UaGds:Server:2V43YK2.ra-int.com\x82\x122V43YK2.ra-int.com0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00L\xe5%WBr\x1914\xd0%\xb2\x8a\x80\xbd\xccLR\x9f|\xd3\xabS!~\x83\xe0\xc23\x1e\xdc\xc8Yb\xce\xc9@\x83\x9a\x84s\x08u\xfa"K\xe1\x92\xbd\xd2\xf3\xdb\x7f8\xa1\xee\xfak9\x1e\xe4\xf8\x183nr5/\xe5\xca\x11\x11vbN\n\x7f\xc3\x04\x83i\xa9P\x9d\x83R\xe9o\xbc\xce\x8a\x945\xaf\x8c\xfa\x0b\xd8*&\n\xe7\xb7b\xdeV\xfa\xf7\xd3\xbb\x82\x03\xcd\x00\xa6t\x92\xef\xd1V\x93\xd60\xff\xee\x84\x81Mb\xdbG:\xfcCW\x05\xc2T_\x1d\xa1y\\\xfa\x87\xb8\xad\xf9EYJ\xd5X\x0ehE\xdf\x99\xabI\x01\x91\x83"C\xb1~Hc\x06P\x9dsQ\xed\xf39"\xa6\x14O\x07:\xe6<n\xf9fZ\xd9\xe4eX5\x03\x10\x99\xc8\xfcA\x94\x16r\xff\xf1\x90"[\xb0\xd3\xc5\xfbo\x9cI*\x0b:/\xde\x05.\xb1\xa7\x81\xd5\xa1\xb6(9s\xa0\x95\x01\xb0\x02\xadD\x05*\xa1\xfa"\r\x05I\x9b\xd3i6\xc8\x97\x91\x0b="', SecurityMode=<MessageSecurityMode.Sign: 2>, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss', UserIdentityTokens=[UserTokenPolicy(PolicyId='Anonymous-[0]-Sign-Aes256_Sha256_RsaPss', TokenType=<UserTokenType.Anonymous: 0>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri=None), UserTokenPolicy(PolicyId='UserName-[0]-Sign-Aes256_Sha256_RsaPss', TokenType=<UserTokenType.UserName: 1>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss'), UserTokenPolicy(PolicyId='Certificate-[0]-Sign-Aes256_Sha256_RsaPss', TokenType=<UserTokenType.Certificate: 2>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss')], TransportProfileUri='http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary', SecurityLevel=75), EndpointDescription(EndpointUrl='opc.tcp://2V43YK2:48010', Server=ApplicationDescription(ApplicationUri='urn:2V43YK2:UnifiedAutomation:UaServerCpp', ProductUri='urn:UnifiedAutomation:UaServerCpp', ApplicationName=LocalizedText(Locale='en', Text='UaServerCpp@2V43YK2'), ApplicationType_=<ApplicationType.Server: 0>, GatewayServerUri=None, DiscoveryProfileUri=None, DiscoveryUrls=['opc.tcp://2V43YK2:48010']), ServerCertificate=b'0\x82\x04{0\x82\x03c\xa0\x03\x02\x01\x02\x02\x0f\x145\x87\x83pBq6C\x10\x00\x00\x00\x00\t0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230314075636Z\x17\r240320075636Z0\x81\x811\x170\x15\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x072V43YK21\x0b0\t\x06\x03U\x04\x06\x13\x02DE1\x150\x13\x06\x03U\x04\x07\x0c\x0cLocationName1\x150\x13\x06\x03U\x04\n\x0c\x0cOrganization1\r0\x0b\x06\x03U\x04\x0b\x0c\x04Unit1\x1c0\x1a\x06\x03U\x04\x03\x0c\x13UaServerCpp@2V43YK20\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xd3\x84\xeap\xbf.\x1c\xc3\xb7\xe2\xf8q\xae\xa1Z\x1b\\9\xfa\xf2\xb9D\x91C\xd6\xb3\xc3\xf7\x95d\x1a\xbanz\xd1}T\x07\xf7U\xa2T@\x94~^\x06\r\x87\xee\xc5\xeb\x0c[KE\xa2\xc3\xde\xe8\x17\r-xT\x98N\x98\xf2\x1c\xaf\xce~n\xdc7#\xb1gTU\xc0m\x80\xb1\xed\xf0\x92?F\x9fS4v\x88\xcf3G\x05xwI6\xeb\x03\x0c\x9b\xda\xb4\xd5\xf5i\xfepN\xf6!,\xd0*\xf3\x13UNd\xdc\x86+\x02\x8a;8\x87\x1f\x04\xc4\x90\x08\xbf\x855\x1e\x01s\xb8h\xa7\x84\xda\xc5\x1c\x145\xe5]\r\xe0+\xe2\xdf$\x0b,\xcfK\xa5ew\x10\r\x82\x1d\xaa\xec\x90\xa5\x7f\x07C\xc4+\x83\xd0\x9b\x0f\xfe\xb1:\x07\x08*\xbb\xa0{R\x17\x01\xee\x8c\xe3W\xf4^\xe2X\x1b(\xa7\xa0j\r\x13\xb1\x81\xcc\x15;\x9fLe\xf2:\xacy!5\x97\x08ZL\xd1\x84"\x89!H\x9buv>\x15\x10\xe3>\x0f\x85\xae\x7f\xb27>j\xb5\t\x96\x85\x02\x03\x01\x00\x01\xa3\x82\x01=0\x82\x0190\x0c\x06\x03U\x1d\x13\x01\x01\xff\x04\x020\x0000\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xaf3\xc4\xe8\x82.\x17\xc0vz\xb0\x06\x98\x89c(\x11\x8d\x9a\x1c0g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x04\xf00 \x06\x03U\x1d%\x01\x01\xff\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020=\x06\x03U\x1d\x11\x04604\x86)urn:2V43YK2:UnifiedAutomation:UaServerCpp\x82\x072V43YK20\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00\x8e]9\x16\xbb\xa0\xa99\xa4\x9e\xd9_\xc9\xbb\xad\r\xb5\xff\xf94\xdd\x8d\x97\xa3y\'I\x17\xf5\x8c\x12\x02\xe5\xfc]\xe0\xa2\x8d>)\x9a\x08+\xf1\xe1\x0ew\xa6[\x10\x91\x9a\xae!\xf6\x0f\xa3\r\x88\x96\xc9\xe6\xee\xd5:\x98S\xfb\xc8\xf4h\x9d\x81\x83\x15q\xb7aG)J\x8d\x7f\xb6\xffZY\x13\xc6mPM\xc5\xbc\xd7\xc9%\x1aqK\xf1\xc9\xe3K\xd2\xfd\x93\xec\x05\xfd\xa4\x1d\x1d\x9e\xdeR\x96\x85@\xa9\xe5H\x98\xde\xbax\x01\x81\x01\xb9\xaf2\x04J`\xad\xdcD\xc7)\xd4V\x18\xf2kU\xd8\xe6\xb4\x06*b\x97\xf5\x85\xdb&T\x8b\xbec\x97XNP\xe6ng\x93\x8c\ne\x0ej\xe6\x96%\xa37\xab\x7fz\xfc\xe6\xe1\xcc\x1c\xcb\xa4\x9eck 7\xd9N\x08\x88\xfc\x8d\x9e\xdc(z09\x885u\xb5r\x94FN\x1e\xd6/\x19?\x18!\x0b\xe0\x89\x04/\x080\xa2\xefj\x08\rp\rl\xb9\x1b\x7f\xbb\xa3\x13\x8d\x1f\n\xa7r\xd5\xe0\x8e\xc5:\x96\x05q\x870\x82\x04"0\x82\x03\n\xa0\x03\x02\x01\x02\x02\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230301105339Z\x17\r250228105339Z011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xec\xfbu\x15\x17$\xcb\xd8\xed%E\x8d\xad8\x8a\xc8\x87\xb0F(\x93\x12\xa4WXPsZ\xd0E\xfd\x8c\x0c\xd5\x979\xe1\xc1[\xfe\x85*k\xf1\xfe\xc6\x91\xc5\x07\xf6\xeep6p.\xb64z\xd5\x1c\xa6\xc6\x8bx\xee\x03\x7f\x94\xe6#c2\x16l\x06\x17F\xc1\xca:\x10\xecdL\x85.\xc8\x8a\x00v\xe6\x16\x19\xe9:\xa0\x0c\xfd\x86^\x83*B\xca)\xd1\x8b\xa7\xb9\xe2\x18$\xe62\x96\xc4#\x87\xdc\xc9\\k\x0f)0\xd7\xc6\x9aT5\x11\x89\xdet\x10^\xd3\x9a\xefB\x8ff,\xfeZI8~\xd7\xa5;\x1d\xe3\xab7\xbd\xf2\x9c{0\xb7:\xd9qf\xe7\xc3p\xb9\x97o9\xe0\xe2\xa5\x9b\xdb 3\x08\x90\xfc\xfeI\x97\x7f\x9c\xad\n\xc4\x9d\x9e\xfe\x04\xad\rK\xfbD\xcc\x81\xaf\x9f\xd2s\xc8R|ZN\xc78X\x04o\xea\xd3-\xa4\xa5\xf7*\xb1\xe6+\x89\x9d\xcb\xb9W\xa0{\xef\xe5\x08\xf4\x16)8\xfa\x14\xf3f4@t\xa99\x9dVdI3G\xfe\xf3\x02\x03\x01\x00\x01\xa3\x82\x0150\x82\x0110\x0f\x06\x03U\x1d\x13\x01\x01\xff\x04\x050\x03\x01\x01\xff00\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x8310g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\xe60T\x06\x03U\x1d\x11\x04M0K\x865urn:UnifiedAutomation:UaGds:Server:2V43YK2.ra-int.com\x82\x122V43YK2.ra-int.com0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00L\xe5%WBr\x1914\xd0%\xb2\x8a\x80\xbd\xccLR\x9f|\xd3\xabS!~\x83\xe0\xc23\x1e\xdc\xc8Yb\xce\xc9@\x83\x9a\x84s\x08u\xfa"K\xe1\x92\xbd\xd2\xf3\xdb\x7f8\xa1\xee\xfak9\x1e\xe4\xf8\x183nr5/\xe5\xca\x11\x11vbN\n\x7f\xc3\x04\x83i\xa9P\x9d\x83R\xe9o\xbc\xce\x8a\x945\xaf\x8c\xfa\x0b\xd8*&\n\xe7\xb7b\xdeV\xfa\xf7\xd3\xbb\x82\x03\xcd\x00\xa6t\x92\xef\xd1V\x93\xd60\xff\xee\x84\x81Mb\xdbG:\xfcCW\x05\xc2T_\x1d\xa1y\\\xfa\x87\xb8\xad\xf9EYJ\xd5X\x0ehE\xdf\x99\xabI\x01\x91\x83"C\xb1~Hc\x06P\x9dsQ\xed\xf39"\xa6\x14O\x07:\xe6<n\xf9fZ\xd9\xe4eX5\x03\x10\x99\xc8\xfcA\x94\x16r\xff\xf1\x90"[\xb0\xd3\xc5\xfbo\x9cI*\x0b:/\xde\x05.\xb1\xa7\x81\xd5\xa1\xb6(9s\xa0\x95\x01\xb0\x02\xadD\x05*\xa1\xfa"\r\x05I\x9b\xd3i6\xc8\x97\x91\x0b="', SecurityMode=<MessageSecurityMode.SignAndEncrypt: 3>, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss', UserIdentityTokens=[UserTokenPolicy(PolicyId='Anonymous-[0]-SignAndEncrypt-Aes256_Sha256_RsaPss', TokenType=<UserTokenType.Anonymous: 0>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri=None), UserTokenPolicy(PolicyId='UserName-[0]-SignAndEncrypt-Aes256_Sha256_RsaPss', TokenType=<UserTokenType.UserName: 1>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss'), UserTokenPolicy(PolicyId='Certificate-[0]-SignAndEncrypt-Aes256_Sha256_RsaPss', TokenType=<UserTokenType.Certificate: 2>, IssuedTokenType=None, IssuerEndpointUrl=None, SecurityPolicyUri='http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss')], TransportProfileUri='http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary', SecurityLevel=125)] <MessageSecurityMode.SignAndEncrypt: 3> 'http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256' Traceback (most recent call last): File "C:\other\opcua-asyncio\examples\client-with-encryption.py", line 36, in <module> main() File "C:\other\opcua-asyncio\examples\client-with-encryption.py", line 31, in main loop.run_until_complete(task(loop)) File "C:\Users\PSznapk\AppData\Local\Programs\Python\Python310-32\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "C:\other\opcua-asyncio\examples\client-with-encryption.py", line 17, in task await client.set_security( File "C:\other\opcua-asyncio\examples\..\asyncua\client\client.py", line 181, in set_security server_certificate = uacrypto.x509_from_der(endpoint.ServerCertificate) File "C:\other\opcua-asyncio\examples\..\asyncua\crypto\uacrypto.py", line 46, in x509_from_der return x509.load_der_x509_certificate(data, default_backend()) File "C:\Users\PSznapk\AppData\Local\Programs\Python\Python310-32\lib\site-packages\cryptography\x509\base.py", line 562, in load_der_x509_certificate return rust_x509.load_der_x509_certificate(data) ValueError: error parsing asn1 value: ParseError { kind: ExtraData } ``` **Initial investigation results**<br /> This error is caused by the fact that the server sent a certificate chain (according to [https://reference.opcfoundation.org/Core/Part6/v105/docs/6.2.6](https://reference.opcfoundation.org/Core/Part6/v105/docs/6.2.6)) and the client code not being able to parse it. Code responsible for parsing is in `asyncua/client/client.py` in line 181 in my example the received value is as follows: ``` >>> endpoint.ServerCertificate b'0\x82\x04{0\x82\x03c\xa0\x03\x02\x01\x02\x02\x0f\x145\x87\x83pBq6C\x10\x00\x00\x00\x00\t0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230314075636Z\x17\r240320075636Z0\x81\x811\x170\x15\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x072V43YK21\x0b0\t\x06\x03U\x04\x06\x13\x02DE1\x150\x13\x06\x03U\x04\x07\x0c\x0cLocationName1\x150\x13\x06\x03U\x04\n\x0c\x0cOrganization1\r0\x0b\x06\x03U\x04\x0b\x0c\x04Unit1\x1c0\x1a\x06\x03U\x04\x03\x0c\x13UaServerCpp@2V43YK20\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xd3\x84\xeap\xbf.\x1c\xc3\xb7\xe2\xf8q\xae\xa1Z\x1b\\9\xfa\xf2\xb9D\x91C\xd6\xb3\xc3\xf7\x95d\x1a\xbanz\xd1}T\x07\xf7U\xa2T@\x94~^\x06\r\x87\xee\xc5\xeb\x0c[KE\xa2\xc3\xde\xe8\x17\r-xT\x98N\x98\xf2\x1c\xaf\xce~n\xdc7#\xb1gTU\xc0m\x80\xb1\xed\xf0\x92?F\x9fS4v\x88\xcf3G\x05xwI6\xeb\x03\x0c\x9b\xda\xb4\xd5\xf5i\xfepN\xf6!,\xd0*\xf3\x13UNd\xdc\x86+\x02\x8a;8\x87\x1f\x04\xc4\x90\x08\xbf\x855\x1e\x01s\xb8h\xa7\x84\xda\xc5\x1c\x145\xe5]\r\xe0+\xe2\xdf$\x0b,\xcfK\xa5ew\x10\r\x82\x1d\xaa\xec\x90\xa5\x7f\x07C\xc4+\x83\xd0\x9b\x0f\xfe\xb1:\x07\x08*\xbb\xa0{R\x17\x01\xee\x8c\xe3W\xf4^\xe2X\x1b(\xa7\xa0j\r\x13\xb1\x81\xcc\x15;\x9fLe\xf2:\xacy!5\x97\x08ZL\xd1\x84"\x89!H\x9buv>\x15\x10\xe3>\x0f\x85\xae\x7f\xb27>j\xb5\t\x96\x85\x02\x03\x01\x00\x01\xa3\x82\x01=0\x82\x0190\x0c\x06\x03U\x1d\x13\x01\x01\xff\x04\x020\x0000\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xaf3\xc4\xe8\x82.\x17\xc0vz\xb0\x06\x98\x89c(\x11\x8d\x9a\x1c0g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x04\xf00 \x06\x03U\x1d%\x01\x01\xff\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020=\x06\x03U\x1d\x11\x04604\x86)urn:2V43YK2:UnifiedAutomation:UaServerCpp\x82\x072V43YK20\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00\x8e]9\x16\xbb\xa0\xa99\xa4\x9e\xd9_\xc9\xbb\xad\r\xb5\xff\xf94\xdd\x8d\x97\xa3y\'I\x17\xf5\x8c\x12\x02\xe5\xfc]\xe0\xa2\x8d>)\x9a\x08+\xf1\xe1\x0ew\xa6[\x10\x91\x9a\xae!\xf6\x0f\xa3\r\x88\x96\xc9\xe6\xee\xd5:\x98S\xfb\xc8\xf4h\x9d\x81\x83\x15q\xb7aG)J\x8d\x7f\xb6\xffZY\x13\xc6mPM\xc5\xbc\xd7\xc9%\x1aqK\xf1\xc9\xe3K\xd2\xfd\x93\xec\x05\xfd\xa4\x1d\x1d\x9e\xdeR\x96\x85@\xa9\xe5H\x98\xde\xbax\x01\x81\x01\xb9\xaf2\x04J`\xad\xdcD\xc7)\xd4V\x18\xf2kU\xd8\xe6\xb4\x06*b\x97\xf5\x85\xdb&T\x8b\xbec\x97XNP\xe6ng\x93\x8c\ne\x0ej\xe6\x96%\xa37\xab\x7fz\xfc\xe6\xe1\xcc\x1c\xcb\xa4\x9eck 7\xd9N\x08\x88\xfc\x8d\x9e\xdc(z09\x885u\xb5r\x94FN\x1e\xd6/\x19?\x18!\x0b\xe0\x89\x04/\x080\xa2\xefj\x08\rp\rl\xb9\x1b\x7f\xbb\xa3\x13\x8d\x1f\n\xa7r\xd5\xe0\x8e\xc5:\x96\x05q\x870\x82\x04"0\x82\x03\n\xa0\x03\x02\x01\x02\x02\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x1e\x17\r230301105339Z\x17\r250228105339Z011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xec\xfbu\x15\x17$\xcb\xd8\xed%E\x8d\xad8\x8a\xc8\x87\xb0F(\x93\x12\xa4WXPsZ\xd0E\xfd\x8c\x0c\xd5\x979\xe1\xc1[\xfe\x85*k\xf1\xfe\xc6\x91\xc5\x07\xf6\xeep6p.\xb64z\xd5\x1c\xa6\xc6\x8bx\xee\x03\x7f\x94\xe6#c2\x16l\x06\x17F\xc1\xca:\x10\xecdL\x85.\xc8\x8a\x00v\xe6\x16\x19\xe9:\xa0\x0c\xfd\x86^\x83*B\xca)\xd1\x8b\xa7\xb9\xe2\x18$\xe62\x96\xc4#\x87\xdc\xc9\\k\x0f)0\xd7\xc6\x9aT5\x11\x89\xdet\x10^\xd3\x9a\xefB\x8ff,\xfeZI8~\xd7\xa5;\x1d\xe3\xab7\xbd\xf2\x9c{0\xb7:\xd9qf\xe7\xc3p\xb9\x97o9\xe0\xe2\xa5\x9b\xdb 3\x08\x90\xfc\xfeI\x97\x7f\x9c\xad\n\xc4\x9d\x9e\xfe\x04\xad\rK\xfbD\xcc\x81\xaf\x9f\xd2s\xc8R|ZN\xc78X\x04o\xea\xd3-\xa4\xa5\xf7*\xb1\xe6+\x89\x9d\xcb\xb9W\xa0{\xef\xe5\x08\xf4\x16)8\xfa\x14\xf3f4@t\xa99\x9dVdI3G\xfe\xf3\x02\x03\x01\x00\x01\xa3\x82\x0150\x82\x0110\x0f\x06\x03U\x1d\x13\x01\x01\xff\x04\x050\x03\x01\x01\xff00\x06\t`\x86H\x01\x86\xf8B\x01\r\x04#\x16!"Generated with OpenSSL backend."0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x8310g\x06\x03U\x1d#\x04`0^\x80\x14\xfc\xa8\x1c\xc9r`\xc1{)\xf7Zu\xf8\xa9\xaf\xcdA\x10\x831\xa15\xa43011\x0b0\t\x06\x03U\x04\n\x0c\x02RA1\x0f0\r\x06\x03U\x04\x0b\x0c\x06RAPISZ1\x110\x0f\x06\x03U\x04\x03\x0c\x08testpush\x82\x0f\x14wt0"5\t\t\x02C\x00\x00\x00\x00\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\xe60T\x06\x03U\x1d\x11\x04M0K\x865urn:UnifiedAutomation:UaGds:Server:2V43YK2.ra-int.com\x82\x122V43YK2.ra-int.com0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00L\xe5%WBr\x1914\xd0%\xb2\x8a\x80\xbd\xccLR\x9f|\xd3\xabS!~\x83\xe0\xc23\x1e\xdc\xc8Yb\xce\xc9@\x83\x9a\x84s\x08u\xfa"K\xe1\x92\xbd\xd2\xf3\xdb\x7f8\xa1\xee\xfak9\x1e\xe4\xf8\x183nr5/\xe5\xca\x11\x11vbN\n\x7f\xc3\x04\x83i\xa9P\x9d\x83R\xe9o\xbc\xce\x8a\x945\xaf\x8c\xfa\x0b\xd8*&\n\xe7\xb7b\xdeV\xfa\xf7\xd3\xbb\x82\x03\xcd\x00\xa6t\x92\xef\xd1V\x93\xd60\xff\xee\x84\x81Mb\xdbG:\xfcCW\x05\xc2T_\x1d\xa1y\\\xfa\x87\xb8\xad\xf9EYJ\xd5X\x0ehE\xdf\x99\xabI\x01\x91\x83"C\xb1~Hc\x06P\x9dsQ\xed\xf39"\xa6\x14O\x07:\xe6<n\xf9fZ\xd9\xe4eX5\x03\x10\x99\xc8\xfcA\x94\x16r\xff\xf1\x90"[\xb0\xd3\xc5\xfbo\x9cI*\x0b:/\xde\x05.\xb1\xa7\x81\xd5\xa1\xb6(9s\xa0\x95\x01\xb0\x02\xadD\x05*\xa1\xfa"\r\x05I\x9b\xd3i6\xc8\x97\x91\x0b="' ``` According to the specification, this variable can contain more than one certificate so before passing it to `cryptography` parser it should be split into possible certificates. This can be done by reading the length of the certificate and then checking that this length corresponds to the length of the received bytes. ``` >>> len(endpoint.ServerCertificate) 2213 >>> cert_len_idx = 2 >>> number_of_cert_len_bytes = 2 >>> cert_len = int.from_bytes(endpoint.ServerCertificate[cert_len_idx:cert_len_idx + number_of_cert_len_bytes], byteorder="big", signed=False) + number_of_cert_len_bytes + cert_len_idx >>> cert_len 1151 ``` so the above means that the endpoint.ServerCertificate variable has more than one certificate. as proof of that there are two certificates we can try to unpack them: ``` >>> uacrypto.x509_from_der(endpoint.ServerCertificate[:1151]) <Certificate(subject=<Name(DC=2V43YK2,C=DE,L=LocationName,O=Organization,OU=Unit,CN=UaServerCpp@2V43YK2)>, ...)> >>> uacrypto.x509_from_der(endpoint.ServerCertificate[1151:]) <Certificate(subject=<Name(O=RA,OU=RAPISZ,CN=testpush)>, ...)> ``` **Expected behavior**<br /> Connection to server is established with out any errors. **Version**<br /> Python-Version: 3.10.5<br /> opcua-asyncio Version: master branch
Client does not support certificate chain received from server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1245/comments
4
2023-03-15T09:55:03Z
2023-03-31T11:42:21Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1245
1,625,160,669
1,245
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, I'm trying to write values back to plc through client, but it's not updating(please check inside while loop. please find below client code. ``` import asyncio import logging from asyncua import ua from asyncua import Client #_logger = logging.getLogger(__name__) class SubHandler(object): def datachange_notification(self, node, val, data): sdt=data.monitored_item.Value.SourceTimestamp.strftime("%Y-%m-%d %H:%M:%S:%f")[:-3] print(sdt) print("New data change event", node, val) #pass def event_notification(self, event): print("New event", event) async def main(): url = "opc.tcp://admin@localhost:4849" async with Client(url=url) as client: print("Root node is: %r", client.nodes.root) print("Objects node is: %r", client.nodes.objects) print("Children of root are: %r", await client.nodes.root.get_children()) uri = "Softsensor_OPC_Server_2" idx = await client.get_namespace_index(uri) myvar = await client.get_node("ns=2;i=1").get_children() myvar_predicted = await client.get_node("ns=3;i=1").get_children() handler = SubHandler() sub = await client.create_subscription(10, handler) handle = await sub.subscribe_data_change(myvar) await asyncio.sleep(0.1) # we can also subscribe to events from server await sub.subscribe_events() myobj_predicted = await client.nodes.objects.add_object("ns=3;i=1", "predicted Variables") print(myobj_predicted,"############") var_4413_predicted = await myobj_predicted.add_variable('ns=3;s=4413','4413', ua.Double(1.1)) await var_4413_predicted.set_writable(True) count=1.1 while True: var_4413_predicted.write_value(ua.Double(count))##########**NOT UPDATING** await asyncio.sleep(1) count=count+1.1 if __name__ == "__main__": #logging.basicConfig(level=logging.INFO) asyncio.run(main()) ```
write values not updaing in client
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1242/comments
0
2023-03-08T15:56:27Z
2023-03-08T16:05:30Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1242
1,615,511,004
1,242
[ "FreeOpcUa", "opcua-asyncio" ]
Hi I'm trying to write values to PLC through Client but facing issues, please find the client below. Please let me know if I'm made any mistakes ``` import asyncio import logging from asyncua import ua from asyncua import Client #_logger = logging.getLogger(__name__) class SubHandler(object): """ Subscription Handler. To receive events from server for a subscription data_change and event methods are called directly from receiving thread. Do not do expensive, slow or network operation there. Create another thread if you need to do such a thing """ def datachange_notification(self, node, val, data): sdt=data.monitored_item.Value.SourceTimestamp.strftime("%Y-%m-%d %H:%M:%S:%f")[:-3] print(sdt) print("New data change event", node, val) #pass def event_notification(self, event): print("New event", event) async def main(): url = "opc.tcp://127.0.0.1:4849" async with Client(url=url) as client: print("Root node is: %r", client.nodes.root) print("Objects node is: %r", client.nodes.objects) print("Children of root are: %r", await client.nodes.root.get_children()) uri = "Softsensor_OPC_Server_2" idx = await client.get_namespace_index(uri) myvar = await client.get_node("ns=2;i=1").get_children() myvar_predicted = await client.get_node("ns=3;i=1").get_children() handler = SubHandler() sub = await client.create_subscription(10, handler) handle = await sub.subscribe_data_change(myvar) await asyncio.sleep(0.1) # we can also subscribe to events from server await sub.subscribe_events() #######################Trying to write the values to plc############################## myobj_predicted = await client.nodes.objects.add_object("ns=3;i=1", "predicted Variables") print(myobj_predicted,"############") var_4413_predicted = await myobj_predicted.add_variable('ns=3;s=4413','4413', ua.Double(1.1)) var_1547_predicted = await myobj_predicted.add_variable('ns=3;s=1547','1547', ua.Double(1.1)) var_2485_predicted = await myobj_predicted.add_variable('ns=3;s=2485','2485', ua.Double(1.1)) var_1662_predicted = await myobj_predicted.add_variable('ns=3;s=1662','1662', ua.Double(1.1)) var_1546_predicted = await myobj_predicted.add_variable('ns=3;s=1546','1546', ua.Double(1.1)) var_1544_predicted = await myobj_predicted.add_variable('ns=3;s=1544','1544', ua.Double(1.1)) var_1689_predicted = await myobj_predicted.add_variable('ns=3;s=1689','1689', ua.Double(1.1)) var_1686_predicted = await myobj_predicted.add_variable('ns=3;s=1686','1686', ua.Double(1.1)) var_1916_predicted = await myobj_predicted.add_variable('ns=3;s=1916','1916', ua.Double(1.1)) var_1548_predicted = await myobj_predicted.add_variable('ns=3;s=1548','1548', ua.Double(1.1)) var_4413_predicted.write_value(9.8) while True: #myvar_predicted.write_value("4413","123") await asyncio.sleep(1) if __name__ == "__main__": #logging.basicConfig(level=logging.INFO) asyncio.run(main()) `` ``` raise UaStatusCodeError(self.value) asyncua.ua.uaerrors._auto.BadUserAccessDenied: "User does not have permission to perform the requested operation."(BadUserAccessDenied) ````
Trying to write values back to plc through Client but facing issues
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1241/comments
0
2023-03-08T15:13:42Z
2023-03-08T15:32:21Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1241
1,615,442,468
1,241
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, ``` dv = ua.DataValue(ua.Variant(float(row["RECORDED_VALUE"]), ua.VariantType.Float)) dv.ServerTimestamp = None dv.SourceTimestamp = None await var_4413.set_value(dv) ``` In the above code I tried setting dv.ServerTimestamp = None, I'm getting the below issue. Could someone please help me to solve this issue. `File "<string>", line 4, in __setattr__` dataclasses.FrozenInstanceError: cannot assign to field 'ServerTimestamp'
Unable to set dv.ServerTimestamp = None, getting "dataclasses.FrozenInstanceError"
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1240/comments
6
2023-03-08T05:51:55Z
2023-03-08T14:17:56Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1240
1,614,697,135
1,240
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> Given an extensionObject node, if one of its "struct" field is updated by the server, it does **not** trigger a client data-change subscription event to that node. **To Reproduce**<br /> Following the `server-custom-structures-and-enums.py` example: ``` # server snode1, _ = await new_struct(server, idx, "MyStruct", [ new_struct_field("MyBool", ua.VariantType.Boolean), new_struct_field("MyUInt32List", ua.VariantType.UInt32, array=True), ]) msNS = await server.nodes.objects.add_variable(idx, "my_struct", ua.Variant(ua.MyStruct(), ua.VariantType.ExtensionObject)) await msNS.set_writable() async with server: while True: struct = await msNS.read_value() struct.MyBool = not struct.MyBool await msNS.write_value(struct) await asyncio.sleep(1) ``` ``` # client async with client: custom_objs = await client.load_data_type_definitions() idx = await client.get_namespace_index(uri="http://examples.freeopcua.github.io") var = await client.nodes.objects.get_child([f"{idx}:my_struct"]) handler = SubscriptionHandler() # We create a Client Subscription. subscription = await client.create_subscription(500, handler) nodes = [ var ] # We subscribe to data changes for two nodes (variables). await subscription.subscribe_data_change(nodes) ``` The code above doesn't trigger any data change event. However, if I update the `MyBool` field using UaExpert, than I get a data change event! **Expected behavior**<br /> It should trigger change events! **Version**<br /> Python-Version: 3.8 opcua-asyncio Version: master branch, 1.0.1
Updating extensionObject field doesn't trigger "datachange" subscription alerts
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1239/comments
2
2023-03-06T22:14:38Z
2023-03-13T14:42:56Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1239
1,612,292,760
1,239
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> Create an xml file to define a OPCUA model importer the xml into the server use the server.load_data_type_definition() to get the class of the object ````python logging.basicConfig(level=self.ufp_config["logging_level"], force=True) server = Server() await server.init() uri = "http://server.fr/test" server.set_endpoint("opc.tcp://0.0.0.0:4840/server/") server.set_server_name("TEST import_xml and load_data_type_definition") idx = await server.register_namespace(uri) model_import = await server.import_xml("path/to/model.xml") ctypes = await server.load_data_type_definitions() # bug line # return {}, should return the DataType declared in the xml ```` **To Reproduce**<br /> use the code above **Expected behavior**<br /> should return the dictionary containing each DataType declared in the xml, but return empty dictionary instead **Version**<br /> Python-Version: 3.9.15 <br /> opcua-asyncio Version 1.0.1
await server.load_data_type_definitions() does not parse Structure imported from xml
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1234/comments
5
2023-03-02T15:29:37Z
2023-03-06T10:57:22Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1234
1,607,019,296
1,234
[ "FreeOpcUa", "opcua-asyncio" ]
The functionality in `common/structures104` allows to generate dataclasses for ExtensionObjects on the fly. That purpose of dataclasses are mainly generating the typing info to make (de)serializing possible. The Python 3 typign system is very powerfull in detect and preventing all kidn of errors related to correct use of types. When using Python 3 with type info in your IDE, on the fly generated code prevents providing correct type info while editing files. Thats why we generate python files with the dataclasses, based on the functionality in structures104. Only the code currently generated by structures104 is note very type friendly. Lets says we take a struct called `MyStructWithOptionalField` with the following fields: ![image](https://user-images.githubusercontent.com/1525169/220621394-9e9ee3c7-21c5-4aa7-a94e-dfef4ed385b0.png) The generated code with structures104 would be: ```python {.line-numbers} class MyStructWithOptionalField: ''' MyStructWithOptionalField structure autogenerated from StructureDefinition object ''' data_type = ua.NodeId.from_string('''ns=2;i=3003''') Encoding: ua.UInt32 = field(default=0, repr=False, init=False, compare=False) aString: ua.String = None # typing error cannot assign None to ua.String aStringOptional: Optional[ua.String] = None aStringArray: List[ua.String] = field(default_factory=list) aStringArrayOptional: List[ua.String] = field(default_factory=list) aDouble: ua.Double = 0 # typing error aDoubleOptional: Optional[ua.Double] = 0 # typing error ``` In the above code are 3 typing errors. I changed `structures104::get_default_value` it a little bit to: * return for optional fields the default value `None` * use the type it self for correct default values ```python {.line-numbers} @dataclass class MyStructWithOptionalField: ''' MyStructWithOptionalField structure autogenerated from StructureDefinition object ''' data_type = ua.NodeId.from_string('''ns=2;i=3003''') Encoding: ua.UInt32 = field(default=0, repr=False, init=False, compare=False) aString: ua.String = ua.String() aStringOptional: Optional[ua.String] = None aStringArray: List[ua.String] = field(default_factory=list) aStringArrayOptional: List[ua.String] = field(default_factory=list) aDouble: ua.Double = ua.Double(0) aDoubleOptional: Optional[ua.Double] = None ``` And maybe the optional list should also be a `None` ? Side effect it that you now can easily detect is an optional field is present or not: ``` my_struct: MyStructWithOptionalField= ... if my_struct.aStringOptional is not None: # value is set ... else: # value is not set ... ``` With big (nested) structures the optional fields set to None also lead to smaller playload over the wire. What do you think about change of default values? It leads to more Python friendly code and slimmer filled datastructure.
[structures104] Generated ExtensionObjects vs default values
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1226/comments
2
2023-02-22T13:45:17Z
2023-03-06T07:30:14Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1226
1,595,133,453
1,226
[ "FreeOpcUa", "opcua-asyncio" ]
Hi Team, I am trying to write values on to a variable node using opcua-asyncio python as below onto a variable . The variable is of Type Int64 ( integer) ``` import time import logging import asyncio from asyncua import Client, Node, ua async def main(): async with Client(url='opc.tcp://192.168.0.1:4840') as client: while True: # Do something with client **#For Integer type i m using the below code to write 900 , but not working** node2 = client.get_node('ns=2;s=RACK3_840D.production_raw.DOUBLE_TAG') await node2.write_value(900, varianttype=ua.VariantType.Int64) **#For Boolean type i m using the below code to write false , but not working** node2 = client.get_node('ns=2;s=RACK3_840D.production_raw.BOOLEAN_TAG') await node2.write_value(0, varianttype=ua.VariantType.BOOLEAN) time.sleep(10) if __name__ == "__main__": logging.basicConfig(level=logging.INFO) asyncio.run(main()) ``` **When i run the program i get the error / exceptions as below :** **C:\Users\SIEMENS_Hotline\AppData\Local\Programs\Python\Python310\python.exe C:\Users\SIEMENS_Hotline\PycharmProjects\BFC_Test_App\Asyc_Read.py INFO:asyncua.client.client:connect INFO:asyncua.client.ua_client.UaClient:opening connection WARNING:asyncua.uaprotocol:updating client limits to: TransportLimits(max_recv_buffer=65535, max_send_buffer=65535, max_chunk_count=65, max_message_size=4194304) INFO:asyncua.client.ua_client.UASocketProtocol:open_secure_channel INFO:asyncua.client.ua_client.UaClient:create_session INFO:asyncua.client.ua_client.UaClient:activate_session INFO:asyncua.client.client:disconnect INFO:asyncua.client.ua_client.UaClient:close_session INFO:asyncua.client.ua_client.UASocketProtocol:close_secure_channel INFO:asyncua.client.ua_client.UASocketProtocol:Request to close socket received INFO:asyncua.client.ua_client.UASocketProtocol:Socket has closed connection Traceback (most recent call last): File "C:\Users\SIEMENS_Hotline\PycharmProjects\BFC_Test_App\Asyc_Read.py", line 34, in <module> asyncio.run(main()) File "C:\Users\SIEMENS_Hotline\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\SIEMENS_Hotline\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "C:\Users\SIEMENS_Hotline\PycharmProjects\BFC_Test_App\Asyc_Read.py", line 20, in main await node2.write_value(900, varianttype=ua.VariantType.Int64) File "C:\Users\SIEMENS_Hotline\AppData\Local\Programs\Python\Python310\lib\site-packages\asyncua\common\node.py", line 235, in write_value await self.write_attribute(ua.AttributeIds.Value, dv) File "C:\Users\SIEMENS_Hotline\AppData\Local\Programs\Python\Python310\lib\site-packages\asyncua\common\node.py", line 285, in write_attribute result[0].check() File "C:\Users\SIEMENS_Hotline\AppData\Local\Programs\Python\Python310\lib\site-packages\asyncua\ua\uatypes.py", line 328, in check raise UaStatusCodeError(self.value) asyncua.ua.uaerrors._auto.Bad: "The operation failed."(Bad) Process finished with exit code 1** **SNAP for reference below :** ![Capture_error_snap](https://user-images.githubusercontent.com/64892368/220625252-beea1499-4b32-46ee-ab5b-dcbd772f069f.JPG) Request you to pls help me as i m exploring a POC to be shown to my management. It will be great if any of you can help me for the same. Thanks Rajnish Vishwakarma
Regarding Writing values on a variable tag using opcua-asyncio python
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1225/comments
5
2023-02-22T12:54:41Z
2023-03-14T08:38:14Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1225
1,595,057,057
1,225
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> I get a weird error in some scenarios an and do not have any idea where those errors come from. **To Reproduce**<br /> Steps to reproduce the behavior incl code: File `server.py`: ```python import threading import time from typing import Type, Dict, Any from asyncua.sync import Server, SyncNode from asyncua.ua import ObjectIds, TwoByteNodeId class OpcuaServer: _server: Server _scenario_name: str _idx: int _activity_thread: threading.Thread _machine_variables: dict = {} _activity_running: bool = True _shutdown_requested: bool = False def __init__(self, endpoint: str, scenarios: Dict[str, Type]) -> None: self._server = Server() self._server.set_endpoint(endpoint) self._server.set_server_name("Packaging Sealing Demo Control OpcUa Server") self._scenario_name = 'Running' self._scenarios = scenarios self._idx = self._server.register_namespace("http://dummyMachine.device.io") self._packaging_machine: SyncNode = self._server.get_node( TwoByteNodeId(ObjectIds.ObjectsFolder)).add_object(self._idx, "PackagingMachine") for name, value in self._scenarios[self._scenario_name].__dict__.items(): self._machine_variables[name] = self.add_variable(name, value) self._machine_variables[name].set_writable(True) self._activity_node = self.add_variable('movement', 1) def add_variable(self, name: str, value: Any) -> SyncNode: return self._packaging_machine.add_variable(f"ns={self._idx};s={name}", name, value) def start(self): self._server.start() self._activity_thread = threading.Thread( target=self.machine_activity, daemon=True, ) self._activity_thread.start() def stop(self) -> None: self._shutdown_requested = True self._activity_thread.join() self._server.stop() def get_node_info_for_all_nodes(self): return [self._machine_variables[node].read_data_value(raise_on_bad_status=False).StatusCode for node in self._machine_variables.keys()] def machine_activity(self): while not self._shutdown_requested: if self._activity_running: current_value = self._activity_node.get_value() self._activity_node.set_value(1 - current_value) time.sleep(1) ``` file `test_server.py` ```python from dataclasses import dataclass import pytest from server import OpcuaServer URL = 'opc.tcp://127.0.0.1:34411' @pytest.fixture() def demo_opcua_server() -> OpcuaServer: @dataclass class Scenario: sensor_one: int sensor_twoo: float # it works, if this name is changed to "sensor_two" scenarios_1 = { 'Running': Scenario( sensor_one=1, sensor_twoo=130.0, # also here ), } server = OpcuaServer(endpoint=URL, scenarios=scenarios_1) server.start() yield server server.stop() def test_node_creation_from_scenarios(demo_opcua_server): demo_opcua_server.get_node_info_for_all_nodes() def test_adding_a_new_node_to_config_does_not_change_node_ids(): @dataclass class Scenario: sensor_one: int sensor_two: float scenarios_1 = { 'Running': Scenario( sensor_one=1, sensor_two=130.0, ), } server_1 = OpcuaServer(endpoint=URL, scenarios=scenarios_1) server_1.start() machine_variables_1 = server_1.get_node_info_for_all_nodes() server_1.stop() @dataclass class Scenario2: sensor_new: bool sensor_one: int sensor_two: float scenarios_2 = { 'Running': Scenario2( sensor_new=True, sensor_one=1, sensor_two=130.0, ), } server_2 = OpcuaServer(endpoint=URL, scenarios=scenarios_2) server_2.start() machine_variables_2 = server_2.get_node_info_for_all_nodes() server_2.stop() ``` If you execute the tests, you might notice some strange behavior: 1. If you execute each tests alone, everything is fine. 2. If you execute both tests at one, you will get this error: ``` FAILED [100%] test_server.py:33 (test_adding_a_new_node_to_config_does_not_change_node_ids) def test_adding_a_new_node_to_config_does_not_change_node_ids(): @dataclass class Scenario: sensor_one: int sensor_two: float scenarios_1 = { 'Running': Scenario( sensor_one=1, sensor_two=130.0, ), } server_1 = OpcuaServer(endpoint=URL, scenarios=scenarios_1) server_1.start() > machine_variables_1 = server_1.get_node_info_for_all_nodes() test_server.py:49: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ server.py:52: in get_node_info_for_all_nodes return [self._machine_variables[node].read_data_value(raise_on_bad_status=False).StatusCode for node in self._machine_variables.keys()] server.py:52: in <listcomp> return [self._machine_variables[node].read_data_value(raise_on_bad_status=False).StatusCode for node in self._machine_variables.keys()] venv/lib/python3.11/site-packages/asyncua/sync.py:94: in wrapper result = self.tloop.post(aio_func(*args, **kwargs)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <ThreadLoop(Thread-1, stopped 140659069720128)> coro = <coroutine object Node.read_data_value at 0x7fedbde8a7a0> def post(self, coro): if not self.loop or not self.loop.is_running(): > raise ThreadLoopNotRunning(f"could not post {coro}") E asyncua.sync.ThreadLoopNotRunning: could not post <coroutine object Node.read_data_value at 0x7fedbde8a7a0> venv/lib/python3.11/site-packages/asyncua/sync.py:50: ThreadLoopNotRunning ``` 3. If you rename `sensor_twoo` to `sensor_two`, everything works fine. It seems like your library does have some sort of global state which creates this weird behavior. It's super strange. **Expected behavior**<br /> Two green tests, even if I execute both test at the same run. **Version**<br /> Python-Version: Python 3.11.2 opcua-asyncio Version: 1.0.1 `pip freeze`: ``` aiofiles==23.1.0 aiosqlite==0.18.0 asyncua==1.0.1 attrs==22.2.0 cffi==1.15.1 cryptography==39.0.1 iniconfig==2.0.0 packaging==23.0 pluggy==1.0.0 pycparser==2.21 pytest==7.2.1 python-dateutil==2.8.2 pytz==2022.7.1 six==1.16.0 sortedcontainers==2.4.0 ``` FYI @saknarf @DasCapschen
asyncua.sync.ThreadLoopNotRunning: could not post <coroutine object Node.read_data_value at 0x7f9ae953a7a0>
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1219/comments
6
2023-02-20T14:20:41Z
2023-02-28T12:59:15Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1219
1,591,957,676
1,219
[ "FreeOpcUa", "opcua-asyncio" ]
I'm using the Client from asyncua.sync. When reading multiple values, read_values(nodes) works well. What is the equivalent for writing multiple values?
Best way to Write to Multiple Nodes at once?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1210/comments
1
2023-02-15T17:47:06Z
2023-02-15T17:50:19Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1210
1,586,287,577
1,210
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> `server.stop()` raises, when server starting failed. This is especially problematic when the sync server is used, because the process does somehow not end properly. **To Reproduce**<br /> Consider the following code: ``` python import time from asyncua.sync import Server if __name__ == "__main__": server = Server() server.set_endpoint("opc.tcp://127.0.0.1:4840") try: server.start() print("started server") while True: time.sleep(1) finally: print("stopping") server.stop() ``` Run this simultaneously in two processes. The second process is obviously not able to bind the same port again, and `server.start()` raises an `OsError`. However, in this case, the `server.stop()` in the finally block does also raise, and even worse, something seems to hang (threadloop is not ended?) and the process does only terminate when strg+c is pressed. Output: ``` venv ❯ python minimal_opcua.py Endpoints other than open requested but private key and certificate are not set. OPC UA Server(opc.tcp://127.0.0.1:4840) error starting server Traceback (most recent call last): File "/home/user/coding/voraus-system-control-py/venv/lib/python3.9/site-packages/asyncua/server/server.py", line 441, in start await self.bserver.start() File "/home/user/coding/voraus-system-control-py/venv/lib/python3.9/site-packages/asyncua/server/binary_server_asyncio.py", line 139, in start self._server = await asyncio.get_running_loop().create_server(self._make_protocol, self.hostname, self.port) File "/usr/lib/python3.9/asyncio/base_events.py", line 1506, in create_server raise OSError(err.errno, 'error while attempting ' OSError: [Errno 98] error while attempting to bind on address ('127.0.0.1', 4840): address already in use stopping Traceback (most recent call last): File "/home/user/coding/voraus-system-control-py/minimal_opcua.py", line 9, in <module> server.start() File "/home/user/coding/voraus-system-control-py/venv/lib/python3.9/site-packages/asyncua/sync.py", line 94, in wrapper result = self.tloop.post(aio_func(*args, **kwargs)) File "/home/user/coding/voraus-system-control-py/venv/lib/python3.9/site-packages/asyncua/sync.py", line 52, in post return futur.result() File "/usr/lib/python3.9/concurrent/futures/_base.py", line 446, in result return self.__get_result() File "/usr/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result raise self._exception File "/home/user/coding/voraus-system-control-py/venv/lib/python3.9/site-packages/asyncua/server/server.py", line 445, in start raise exp File "/home/user/coding/voraus-system-control-py/venv/lib/python3.9/site-packages/asyncua/server/server.py", line 441, in start await self.bserver.start() File "/home/user/coding/voraus-system-control-py/venv/lib/python3.9/site-packages/asyncua/server/binary_server_asyncio.py", line 139, in start self._server = await asyncio.get_running_loop().create_server(self._make_protocol, self.hostname, self.port) File "/usr/lib/python3.9/asyncio/base_events.py", line 1506, in create_server raise OSError(err.errno, 'error while attempting ' OSError: [Errno 98] error while attempting to bind on address ('127.0.0.1', 4840): address already in use During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/user/coding/voraus-system-control-py/minimal_opcua.py", line 15, in <module> server.stop() File "/home/user/coding/voraus-system-control-py/venv/lib/python3.9/site-packages/asyncua/sync.py", line 332, in stop self.tloop.post(self.aio_obj.stop()) File "/home/user/coding/voraus-system-control-py/venv/lib/python3.9/site-packages/asyncua/sync.py", line 52, in post return futur.result() File "/usr/lib/python3.9/concurrent/futures/_base.py", line 446, in result return self.__get_result() File "/usr/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result raise self._exception File "/home/user/coding/voraus-system-control-py/venv/lib/python3.9/site-packages/asyncua/server/server.py", line 463, in stop await self.bserver.stop() File "/home/user/coding/voraus-system-control-py/venv/lib/python3.9/site-packages/asyncua/server/binary_server_asyncio.py", line 159, in stop self.cleanup_task.cancel() AttributeError: 'NoneType' object has no attribute 'cancel' ^CException ignored in: <module 'threading' from '/usr/lib/python3.9/threading.py'> Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 1477, in _shutdown lock.acquire() KeyboardInterrupt: ``` **Expected behavior**<br /> server.stop() should ideally not raise and the threadloop should be ended in any case. **Version**<br /> Python-Version: 3.9<br /> opcua-asyncio Version (e.g. master branch, 0.9) 1.0.1/master:
Impossible to stop the server when port is already in use
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1209/comments
2
2023-02-15T17:33:25Z
2023-02-17T21:23:16Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1209
1,586,270,757
1,209
[ "FreeOpcUa", "opcua-asyncio" ]
Is it possible to add nodes on the server from the client. Is there something like a node service for this?
Adding Nodes from Client on Server.
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1208/comments
2
2023-02-15T15:07:34Z
2023-02-15T17:51:11Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1208
1,586,022,653
1,208
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> Catching several events from Siemens S71500 CPU results in an `UnicodeDecodeError` when decoding `event.NodeId.to_string()` Seems to be related to #1203 and and #621. **To Reproduce**<br /> .decode() following NodeId bytestrings ``` NodeId(Identifier=b')=\xf0ZCE\xdbE\xa9\x9a\x86b\xd1\x84\xcaf', NamespaceIndex=3, NodeIdType=<NodeIdType.ByteString: 5>) NodeId(Identifier=b'9\xbb\x14n\x01\x82\x06@\x9f\x7f`U?\xb3@0', NamespaceIndex=3, NodeIdType=<NodeIdType.ByteString: 5>) NodeId(Identifier=b'\xcd\x8e1NQ0\xcb@\x93=\xc0y/w1T', NamespaceIndex=3, NodeIdType=<NodeIdType.ByteString: 5>) ``` **Expected behavior**<br /> Proper decoding of NodeId. Setting .decode(errors='replace') does not seem to fix things as in #621. **Screenshots**<br /> <img width="701" alt="image" src="https://user-images.githubusercontent.com/34475288/219058310-d2ce71fb-8a6a-409d-854e-99450d2e15c1.png"> ``` ERROR:asyncua.common.subscription:Exception calling event handler Traceback (most recent call last): File "/home/willem/miniconda3/envs/plectron/lib/python3.10/site-packages/asyncua/common/subscription.py", line 165, in _call_event self._handler.event_notification(result) File "/home/willem/projects/drebble/plectron/edge/experiments/opcua_sub/opcua_ac_sub.py", line 25, in event_notification conditionId = event.NodeId.to_string() File "/home/willem/miniconda3/envs/plectron/lib/python3.10/site-packages/asyncua/ua/uatypes.py", line 535, in to_string identifier = identifier.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 2: invalid continuation byte ``` **Version**<br /> Python-Version: 3.10.9<br /> opcua-asyncio Version: 1.0.1
UnicodeDecodeError
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1207/comments
0
2023-02-15T14:41:30Z
2023-03-14T08:51:45Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1207
1,585,979,228
1,207
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> In https://github.com/FreeOpcUa/opcua-asyncio/blob/master/asyncua/ua/uaerrors/_base.py, ``UaStatusCodeError`` is defined as: ``class UaStatusCodeError(_AutoRegister("Meta", (UaError,), {})): ...`` This confuses my typechecker (PyLance / VSCode). It yells at me that I cannot except on e.g. ``BadTooManyOperations`` because it thinks that it is not a proper ``Exception`` subclass. I get ugly red squiggly lines telling me I made a mistake, which I didn't 😢. The ``_AutoRegister`` magic is purely internal to ``_base.py``. It seems like leftover to me, that is not useful for anything obvious anymore. **Expected behavior**<br /> Can we just derive ``UaStatusCodeError`` from ``UaError`` in plain language? ``class UaStatusCodeError(UaError): ...`` **Version**<br /> Python-Version: 3.9<br /> opcua-asyncio Version (e.g. master branch, 0.9): 1.0.1
UaStatusCodeError superclass confuses typecheckers
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1204/comments
2
2023-02-14T10:15:09Z
2023-02-26T11:23:13Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1204
1,583,879,801
1,204
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> Trying to use ``client.load_data_type_definitions`` with my test server crashes with the message "ValueError: Source code string cannot contain null bytes``. Investigating into it, I found that * On my server, data type nodes have ByteString IDs that contain NULL bytes. (Probably directly from some fixed-length C buffer) * ``structure104.py``: ``make_structure_code`` inserts the string representation of the Node ID into the generated source * Said string representation does not properly escape the NULL (or in fact, any other non-ascii) bytes. ``NodeId`` in ``uatypes.py:552`` it just uses ``identifier.decode()`` to convert the bytes to string, which may by itself raise any kind of error. **To Reproduce**<br /> Steps to reproduce the behavior incl code: Setup a server containing a datatype node with byte node id incl. Nullbytes, e.g. ``NodeId(Identifier=bytes([65, 66, 0, 0]), NodeIdType=NodeIdType.ByteString)`` Connect and load type defs: ``async with Client("...") as client: client.load_data_type_definitions()`` Exercise for the reader: what will happen with ``NodeId(Identifier=bytes([0xff]), NodeIdType=NodeIdType.ByteString)`` ? (Answer: ``NodeId.to_string`` raises ``UnicodeDecodeError``) **Expected behavior**<br /> * ``NodeId.to_string`` should return a valid string for any ``bytes``; * string representation allows lossless reconstruction with ``NodeId.from_string()``; * string should be properly escaped in ``structure104.py: make_structure_code`` **Screenshots**<br /> Node in question, viewed in UaExpert: (Path: Types / BaseDataType / Structure / UserStructures / name ) ![grafik](https://user-images.githubusercontent.com/16409434/218669177-fa6bf704-d2c7-40f1-ae46-19e282d78dfe.png) Traceback: ``` File "D:\Programme\Python39\lib\site-packages\asyncua\client\client.py", line 768, in load_data_type_definitions return await load_data_type_definitions(self, node, overwrite_existing=overwrite_existing) File "D:\Programme\Python39\lib\site-packages\asyncua\common\structures104.py", line 442, in load_data_type_definitions env = await _generate_object(dts.name, dts.sdef, data_type=dts.data_type, log_fail=log_ex) File "D:\Programme\Python39\lib\site-packages\asyncua\common\structures104.py", line 296, in _generate_object exec(code, env) ValueError: source code string cannot contain null bytes ``` **Version**<br /> Python-Version:3.9 <br /> opcua-asyncio Version (e.g. master branch, 0.9):1.0.1
ByteString-type NodeId can yield "unsafe" string representation.
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1203/comments
0
2023-02-14T07:44:11Z
2023-02-19T18:45:16Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1203
1,583,662,179
1,203
[ "FreeOpcUa", "opcua-asyncio" ]
When running `client_to_uanet_alarm_conditions.py` using the example alarms and conditions server `opc.tcp://opcua.demo-this.com:62544/Quickstarts/AlarmConditionServer` no events are coming in. When subscribing to the Server object in UaExpert this works without a problem. Could i be missing something or should this example work out of the box?
no events in alarms and conditions example
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1200/comments
8
2023-02-10T13:20:36Z
2023-02-13T10:12:59Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1200
1,579,675,393
1,200
[ "FreeOpcUa", "opcua-asyncio" ]
Hello, We are working with Read_Raw_History but we see a continuation point with limit of 10000 which is not sufficient for us. Is there a way to make this optional or iterate through the full list to get full data set from Read Raw History. Example : Let OPCUA gives a dataset of 50000 records but Read Raw History is giving us only 10000 data points that 50000 data set. Is there a way to loop through the records and get all the 50000 records in Python Client ?
Read_Raw_History Continuation limit of 10000 needs to be increased to 1000000 or make this an optional
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1198/comments
14
2023-02-07T15:52:24Z
2023-02-08T04:43:41Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1198
1,574,578,566
1,198
[ "FreeOpcUa", "opcua-asyncio" ]
Hello, I need to check if server is currently running. In the past I used "InternalServer.is_running()" method (python_opcua library). Now I want to migrate to asyncua lib but this method seems not existing anymore. How can I perform this function? Thanks in advance.
Server running
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1191/comments
1
2023-02-03T12:30:19Z
2023-03-14T08:45:07Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1191
1,569,769,697
1,191
[ "FreeOpcUa", "opcua-asyncio" ]
Hello all, I am a beginner with OPCUA-asyncio and I am grateful for some support. I want to build a server that contains a StateMachine. This should behave like a ProgramStateMachine. I already have an xml-file which I import and build my server from (see picture). Now I want to be able to switch between the states with the methods contained in the StateMachine. Is there a way to connect to the loaded StateMachine? With the methods this works with `link_method` so I am looking for something for the StateMachine. I am grateful for any support or alternative approach. ![image](https://user-images.githubusercontent.com/74958641/215822660-91df13e3-9b81-4dff-9ddb-226de3400f3b.png)
connect to statemachine imported from xml
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1188/comments
1
2023-01-31T16:35:58Z
2023-01-31T17:05:34Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1188
1,564,654,078
1,188
[ "FreeOpcUa", "opcua-asyncio" ]
Greetings! I have a tag in PLC that increases by 1 every 10ms as shown below. My target is to read this tag(OPC_Count) every 1000ms with opc ua client. I was able to read the value but saw some data loss. I am using FactoryTalk Linx as the opc ua server and I wrote a client using this library. ![image](https://user-images.githubusercontent.com/23703553/213323749-d2b5452d-ad95-4530-8099-132e0639c032.png) I created a subscription to this node and set the publishing interval to 1000ms. Below is the data loss I observed. As the value increases by 1 every 10ms, I expect to see the number increase by 100 every second. However, sometimes it increases by 200 between two prints. When I sleep for 100 seconds, I can only get 90 ish data instead of 100 data. ![image](https://user-images.githubusercontent.com/23703553/213325547-941c740a-1787-457c-81d5-cafbb20fe93f.png) Is there any method to fix this? Here is the code I am using. I hope to make the actual sampling interval as accurate as possible. Thanks in advance! ``` async with Client(url=endpoint_url) as client: handler = SubscriptionHandler() node = client.get_node("ns=2;s=TagGroup01#::[CompactLogix]Program:MainProgram.OPC_Count") subscription = await client.create_subscription(1000, handler) nodes = [node] await subscription.subscribe_data_change(nodes=nodes, queuesize=1) await asyncio.sleep(100) print(len(handler.data_history)) class SubscriptionHandler: def __init__(self): self.data_history = [] def datachange_notification(self, node: Node, value, data): self.data_history.append(value) print('OPC Count: ', value) ```
Data loss while reading value by a fixed rate using subscription
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1184/comments
4
2023-01-19T00:20:31Z
2023-03-14T08:52:28Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1184
1,548,317,680
1,184
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> After an upgrade to `0.9.98` I see the following warnings: ``` 2023-01-16 14:33:01,068 WARNING asyncua.uaprotocol: updating server limits to: TransportLimits(max_recv_buffer=65535, max_send_buffer=65535, max_chunk_count=1601, max_message_size=104857600) 2023-01-16 14:33:01,077 WARNING asyncua.uaprotocol: updating server limits to: TransportLimits(max_recv_buffer=65535, max_send_buffer=65535, max_chunk_count=1601, max_message_size=104857600) ... ``` **To Reproduce**<br /> * Start a server (`python examples/server-minimal.py`) * Connect with a client to the server (`python examples/client-minimal.py`) **Expected behavior**<br /> I don't expect to see warning for the regular usage. **Version** I tested with two sets of versions Python-Version: 3.9.15 opcua-asyncio Version: 0.9.98 Python-Version: 3.10.9 opcua-asyncio Version: 2c78916fccef7cc72e38ad5c6308400222e0e2aa (current master)
WARNING asyncua.uaprotocol: updating server limits to...
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1180/comments
4
2023-01-16T13:55:32Z
2023-02-12T06:38:52Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1180
1,534,979,562
1,180
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, guys! I'm trying to put the received values in a queue and then get them in a separate thread. This is necessary in order to call the read function from FastApi. But when I try to stop the thread via an event (stop_read() function), the process freezes on the 'reading_thread.join()' (stop_read() function). I noticed that the problem is in the line 'item = _queue.get()' (read_data(queue) function). If i comment it out, then the stream ends normally. Any hint will be helpful. Thanks! ``` from queue import Queue from threading import Thread, Event queue = Queue() event = Event() reading_thread = None class SubscriptionHandler: def datachange_notification(self, node: Node, val, data): queue.put_nowait({'node': node.nodeid.to_string(), 'value': val}) def status_change_notification(self, status: ua.StatusChangeNotification): pass def read_data(_queue): # thread function while not event.is_set(): item = _queue.get() # when i comment this print(item) # # print(f'just strimg') # and uncommet this, the thread terminates normally queue.task_done() client_shell.status = Status.CONNECTED print('Reading process stopped.') async def read(): # calling from FastApi handler = SubscriptionHandler() node = client_shell.ua_client.get_node('ns=3;s=1008') try: subscription = await client_shell.ua_client.create_subscription(client_shell.period, handler) await subscription.subscribe_data_change(node) global reading_thread reading_thread = Thread(target=read_data, args=(queue,)) reading_thread.start() return 'Process started' except (ConnectionError, ua.UaError) as e: await disconnect_from_server() return 'Disconnect from server. ' + str(e) def stop_read(): # try to stop reading thread. Calling from FastApi event.set() reading_thread.join() # wait while thread finished ```
Reading values from queue in thread
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1178/comments
8
2023-01-14T11:36:44Z
2023-01-16T14:43:26Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1178
1,533,223,497
1,178
[ "FreeOpcUa", "opcua-asyncio" ]
Hi! I have this code: ``` try: subscription = await uaclient.create_subscription(period, handler) await subscription.subscribe_data_change(nodes_dict) while True: await uaclient.check_connection() # Throws a exception if connection is lost data = await queue.get() print(data) queue.task_done() except (ConnectionError, ua.UaError): print('Something wrong') ``` All works fine, but if i manually shutdown the server i'v got this error: ``` ServiceFault (BadNoSubscription, diagnostics: DiagnosticInfo(SymbolicId=None, NamespaceURI=None, Locale=None, LocalizedText=None, AdditionalInfo=None, InnerStatusCode=None, InnerDiagnosticInfo=None)) from server received in response to PublishRequest Exception calling status change handler Traceback (most recent call last): File "C:\Workspace\Python\Katla_micros\venv\Lib\site-packages\asyncua\client\client.py", line 457, in _monitor_server_loop _ = await self.nodes.server_state.read_value() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Workspace\Python\Katla_micros\venv\Lib\site-packages\asyncua\common\node.py", line 179, in read_value result = await self.read_data_value() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Workspace\Python\Katla_micros\venv\Lib\site-packages\asyncua\common\node.py", line 190, in read_data_value return await self.read_attribute(ua.AttributeIds.Value, None, raise_on_bad_status) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Workspace\Python\Katla_micros\venv\Lib\site-packages\asyncua\common\node.py", line 304, in read_attribute result = await self.session.read(params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Workspace\Python\Katla_micros\venv\Lib\site-packages\asyncua\client\ua_client.py", line 397, in read data = await self.protocol.send_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Workspace\Python\Katla_micros\venv\Lib\site-packages\asyncua\client\ua_client.py", line 163, in send_request raise ConnectionError("Connection is closed") from None ConnectionError: Connection is closed During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Workspace\Python\Katla_micros\venv\Lib\site-packages\asyncua\common\subscription.py", line 173, in _call_status if asyncio.iscoroutinefunction(self._handler.status_change_notification): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'SubscriptionHandler' object has no attribute 'status_change_notification' ``` How i can catch this? Ideally, I need to try to reconnect to the server after some time. Thanks for reply!
Catch exception when server shutdown
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1176/comments
5
2023-01-12T12:49:07Z
2023-01-16T14:50:19Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1176
1,530,657,228
1,176
[ "FreeOpcUa", "opcua-asyncio" ]
Greetings! Is it possible to read the data type of object nodes? I am trying to find all the nodes with the type 'PID_Enhanced'. I have some tags(UDT) with this type, but as they are UDTs, they have member variables. When I browse the nodes using opc ua, These PIDE nodes are object nodes so they do not have the data type attribute. I was wondering if the type 'PID_Enhanced' can be read from PLC? If so, how can I read it? Here is what I see from the PLC code. My target is to get the data type PID_Enhanced using opc ua. ![image](https://user-images.githubusercontent.com/23703553/211942934-0ebf0dd4-8e07-4a9a-9564-e7f38c1a7873.png) Thanks in advance!
Data type for object nodes
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1175/comments
4
2023-01-11T23:54:44Z
2023-01-12T21:50:04Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1175
1,529,884,116
1,175
[ "FreeOpcUa", "opcua-asyncio" ]
Hello, i recently worked with ExtensionObject arrays but i encountered a problem i am unable so solve. I followed the [example ](https://github.com/FreeOpcUa/opcua-asyncio/blob/master/examples/server-custom-structures-and-enums.py) and modified it to a certain extend. In the following. i will only show parts of the program that are very specific or differ from the example. I can not provide the entirety of the code because of privacy issues. Besides setting up the server just like the example i generated the new type RobotDataEntry: <img width="347" alt="issue_01" src="https://user-images.githubusercontent.com/120554349/211810996-2150fead-1f06-4952-8e0c-9f03f37503dc.PNG"> Next i created a variable with this type: <img width="483" alt="issue_02" src="https://user-images.githubusercontent.com/120554349/211811365-e49347b3-1b4d-455f-ba94-d381f433146d.PNG"> where `N_REQUEST_FIELDS` is a constant set to 100. The `node_id` variable is just a string. Writing is done with this code: <img width="568" alt="issue_03" src="https://user-images.githubusercontent.com/120554349/211811668-8966e9f4-5b0a-4b10-972d-00a21687affb.PNG"> <img width="651" alt="issue_04" src="https://user-images.githubusercontent.com/120554349/211811678-c07c4ad6-6342-474b-aab6-1f2f201cb0a0.PNG"> with `construct_opcua_array()` being a method for creating a list of `ua.RobotDataEntry` entries. The self references are due to the class containing this method but basically it is just the same code for initializing the default value on creating the variable. The variant for example is still `ua.ExtensionObject`. My question now is: Is this the proper way of defining and updating ExtensionObject arrays? Because clients connecting to the server holding this variable are only receiving an empty array with a size of 100. These clients are written in node-opcua. I encountered a similar problem described in [this issue](https://github.com/mikakaraila/node-red-contrib-opcua), maybe it is related because the error on the receiving client is the same saying "Internal Error: we are not expecting this dataType to be processed already". [Here](https://github.com/node-opcua/node-opcua/blob/master/packages/node-opcua-client-dynamic-extension-object/source/resolve_dynamic_extension_object.ts) is a reference to the related code section in line 47. If you need any further information or code segments, let me know. Thanks
Declare ExtensionObject array variable
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1172/comments
9
2023-01-11T12:48:27Z
2023-01-12T10:54:57Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1172
1,528,976,615
1,172
[ "FreeOpcUa", "opcua-asyncio" ]
Greetings! Sorry to ask a basic question. Is it possible to search for servers on the same PC from the client? In the server configuration, the Discovery Service URL is opc.tcp://localhost:4840. The server URL that I am trying to find is opc.tcp://localhost:4990. Here is what I tried and it gives me a ConnectionError. If I change the port to 4990 then it works and prints the Discovery URLs for all the endpoints. Is there a way to use the Discovery Service URL (port 4840) to find all the server URLs from the client on the same PC? ``` async def main(): async with Client(url="opc.tcp://localhost:4840", timeout=10) as client: servers = await client.connect_and_find_servers() print(servers) ``` Thanks in advance!
Discover local servers from client
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1171/comments
6
2023-01-10T21:19:30Z
2023-01-12T17:05:31Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1171
1,528,022,202
1,171
[ "FreeOpcUa", "opcua-asyncio" ]
Greetings! I am trying to write an OPC client for controllogix PLCs. Can this library be used to write an OPC client in Python that can communicate with the OPC server configured using rslinx? The main functions I want to achieve are searching for available OPC servers and connecting and reading data from the PLC. I tried to use the client example but don't know how to set the URL for rslinx OPC server. Any help or guidance is greatly appreciated!
Use opcua-asyncio client to communicate with Rockwell rslinx classic opc server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1170/comments
2
2023-01-05T21:59:30Z
2023-01-06T16:30:31Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1170
1,521,502,954
1,170
[ "FreeOpcUa", "opcua-asyncio" ]
![image](https://user-images.githubusercontent.com/56362817/210723569-f4e1e986-0145-4645-a556-8de3fea65107.png)
Python Charmers Future denial of service vulnerability
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1165/comments
3
2023-01-05T07:18:02Z
2023-09-28T10:39:59Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1165
1,520,222,898
1,165
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, I think it is most likely a failure on my site but because the minimal server example works fine, it is a little bit strange. When I run ./run_tests.sh most tests fail due to missing attributes. ~/Dokumente/opcua-asyncio$ ./run-tests.sh ============================================================= test session starts ============================================================= platform linux -- Python 3.10.6, pytest-7.2.0, pluggy-1.0.0 rootdir: /home/ralf/Dokumente/opcua-asyncio, configfile: pytest.ini, testpaths: tests plugins: mock-3.10.0, asyncio-0.20.3, cov-4.0.0 asyncio: mode=strict collected 581 items tests/test_callback_service.py . [ 0%] tests/test_client.py FFFF.FFFF [ 1%] tests/test_common.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 21%] FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF. [ 31%] tests/test_connections.py FF [ 31%] tests/test_crypto_connect.py FFFFFFFFssFFFFFFFFFFFFFF. [ 36%] tests/test_custom_structures.py ..FFFsFFFF..FFFFFFFFFsFF [ 40%] tests/test_ha_client.py FFFFFFFFFFFFFFFF [ 43%] tests/test_history.py FFFFFFFFFFFFFFFFFFFFFFFF [ 47%] tests/test_history_events.py FFFFFFFFFFFFFFFFFF [ 50%] tests/test_history_limits.py FFFFFF [ 51%] tests/test_permissions.py FFF [ 51%] tests/test_server.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FFFF [ 59%] tests/test_standard_address_space.py s [ 59%] tests/test_subscriptions.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF. [ 72%] tests/test_sync.py ............. [ 74%] tests/test_tools.py FF [ 74%] tests/test_uaerrors.py ... [ 75%] tests/test_uautils.py . [ 75%] tests/test_unit.py ................................................................ [ 86%] tests/test_xml.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [100%] ================================================================== FAILURES =================================================================== _____________________________________________________________ test_service_fault ______________________________________________________________ server = <async_generator object server at 0x7f09ca3f41c0>, admin_client = <async_generator object admin_client at 0x7f09c7ed0640> async def test_service_fault(server, admin_client): request = ua.ReadRequest() request.TypeId = ua.FourByteNodeId(999) # bad type! with pytest.raises(ua.UaStatusCodeError): > await admin_client.uaclient.protocol.send_request(request) E AttributeError: 'async_generator' object has no attribute 'uaclient' tests/test_client.py:17: AttributeError ___________________________________________________________ test_objects_anonymous ____________________________________________________________ server = <async_generator object server at 0x7f09ca3f41c0>, client = <async_generator object client at 0x7f09c6ab4240> async def test_objects_anonymous(server, client): > objects = client.nodes.objects E AttributeError: 'async_generator' object has no attribute 'nodes' .. alot more errors like this .. FAILED tests/test_xml.py::test_xml_byte[server] - AttributeError: 'async_generator' object has no attribute 'opc' FAILED tests/test_xml.py::test_xml_required_models_fail[server] - AttributeError: 'async_generator' object has no attribute 'opc' FAILED tests/test_xml.py::test_xml_required_models_pass[server] - AttributeError: 'async_generator' object has no attribute 'opc' =========================================== 485 failed, 91 passed, 5 skipped, 14 warnings in 55.78s =========================================== Any ideas? I installed dev_requirements.txt and requirements.txt. Running tests on current master.
Tests are broken?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1160/comments
7
2022-12-28T23:07:26Z
2023-01-15T09:47:32Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1160
1,513,227,781
1,160
[ "FreeOpcUa", "opcua-asyncio" ]
I tried to run the tests at the recent master branch and got import errors in 2 different tests. Is this something special in my configuration or is it broken for all? `~/Dokumente/opcua-asyncio$ ./run-tests.sh ======================== test session starts ========================= platform linux -- Python 3.10.6, pytest-7.2.0, pluggy-1.0.0 rootdir: /home/ralf/Dokumente/opcua-asyncio, configfile: pytest.ini, testpaths: tests collected 490 items / 2 errors =============================== ERRORS =============================== ______________ ERROR collecting tests/test_ha_client.py ______________ ImportError while importing test module '/home/ralf/Dokumente/opcua-asyncio/tests/test_ha_client.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.10/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_ha_client.py:17: in <module> from .test_subscriptions import MySubHandler tests/test_subscriptions.py:6: in <module> from asynctest import CoroutineMock E ModuleNotFoundError: No module named 'asynctest' ____________ ERROR collecting tests/test_subscriptions.py ____________ ImportError while importing test module '/home/ralf/Dokumente/opcua-asyncio/tests/test_subscriptions.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.10/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_subscriptions.py:6: in <module> from asynctest import CoroutineMock E ModuleNotFoundError: No module named 'asynctest' `
./run_tests.sh does not run
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1159/comments
1
2022-12-28T22:48:07Z
2022-12-28T22:51:56Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1159
1,513,218,619
1,159
[ "FreeOpcUa", "opcua-asyncio" ]
I have a question regarding DateTime encoding. It arose when I tried to use `datetime.min` as a StartTime param in HistoryRead request. The OPC server to which I send that request could not handle encoded negative value correctly. According to the [spec](https://reference.opcfoundation.org/Core/Part6/v105/docs/5.2.2.5): > A date/time value is encoded as 0 if either > The value is equal to or earlier than 1601-01-01 12:00AM UTC. > The value is the earliest date that can be represented with the [DevelopmentPlatform](https://reference.opcfoundation.org/search/206?t=DevelopmentPlatform)’s encoding. > A date/time is encoded as the maximum value for an [Int64](https://reference.opcfoundation.org/search/206?t=Int64) if either > The value is equal to or greater than 9999-12-31 11:59:59PM UTC, > The value is the latest date that can be represented with the [DevelopmentPlatform](https://reference.opcfoundation.org/search/206?t=DevelopmentPlatform)’s encoding. If I understand correctly, spec says that valid Int64 values for encoded DateTime are non-negative: [0, 1, ... 2650467743989999999] and MaxInt64=2^63-1. 2650467743989999999 stands for datetime(9999, 12, 31, 23, 59, 58, 999999900ns) - the last represantable OPC DateTime before 9999-12-31 11:59:59PM UTC. The [datetime_to_win_epoch](https://github.com/FreeOpcUa/opcua-asyncio/blob/bb03fed7eaef4eedb43bc078b72e740c7982e653/asyncua/ua/uatypes.py#L167) function does not seem to perform that clamping: ``` python # correct, all zeros >>> asyncua.ua.ua_binary.Primitives.DateTime.pack(datetime(1601, 1, 1)) b'\x00\x00\x00\x00\x00\x00\x00\x00' # incorrect, should be all zeros b'\x00\x00\x00\x00\x00\x00\x00\x00'. We get negative number instead. >>> asyncua.ua.ua_binary.Primitives.DateTime.pack(datetime.min) # datetime.min is 0001-01-01 which is before 1601-01-01 b'\x00\x00\x89\xdd\xe81\xfe\xf8' # incorrect, should be b'\xff\xff\xff\xff\xff\xff\xff\x7f' as struct.pack('<q', 2**63-1) >>> asyncua.ua.ua_binary.Primitives.DateTime.pack(datetime(9999, 12, 31, 23, 59, 59)) b"\x80\xa9'\xd1^Z\xc8$" ``` Is this an issue?
DateTime encoding
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1155/comments
0
2022-12-21T11:38:25Z
2023-02-26T11:23:51Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1155
1,506,165,981
1,155
[ "FreeOpcUa", "opcua-asyncio" ]
Hi! When i try to run client_minimal_auth.py I get this error in function browse_node: File "C:\Users\unreg\AppData\Local\Programs\Python\Python311\Lib\enum.py", line 1111, in __new__ raise ve_exc ValueError: 26 is not a valid VariantType How i can fix it? Thanks! ua-server Prosys Sim Server
ValueError: 26 is not a valid VariantType
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1152/comments
3
2022-12-20T13:03:26Z
2023-02-26T11:24:19Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1152
1,504,527,366
1,152
[ "FreeOpcUa", "opcua-asyncio" ]
OPC UA Programs can be thought of like OPC UA Methods, used when it would not make sense to block control flow after invoking a long running task. For example, something like "TurnLightOn" could be a method while something like "MoveJointToHomePosition" could be a program. Like methods, they can be invoked by a client, but unlike methods they can also be managed by a client, e.g, to suspend it or monitor progress. Unified Automation defines them here: https://documentation.unified-automation.com/uasdknet/2.5.7/html/L2UaPrograms.html Their behaviour is defined by a Program Finite State Machine (PFSM). This is not yet implemented in asyncua (see below). https://github.com/FreeOpcUa/opcua-asyncio/blob/bb03fed7eaef4eedb43bc078b72e740c7982e653/asyncua/common/statemachine.py#L9 Is there any work being done to implement PFSM in asyncua? And would it be possible to add an api to the Nodes to easily create programs, in a similar way to how we create methods? Maybe something like (using rclpy ROS2 Actions as an API inspiration) ```python #server.py async def move_joint_to_home_position(ctx: ServerProgramHandle, limit_speed: bool) -> bool: while true: #interact with hardware to invoke behaviour #read back from hardware to see if done or fault #check ctx to see if client has requested suspend or hault #send feedback back to client using ctx #break from the loop if done return true server = Server() #init and setup server and namespace ... objects = server.nodes.objects await objects.add_folder(idx, "myEmptyFolder") myobj = await objects.add_object(idx, "MyObject") await myobj.add_program(idx, "move_home", move_joint_to_home_position, [ua.VariantType.Bool], [ua.VariantType.Bool]) ``` This will work in a similar way to creating a method with an async function, but the server owns a state machine that represents the methods state. The client could work in a similar way to invoking methods, but with some extra functionality ```python #client.py #Setup client ... handle: ClientProgramHandle= await client.nodes.objects.start_program(f"{nsidx}:myEmptyFolder:MyObject:move_home", true) while not handle.is_in_terminal_state(): print(handle.read_feedback()) if handle.has_result() res: bool = handle.result() ```
Support for OPC UA Programs
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1149/comments
4
2022-12-19T13:26:07Z
2023-03-29T12:42:11Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1149
1,502,954,188
1,149
[ "FreeOpcUa", "opcua-asyncio" ]
--- **Describe the bug** <br /> I tried to connect to a machine which needs Basic256Sha256 and SignAndEncrypt as security settings. I've generated my private key and the certificate using the following commands `openssl genrsa -out key.pem 2048` `openssl.exe req -x509 -days 365 -new -out certificate.pem -key key.pem -config ssl.conf` This is the code I am running ``` import logging import asyncio from asyncua import Client url = "opc.tcp://192.168.1.24:4840" async def main(): client = Client(url) client.set_user("the_username") client.set_password("the_password") await client.load_client_certificate("cert.pem") await client.load_private_key("key.pem") await client.set_security_string("Basic256Sha256,SignAndEncrypt,cert.pem,key.pem") client.session_timeout = 2000 client.application_uri = "urn:opcua:python:server" async with client: print("async") root = client.nodes.root print(f"root -> {root}") objects = client.nodes.objects while True: print("childs og objects are: ", await objects.get_children()) await asyncio.sleep(1) if __name__ == "__main__": logging.basicConfig(level=logging.WARN) asyncio.run(main()) ``` This is the traceback ``` (venv) PS D:\workspace\opcua_test> python.exe .\main.py WARNING:asyncua.uaprotocol:updating client limits to: TransportLimits(max_recv_buffer=65536, max_send_buffer=65536, max_chunk_count=256, max_message_size=16777216) Traceback (most recent call last): File "D:\workspace\opcua_test\main.py", line 33, in <module> asyncio.run(main()) File "C:\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "D:\workspace\opcua_test\main.py", line 16, in main await client.set_security_string("Basic256Sha256,SignAndEncrypt,cert.pem,key.pem") File "D:\workspace\opcua_test\venv\lib\site-packages\asyncua\client\client.py", line 167, in set_security_string return await self.set_security( File "D:\workspace\opcua_test\venv\lib\site-packages\asyncua\client\client.py", line 197, in set_security server_certificate = uacrypto.x509_from_der(endpoint.ServerCertificate) File "D:\workspace\opcua_test\venv\lib\site-packages\asyncua\crypto\uacrypto.py", line 37, in x509_from_der return x509.load_der_x509_certificate(data, default_backend()) File "D:\workspace\opcua_test\venv\lib\site-packages\cryptography\x509\base.py", line 528, in load_der_x509_certificate return rust_x509.load_der_x509_certificate(data) ValueError: error parsing asn1 value: ParseError { kind: ExtraData } ``` I've also tried using the certificate and the private key generated by UaExpert but it's the same. **Version**<br /> Python-Version: 3.10.6 opcua-asyncio Version: 1.0.1
ValueError: error parsing asn1 value: ParseError { kind: ExtraData }
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1148/comments
3
2022-12-16T14:15:12Z
2022-12-29T09:03:42Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1148
1,500,304,208
1,148
[ "FreeOpcUa", "opcua-asyncio" ]
**Describe the bug** <br /> I wanted to change a variable node writable atribute in order to be writable or not depending on some criteria. However, using the set_writable(False) function does nothing and I am able to change the variable value both inside the server and using an external client. The only thing that works well is using different roles (admin/user) for every variable node in the server. **To Reproduce**<br /> myvar = await dsObj.add_variable("ns=%d;i=%d" %(idx, varIdCnt), varname, 0, varianttype=uatypee , datatype= None) await myvar.set_writable(False) **Expected behavior**<br /> I would expect a variable node not to be writable using an external client. **Version**<br /> Python Version: 3.9.12 opcua-asyncio Version: (master branch, 1.0)
Function set_writable() seems not to be working
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1147/comments
7
2022-12-15T12:44:35Z
2023-03-29T12:42:05Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1147
1,498,369,526
1,147
[ "FreeOpcUa", "opcua-asyncio" ]
### Hi, i have a server and at least 2 clients. I found out how to log which client is trying to connect to my server `class UserManager:` def __init__(self, log_queue: Queue): self.logger = QueueLogger("connections", log_queue) self.users = [] def get_user(self, iserver: InternalServer, username=None, password=None, certificate=None) -> User: if username and iserver.allow_remote_admin and username in ("admin", "Admin"): user = User(role=UserRole.Admin) else: user = User(role=UserRole.User) user.name = username self.users.append(user) self.logger.warning(f"New user has been connected: {user.name}, {user.role}") return user Also, I found out how to get data changes notifications `class SubHandler:` def __init__(self, sub_queue): self.logger = QueueLogger('nodes', sub_queue) def datachange_notification(self, node, val, data): var = f'ns={node.nodeid.NamespaceIndex};s={node.nodeid.Identifier}' self.logger.info(var + ' = ' + str(val)) now I want to log on server side variable change with the name of client who did the change --- _**The problem is**:_ I can't get any info about variable change source Thanks in advance --- Python-Version:<br /> 3.9 opcua-asyncio Version :<br /> 1.0.1
Logging: How to log data changes by client in server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1146/comments
8
2022-12-09T16:28:52Z
2023-03-29T12:41:39Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1146
1,487,038,761
1,146