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" ]
Is there a way to know if the connection is still active? I tried with `send_hello` but when I send that message, the connection drops after a while. (wondering why) Is there any way? will make sense to have that functionality?
How can I know if the connection is still active?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/155/comments
4
2020-02-26T11:40:40Z
2021-10-27T10:03:12Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/155
571,274,426
155
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, Can you tell me more about the release schedule? The last release was 1 and half month ago and there are some changes that I need to incorporate in my project. I want to know if you plan to release often or not. If not, I will have to fork this repo and go from that.
Release schedule
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/152/comments
1
2020-02-20T18:59:35Z
2020-02-20T19:01:40Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/152
568,504,136
152
[ "FreeOpcUa", "opcua-asyncio" ]
Read History method is returning the wrong values. In this example, I'm trying to get values that may not be stored (server only stores 20 minutes or so): `tools/uahistoryread -u "opc.tcp://opcuaserver.com:48010" -n "ns=2;s=Demo.History.ByteWithHistory" --starttime "2020-02-20 11:04:00" --endtime "2020-02-20 11:06:00"` Returns: ``` Reading raw history of node Node(StringNodeId(ns=2;s=Demo.History.ByteWithHistory)) at opc.tcp://opcuaserver.com:48010; start at 2020-02-20 11:04:00, end at 2020-02-20 11:06:00 Source timestamp Status Value 2020-02-20 11:46:42.369854 Good 219 ``` We can see that the result returned is not in the provided range. If we go to the last year: `tools/uahistoryread -u "opc.tcp://opcuaserver.com:48010" -n "ns=2;s=Demo.History.ByteWithHistory" --starttime "2019-02-20 11:04:00" --endtime "2019-02-20 11:06:00` The response: ``` Reading raw history of node Node(StringNodeId(ns=2;s=Demo.History.ByteWithHistory)) at opc.tcp://opcuaserver.com:48010; start at 2019-02-20 11:04:00, end at 2019-02-20 11:06:00 Source timestamp Status Value 2020-02-20 11:48:21.366575 Good 152 ``` What I think is happening is that when no value is in the provided range, the return value is always the oldest data point. Now, let's try to get 2 seconds of data: `tools/uahistoryread -u "opc.tcp://opcuaserver.com:48010" -n "ns=2;s=Demo.History.ByteWithHistory" --starttime "2020-02-20 12:08:58" --endtime "2020-02-20 12:09:00"` ``` Reading raw history of node Node(StringNodeId(ns=2;s=Demo.History.ByteWithHistory)) at opc.tcp://opcuaserver.com:48010; start at 2020-02-20 12:08:58, end at 2020-02-20 12:09:00 Source timestamp Status Value 2020-02-20 12:08:57.520751 Good 2 2020-02-20 12:08:58.020752 Good 34 2020-02-20 12:08:58.520732 Good 66 2020-02-20 12:08:59.037920 Good 99 2020-02-20 12:08:59.537918 Good 131 2020-02-20 12:09:00.037912 Good 163 ``` The resolution is not correct, as we can see, the first and last value are not in the provided range.
Read History Raw is displaying wrong information
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/151/comments
5
2020-02-20T12:17:01Z
2023-03-29T08:22:41Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/151
568,260,094
151
[ "FreeOpcUa", "opcua-asyncio" ]
I tried: `uahistoryread -u "opc.tcp://opcuaserver.com:48010" -n "ns=2;s=Demo.History.ByteWithHistory" --starttime "2020-02-20 11:04" --endtime "2020-02-20 11:06"` The result: ``` Reading raw history of node Node(StringNodeId(ns=2;s=Demo.History.ByteWithHistory)) at opc.tcp://opcuaserver.com:48010; start at 2020-02-20 11:04:00, end at 2020-02-20 11:06:00 Source timestamp Status Value [...]Traceback[...] TypeError: 'coroutine' object is not iterable sys:1: RuntimeWarning: coroutine 'Node.read_raw_history' was never awaited ``` I will try to fix it and make a PR.
uahistory read does not work
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/149/comments
3
2020-02-20T11:09:22Z
2020-02-20T19:02:00Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/149
568,223,704
149
[ "FreeOpcUa", "opcua-asyncio" ]
The disconnect method of the sync Client is obvioulsy broken. When calling disconnect, I'm getting the following exception: 2020-02-17 10:00:17.626 Thread-10 - client - INFO - disconnect 2020-02-17 10:00:17.626 Thread-10 - ua_client - INFO - Request to close socket received 2020-02-17 10:00:17.626 Thread-10 - ua_client - INFO - Socket has closed connection Traceback (most recent call last): File "C:\Users\krumm-ti\PycharmProjects\LabMonitor\views\mainwindow.py", line 187, in closeEvent OpcClient.inst().disconnect() File "C:\Users\krumm-ti\PycharmProjects\LabMonitor\opc_client.py", line 170, in disconnect self._client.disconnect() File "C:\Users\krumm-ti\PycharmProjects\LabMonitor\venv\lib\site-packages\asyncua\sync.py", line 116, in disconnect self.tloop.post(self.aio_obj.disconnect()) File "C:\Users\krumm-ti\PycharmProjects\LabMonitor\venv\lib\site-packages\asyncua\sync.py", line 49, in post return futur.result() File "C:\Users\krumm-ti\AppData\Local\Programs\Python\Python37-32\lib\concurrent\futures\_base.py", line 423, in result raise CancelledError() concurrent.futures._base.CancelledError Minimal example: `from asyncua.sync import Client client = Client( "your uri here") client.connect() client.disconnect()` Can you please check what causes this? I wasn't able to figure it out by myself.
Exception when trying to disconnect from the server with sync client.
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/146/comments
6
2020-02-17T09:10:15Z
2020-02-19T09:30:59Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/146
566,156,016
146
[ "FreeOpcUa", "opcua-asyncio" ]
Would it be possible to expose the `timeout` parameter in the function `UASocketProtocol.send_request` to higher-level functions, such as `UaClient.call()`? Currently, if I call `Node.call_method()` the timeout will always be 10 seconds. In my work we have to communicate with a single-threaded simulator with built-in OPC-UA server, which causes the server to block during complex simulation steps, so I needed to increase the timeout. Should `timeout` be available from `Node.call_method()` for instance, or is there a better way of achieving a configurable timeout for these operations? Thanks in advance
Client timeout on node.call_method()
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/141/comments
10
2020-02-06T08:09:49Z
2020-09-18T11:30:41Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/141
560,845,394
141
[ "FreeOpcUa", "opcua-asyncio" ]
I am using the code in the [client-subscription.py](https://github.com/FreeOpcUa/opcua-asyncio/blob/master/examples/client-subscription.py). I want to watch change values in a forever loop. Is that a bad design pattern ? If yes then how should I watch event changes for infinite time.
Subscibing to change events forever
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/139/comments
6
2020-02-05T07:55:13Z
2020-02-11T18:26:29Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/139
560,200,206
139
[ "FreeOpcUa", "opcua-asyncio" ]
I'm restricted to use the client token policy `Basic256Sha256` to be able to authenticate by username and password. How can I do that?
configure client token policy to Basic256Sha256
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/137/comments
1
2020-01-31T08:10:16Z
2023-03-29T08:21:44Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/137
557,978,200
137
[ "FreeOpcUa", "opcua-asyncio" ]
What would be the appropriate way to update a variable on an interval using the server? I have a few weather api calls that I'd like to update on the server. `w_wind_speed = await myobj.add_variable(idx, 'Wind Speed', wind_speed)` I'd like these values to be updated by the server every x seconds for consumption. Is there a "best practice" way to do this? Any help would be great.
Server update variable
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/135/comments
19
2020-01-27T17:50:51Z
2021-03-11T14:35:52Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/135
555,734,310
135
[ "FreeOpcUa", "opcua-asyncio" ]
Ahoi, just wanted to ask if `self.value_callback` shall be a possibility to add (lambda) functions or coroutines as callback, in case of an AttributeValue request? If yes, is there a clean way to add them in anywhere? ``` class AttributeValue(object): def __init__(self, value): self.value = value self.value_callback = None self.datachange_callbacks = {} def __str__(self): return f"AttributeValue({self.value})" __repr__ = __str__ ```
self.value_callback - for AttributeValue requests? And how to add them?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/134/comments
4
2020-01-23T14:45:03Z
2020-12-15T08:00:16Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/134
554,202,477
134
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, first of all, thanks for the library. It seems really good in my first days studying it. I have one question. Is it possible to retrieve the tree of objects of a server? Without getting children recursively, of course.
Get Tree of objects
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/133/comments
4
2020-01-22T15:12:38Z
2020-12-15T07:55:44Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/133
553,606,012
133
[ "FreeOpcUa", "opcua-asyncio" ]
Hi there, Does anyone knows how to exchange certificate between Client and Server. What I need is to get the certificate of Client and save it on my Linux machine for Server in Trusted folder.
Certificate exchange
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/131/comments
2
2020-01-21T10:16:56Z
2023-03-29T10:05:05Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/131
552,778,361
131
[ "FreeOpcUa", "opcua-asyncio" ]
Hello together, I try to export a Server via `await server.export_xml_by_ns(path,[namespaces])` and import this xml file in another program via `await server.import_xml(path)`. It works fine with values, folders etc. (haven't tried it with events tbh), but when it comes to methods it raises this error: `asyncua.ua.uaerrors._auto.BadParentNodeIdInvalid: The parent node id does not to refer to a valid node.(BadParentNodeIdInvalid)` I know that the method should be linked to a python function again, but this doesn't seem to be the problem, does it? Am I missing something?
Ex/Import Server via XML - dealing with Methods
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/129/comments
5
2020-01-13T16:50:22Z
2020-01-15T12:19:27Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/129
549,055,253
129
[ "FreeOpcUa", "opcua-asyncio" ]
Dear, Thanks for opcua-asyncio In your examples you comment out a line such as: https://github.com/FreeOpcUa/opcua-asyncio/blob/master/examples/client-example.py Line 46 #var.read_value() # get value of node as a python builtin When connected to an OPC UA server (Beckhoff CX8091) this fuction yields: > print(var.read_value()) # get value of node as a python builtin > AttributeError: 'Node' object has no attribute 'read_value' > INFO:asyncua.client.ua_client.UASocketProtocol:Socket has closed connection var.get_value() yields the expected result instead My code snippit ``` var = client.get_node(ua.NodeId('MAIN.mynode', 4)) print(var.read_value()) # gives an error print(await var.get_value()) # works fine ```
AttributeError: 'Node' object has no attribute 'read_value'
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/123/comments
5
2020-01-06T16:07:23Z
2020-12-16T06:58:50Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/123
545,806,333
123
[ "FreeOpcUa", "opcua-asyncio" ]
null
generate_address_space is broken. It generates wrong LocalizedText constructors...
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/121/comments
0
2019-12-21T11:27:47Z
2023-03-29T08:20:54Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/121
541,316,617
121
[ "FreeOpcUa", "opcua-asyncio" ]
When running client_mininal.py example against a Milo OPCUA server with security settings off ( security mode = None e security Policy = None) I got an error on find_endpoint call: ``` packages/asyncua/client/client.py", line 87, in find_endpoint raise ua.UaError("No matching endpoints: {0}, {1}".format(security_mode, policy_uri)) asyncua.ua.uaerrors._base.UaError: No matching endpoints: 1, http://opcfoundation.org/UA/SecurityPolicy#None ``` enviroment: MacOS 10.14.6 python version: Python 3.7.4 Any hints on what is wrong? code :[client_minimal.py.zip](https://github.com/FreeOpcUa/opcua-asyncio/files/3985820/client_minimal.py.zip) ``` import asyncio import sys sys.path.insert(0, "..") import logging from asyncua import Client, Node, ua logging.basicConfig(level=logging.DEBUG) _logger = logging.getLogger('asyncua') async def main(): url = 'opc.tcp://54.233.228.202:9000/wits-comgas/' async with Client(url=url) as client: await client.connect() if __name__ == '__main__': loop = asyncio.get_event_loop() loop.set_debug(True) loop.run_until_complete(main()) loop.close() ``` below are the log (mode = DEBUG) ``` Alexandres-MacBook-Pro:~ apenna$ /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 "/Users/apenna/Shared Folder Win10/comgas/client_minimal.py" DEBUG:asyncio:Using selector: KqueueSelector INFO:asyncua.client.client:connect INFO:asyncua.client.ua_client.UaClient:opening connection DEBUG:asyncio:connect <socket.socket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('0.0.0.0', 0)> to ('54.233.228.202', 9000) DEBUG:asyncio:poll took 29.096 ms: 1 events DEBUG:asyncio:<socket.socket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.125.105', 63763), raddr=('54.233.228.202', 9000)> connected to 54.233.228.202:9000: (<_SelectorSocketTransport fd=7 read=polling write=<idle, bufsize=0>>, <asyncua.client.ua_client.UASocketProtocol object at 0x106340090>) DEBUG:asyncio:poll 3999.081 ms took 27.307 ms: 1 events INFO:asyncua.client.ua_client.UASocketProtocol:open_secure_channel DEBUG:asyncua.client.ua_client.UASocketProtocol:Sending: OpenSecureChannelRequest(TypeId:FourByteNodeId(i=446), RequestHeader:RequestHeader(AuthenticationToken:TwoByteNodeId(i=0), Timestamp:2019-12-19 21:56:11.521387, RequestHandle:1, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:1000, AdditionalHeader:ExtensionObject(TypeId:TwoByteNodeId(i=0), Encoding:0, None bytes)), Parameters:OpenSecureChannelParameters(ClientProtocolVersion:0, RequestType:0, SecurityMode:1, ClientNonce:b'', RequestedLifetime:3600000)) DEBUG:asyncio:poll 3999.790 ms took 33.287 ms: 1 events INFO:asyncua.client.ua_client.UaClient:create_session DEBUG:asyncua.client.ua_client.UASocketProtocol:Sending: CreateSessionRequest(TypeId:FourByteNodeId(i=461), RequestHeader:RequestHeader(AuthenticationToken:TwoByteNodeId(i=0), Timestamp:2019-12-19 21:56:11.561303, RequestHandle:2, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:10000, AdditionalHeader:ExtensionObject(TypeId:TwoByteNodeId(i=0), Encoding:0, None bytes)), Parameters:CreateSessionParameters(ClientDescription:ApplicationDescription(ApplicationUri:urn:freeopcua:client, ProductUri:urn:freeopcua.github.io:client, ApplicationName:LocalizedText(Encoding:2, Locale:None, Text:Pure Python Async. Client), ApplicationType:1, GatewayServerUri:None, DiscoveryProfileUri:None, DiscoveryUrls:[]), ServerUri:None, EndpointUrl:opc.tcp://54.233.228.202:9000/wits-comgas/, SessionName:Pure Python Async. Client Session1, ClientNonce:b'_(\xa4\x06\xa0i\xebu\xf2\xc3~c\xbc\xe1\xe3*"|\x07\xe4-\xb9\x0c\xafK\xddb\xa9\x82\x1c\xf1\x01', ClientCertificate:None, RequestedSessionTimeout:3600000, MaxResponseMessageSize:0)) DEBUG:asyncio:poll 9999.889 ms took 26.951 ms: 1 events DEBUG:asyncua.client.ua_client.UaClient:CreateSessionResponse(TypeId:FourByteNodeId(i=464), ResponseHeader:ResponseHeader(Timestamp:2019-12-19 21:56:11.588000, RequestHandle:2, ServiceResult:StatusCode(Good), ServiceDiagnostics:DiagnosticInfo(Encoding:0, SymbolicId:None, NamespaceURI:None, Locale:None, LocalizedText:None, AdditionalInfo:None, InnerStatusCode:None, InnerDiagnosticInfo:None), StringTable:None, AdditionalHeader:None), Parameters:CreateSessionResult(SessionId:StringNodeId(ns=1;s=Session:c1e5d8eb-bd9f-4fb7-85b7-643eec79165a), AuthenticationToken:ByteStringNodeId(b=b'\xe6\x9c\x82yg\xd6VU\xd5/\x8f[\xf2]\xfb\xe6n^\xb6\x88\x1d!\xfd\xf5`\xa3\xbf\x0cl\xf4b\xad'), RevisedSessionTimeout:120000.0, ServerNonce:b' q\x16\xf9\xd3\x88bw\x8b\xcf9\xb3\x83\x81\xcf\xd7.\xb8\xa7\x85\\\xe3\x03\x8bal2\x8a\xf4\x1e\x81\xc9', ServerCertificate:b'0\x82\x04j0\x82\x03R\xa0\x03\x02\x01\x02\x02\x06\x01m\xda;U\x0e0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x000v1$0"\x06\x03U\x04\x03\x0c\x1bEclipse Milo Example Server1\x150\x13\x06\x03U\x04\n\x0c\x0cdigitalpetri1\x0c0\n\x06\x03U\x04\x0b\x0c\x03dev1\x0f0\r\x06\x03U\x04\x07\x0c\x06Folsom1\x0b0\t\x06\x03U\x04\x08\x0c\x02CA1\x0b0\t\x06\x03U\x04\x06\x13\x02US0\x1e\x17\r191017000000Z\x17\r221017000000Z0v1$0"\x06\x03U\x04\x03\x0c\x1bEclipse Milo Example Server1\x150\x13\x06\x03U\x04\n\x0c\x0cdigitalpetri1\x0c0\n\x06\x03U\x04\x0b\x0c\x03dev1\x0f0\r\x06\x03U\x04\x07\x0c\x06Folsom1\x0b0\t\x06\x03U\x04\x08\x0c\x02CA1\x0b0\t\x06\x03U\x04\x06\x13\x02US0\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\x95\xc1\xeb\x8f4\xc6\xeeO\x12\x08\x85\xad\x11\x7f\x8a\xba\x1f\x81\xa9e\xe2\xa1\xa9b\xdb\x94`\xd5\xf0a\xa2\xc0C\xc2\xd2\xf8/L$m\xbc_\xc9\xe6\xf3\x0f\xd7\xc8\x7f\xe4\x91C\xe9\xf6r>\xb2\xbc\x01\x9f:i=4N+\xab\xee\xddo\xc3\x13>\xdc\xechef\xde\xfd\xd0\xf6\xd3\x8dF\xbej\xf7\xebWP@\xeef\x84\x80\x7fJ\xce\xd8"V\x8c\xd3\xa2\x1cq\xf4b\xef\x00n\xe8&\x88\xf4"\x1dMS\x94\x8c\xffZ\xc3n\xe2}\x05\x92I"\xa7\x88\x8b\x13~\x81J\x8cS\x89\xe6\x16\x0f\xeaZ\xbd\xd6\xec\xb5\x07\xe4\tA\x1d\xd3\x89\x0f\x04\xeb\xb4N\x82_\xd6T\x9a[D\x8aWi\x9d\xcd\x0c\xbf^\xf9\x80<\x08\x8aM\x1ex=dR\x11\xecIht}EX%\x9dAf\xd9p\x9f\xb4%\xa3\x04L\xb9\x07C\x07FI\xca\xb5\x0b\xcc\xee\x9b\x83\x1a\x164\x98\xb3U\x14\x91i\x80\xb9U{(\xc4\x14\xda\xea\xe7\xd8S\xf99\xfa\xe8\xe1\xff\x9f\xbb\xd9g\x8d\xac\xd7\x02\x03\x01\x00\x01\xa3\x81\xfd0\x81\xfa0\x1f\x06\x03U\x1d#\x04\x180\x16\x80\x14\x16\x8d\x13\xdcF\x1a5*N\xaf\xa7\x8d?\xe7\x1d\xe3_\x91u\xe50\x0c\x06\x03U\x1d\x13\x04\x050\x03\x01\x01\xff0\x0b\x06\x03U\x1d\x0f\x04\x04\x03\x02\x02\xfc0\x1d\x06\x03U\x1d%\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x02\x06\x08+\x06\x01\x05\x05\x07\x03\x010~\x06\x03U\x1d\x11\x04w0u\x86Eurn:eclipse:milo:examples:server:be467060-14a8-46ab-9c2d-2cb37627c1eb\x82&root_adapter-opc-comgas_1.root_default\x87\x04\xac\x13\x00\x140\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\x16\x8d\x13\xdcF\x1a5*N\xaf\xa7\x8d?\xe7\x1d\xe3_\x91u\xe50\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\x00\x03\x82\x01\x01\x00mJ\x1f\r\xf5U\x8aH\xef&{\xectn3\xd6%=\x85Uzg\x1d\xcf\xafShJ\xc2\x88\xc7\xec,\xa0\x1c\xa2\x8e\x7f\xe5\xcez\xee\x98jy\n\xfb..\x01\x1e\xfcN\x98\rd\xdaXh6\xb5\xa1<\xd0\xc2\x99<\xd4\xadZ7\xb0\xc8W\x97T\x1dRI\xb7\x89\xcc\x04\x9c\xf4\x13p\xf5c\xb5\xee\'y\xbe\t\x11\x7f\xc4\x12#\xaf9!~\xeb\xb7ji\x10\xach\x07\xc1\xa2rp^ZA\xa4h3\x91\x91L\xcf?X\xa5|d+\xcc\xd6[$lS\xb9S\x833\xc3\x03\xcbZ\xc8\xc7\xed\x04\xd6\x94\xf8#_\x16\x1f\x97\x87\xb4\x19\xe4e1\x9d\xc57\xfc\xa5\xcb\xc8b\xdb\x93\x8d\x87(\x80\xb7dD\x86\xe5@]*\xbe\xec\xc5\xb7g>-\xdb\x14\x0c\xb7A@?"\x0f~\x06\xdc\x91\xc4jI>LEi\xd2\x12Kq\x87+Sh\x0b\x07|\xce\x86a@\xc4\x00\x0f\x1f\xeb\x16wOW\xbfG\xf3\x9bK\x07^C\x90PU6\xf6\xd3c\xd9X\x94\xcf', ServerEndpoints:[], ServerSoftwareCertificates:[], ServerSignature:SignatureData(Algorithm:None, Signature:None), MaxRequestMessageSize:2097152)) INFO:asyncua.client.client:find_endpoint [] <MessageSecurityMode.None_: 1> 'http://opcfoundation.org/UA/SecurityPolicy#None' 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 "/Users/apenna/Shared Folder Win10/comgas/client_minimal.py", line 39, in <module> loop.run_until_complete(main()) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete return future.result() File "/Users/apenna/Shared Folder Win10/comgas/client_minimal.py", line 14, in main async with Client(url=url) as client: File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/asyncua/client/client.py", line 68, in __aenter__ await self.connect() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/asyncua/client/client.py", line 210, in connect await self.create_session() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/asyncua/client/client.py", line 342, in create_session ep = Client.find_endpoint(response.ServerEndpoints, self.security_policy.Mode, self.security_policy.URI) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/asyncua/client/client.py", line 87, in find_endpoint raise ua.UaError("No matching endpoints: {0}, {1}".format(security_mode, policy_uri)) asyncua.ua.uaerrors._base.UaError: No matching endpoints: 1, http://opcfoundation.org/UA/SecurityPolicy#None ```
Error on find_endpoint client call against a Milo OPC-UA server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/119/comments
3
2019-12-19T22:07:03Z
2023-04-22T08:15:44Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/119
540,600,754
119
[ "FreeOpcUa", "opcua-asyncio" ]
We've noticed that in our production environment, where we run multiple instances (19 right now) of asyncua-based OPC UA servers, some instances enter some strange mode from which recovery is difficult. A symptom of this runaway mode is memory ballooning until the limit is reached. From the moment the issue manifests itself, the logs are blasted with the following statements, following "the session id is not valid" error: ``` 2019-12-17 15:26:46 [ERROR] asyncua.server.uaprocessor - sending service fault response: The session id is not valid. (BadSessionIdInvalid) 2019-12-17 15:31:25 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:25 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:25 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:25 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:25 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:25 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:26 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:26 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:26 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:26 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:26 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:26 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:26 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:26 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:26 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:26 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:27 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:27 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:27 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:27 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:27 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:27 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:27 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:27 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(101) > lifetime count (100) 2019-12-17 15:31:27 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(102) > lifetime count (100) 2019-12-17 15:31:27 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(102) > lifetime count (100) 2019-12-17 15:31:28 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(102) > lifetime count (100) 2019-12-17 15:31:28 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:86) has expired, publish cycle count(102) > lifetime count (100) 2019-12-17 15:31:28 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:93) has expired, publish cycle count(102) > lifetime count (100) ... ``` Sometimes, when this happens, nothing else gets logged except that statement, in the thousands. The above log goes on to "publish cycle count" 2320 and beyond: ``` 2019-12-17 17:01:16 [WARNING] asyncua.server.internal_subscription - Subscription Subscription(id:101) has expired, publish cycle count(2320) > lifetime count (100) ``` We've noticed serious connectivity issues on the production network, which seem to trigger this phenomenon. The "The session id is not valid" error indicates an OPC UA client is reconnecting on account of a connectivity dropout. Any ideas what might happen here at the subscription level from the perspective of the asyncua library?
Memory balloons after "Subscription Subscription(id:<id>) has expired."
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/116/comments
13
2019-12-17T17:45:21Z
2024-06-20T13:12:01Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/116
539,216,828
116
[ "FreeOpcUa", "opcua-asyncio" ]
Hi guys, I found a big problem with all the written tests. After each test we are deleting the subscriptions, but we leave the nodes and the eventgenerator at the server. Therefore we have some unexpected behavior. While a later test we got all nodes and everything expect the subscriptions of the previous tests. Here is one example: async def test_events_default(opc): evgen = await opc.server.get_event_generator() myhandler = MySubHandler() sub = await opc.opc.create_subscription(100, myhandler) handle = await sub.subscribe_events() tid = datetime.utcnow() msg = "this is my msg " evgen.trigger(tid, msg) ev = await myhandler.result() assert ev is not None # we did not receive event assert ua.NodeId(ua.ObjectIds.BaseEventType) == ev.EventType assert 1 == ev.Severity assert (await opc.opc.get_server_node().get_browse_name()).Name == ev.SourceName assert opc.opc.get_server_node().nodeid == ev.SourceNode assert msg == ev.Message.Text assert tid == ev.Time await sub.unsubscribe(handle) await sub.delete() After this test the server keeps to emit the BaseEvent which effects the later tests. Correct code would be: ``` async def test_events_default(opc): evgen = await opc.server.get_event_generator() myhandler = MySubHandler() sub = await opc.opc.create_subscription(100, myhandler) handle = await sub.subscribe_events() tid = datetime.utcnow() msg = "this is my msg " evgen.trigger(tid, msg) ev = await myhandler.result() assert ev is not None # we did not receive event assert ua.NodeId(ua.ObjectIds.BaseEventType) == ev.EventType assert 1 == ev.Severity assert (await opc.opc.get_server_node().get_browse_name()).Name == ev.SourceName assert opc.opc.get_server_node().nodeid == ev.SourceNode assert msg == ev.Message.Text assert tid == ev.Time await sub.unsubscribe(handle) await sub.delete() server_node = opc.server.get_server_node() await server_node.delete_reference(2041, 41) ``` I dont want to change all tests so I search a easy way to fix that. I wonder that there are so few problems with this behavior. Maybe someone have a idea.
Faults in the test script
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/111/comments
2
2019-12-16T10:54:14Z
2019-12-16T12:30:15Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/111
538,335,878
111
[ "FreeOpcUa", "opcua-asyncio" ]
`get_node` of `asyncua.sync.Server` raises an `AttributeError` see this Stacktrace for details: ```python File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/asyncua/sync.py", line 212, in get_node return Node(self.tloop, server.Server.get_node(self, nodeid)) File "/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/asyncua/server/server.py", line 374, in get_node return Node(self.iserver.isession, nodeid) AttributeError: 'Server' object has no attribute 'iserver' ```
`get_node` of `sync.Server` is broken
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/108/comments
1
2019-12-03T09:24:13Z
2019-12-03T13:05:13Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/108
531,841,301
108
[ "FreeOpcUa", "opcua-asyncio" ]
I don't know it this is possible at all. If it is i'm not able to solve how to do it. I want to create a uamethod on the server that i call from the client (no problem). In this method i want to set a value on a node variable (problem). Is this even possible? Has combed the internet for an answer without any success. Short example with only the important bits below.The variable `variableToSet` is the var i want to set a value for **in** the uamethod `theMethod`. I know i should probably do this with the parent. But exactly how? Been printing out the parent to se what kind of info it hold's and in that way try to backward engineering it. But with no further success. ```python @uamethod def theMethod(parent, x): await variableToSet.set_value(x) <- My problem async def main(): ... objects = server.get_objects_node() variableToSet = await objects.add_variable(namespace, "theVarName", None) ``` Maybe this should be done with a subscription instead? Thanks in advance for any help and/or explanation. You guys is doing an incredible job with this.
Question: Set a object variable value from uamethod method?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/107/comments
4
2019-12-02T00:56:12Z
2019-12-04T00:34:55Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/107
530,831,035
107
[ "FreeOpcUa", "opcua-asyncio" ]
!! N00b alert !! I'm just getting into the OPC world, and one of the very first things I'm doing is to try and run a test OPC-UA server using this repo. I created a docker image with the given [Dockerfile](https://github.com/FreeOpcUa/opcua-asyncio/blob/master/Dockerfile) using: ``` docker build -t test-opc-server . ``` Then I opened a container instance with: ``` docker run --rm -it test-opc-server bash ``` Finally I ran `uaserver` within the container, and got this: ``` root@1bd3fc641716:/# uaserver Traceback (most recent call last): File "/usr/local/bin/uaserver", line 8, in <module> sys.exit(uaserver()) File "/usr/local/lib/python3.8/site-packages/asyncua/tools.py", line 546, in uaserver sync.start_thread_loop() AttributeError: module 'asyncua.sync' has no attribute 'start_thread_loop' root@1bd3fc641716:/# ``` What am I missing?
Running a test OPC-UA server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/106/comments
3
2019-11-29T18:15:23Z
2020-12-09T08:35:55Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/106
530,454,308
106
[ "FreeOpcUa", "opcua-asyncio" ]
Hi guys, I realized that the implementation of the events isn´t complete at the moment. According to the specs each event should be received if you subscribe to the server node. At the moment there is no way to implement an event hierarchy. Here is a event hierarchy from the specs: ![image](https://user-images.githubusercontent.com/38347149/69862917-d0c4a300-129b-11ea-8956-97d14bf3199a.png) I will try to implement such a behavior.
HasNotifier implementation for events
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/105/comments
3
2019-11-29T10:38:27Z
2025-02-08T17:45:33Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/105
530,275,565
105
[ "FreeOpcUa", "opcua-asyncio" ]
As discussed in #1 I have problems with some of the examples. Most of them are not updated for asyncio. E.g. `server-custom-object.py` fails with ``` Traceback (most recent call last): File "./server-custom-object.py", line 42, in <module> mycustomobj_type.add_variable(0, "var_should_be_there_after_instantiate", 1.0) # demonstrates instantiate AttributeError: 'coroutine' object has no attribute 'add_variable' sys:1: RuntimeWarning: coroutine 'Node.add_object' was never awaited sys:1: RuntimeWarning: coroutine 'Node.get_child' was never awaited sys:1: RuntimeWarning: coroutine 'Node.add_object_type' was never awaited sys:1: RuntimeWarning: coroutine 'Server.register_namespace' was never awaited ``` I used a simple environment in a Docker container like this one: ``` FROM ubuntu:18.04 RUN apt-get update && apt-get install -y python3 python3-pip git RUN pip3 install asyncua RUN git clone https://github.com/FreeOpcUa/opcua-asyncio.git WORKDIR opcua-asyncio/examples CMD ["python3", "./server-custom-object.py"] ``` Other examples that I could not get to work are: `server-callback.py`, ` server-create-custom-structures.py`, `server-enum.py`, `server-events-history.py`, `server-instantiate-object.py`, `server-ua-python-mirror.py`, `server-with-encryption.py`, `server-xmlexporter.py`. I have not tested any client examples. Am I using them wrong?
examples not working
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/103/comments
6
2019-11-25T13:26:28Z
2023-03-28T19:52:54Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/103
528,086,107
103
[ "FreeOpcUa", "opcua-asyncio" ]
I have a local opc ua server running (https://www.unified-automation.com/products/server-sdk/c-ua-server-sdk.html) and I can connect to it via ```python from asyncua import Client client = Client(url='opc.tcp://XXXX:48010') await client.connect() ``` then I navigate to the root node via ```python root = client.get_root_node() ``` when I try to get any attribute/value however e.g. via `await root.get_children()` I get an `AttributeError` ``` ~\AppData\Local\Continuum\anaconda3\envs\py37\lib\site-packages\asyncua\client\ua_client.py in _send_request(self, request, timeout, message_type) 122 self._callbackmap[self._request_id] = future 123 msg = self._connection.message_to_binary(binreq, message_type=message_type, request_id=self._request_id) --> 124 self.transport.write(msg) 125 return future 126 AttributeError: 'NoneType' object has no attribute 'write'. ``` I also tried another node on the demo server besides the root node and the same issue occurs. Can anybody point me to what I am doing wrong?
Can't access attributes and values from nodes
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/100/comments
3
2019-11-07T13:57:57Z
2021-01-14T14:14:51Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/100
519,282,612
100
[ "FreeOpcUa", "opcua-asyncio" ]
with the code : loop = asyncio.get_event_loop() loop.run_until_complete(one()) I can not add an other one hope help; tks
how can i connect more then one server use opcua-asyncio
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/99/comments
2
2019-11-06T11:38:33Z
2020-09-14T14:24:18Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/99
518,416,922
99
[ "FreeOpcUa", "opcua-asyncio" ]
Hello, I'm trying to implement Alarms & Conditions in opcua-asyncio. For that I have created a condition instance with add_object function and I saw a latency when I add a new instance in address space. For example to create 30 condition instances inheriting of `OffNormalAlarmType` it takes 4s approximately on I7 processor with 16Go RAM. And if I do the same on 2 core with 1Go it takes 70s. In my investigation I think the latency is due to `instantiate` function in `instantiate_util.py`. I'm going to try to optimize this function but I have some difficulties to do this. Do you have any suggestion to decrease the latency of `instantiate` functions or to optimize node creation ?
Latency to add object instance of object type
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/97/comments
1
2019-10-30T09:39:12Z
2020-01-07T14:23:40Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/97
514,520,192
97
[ "FreeOpcUa", "opcua-asyncio" ]
Hello, After having studied this library (very good job by the way), I don't understand why coroutines (with asyncio) are used on node access and node management functions. Indeed, these functions read or write on address space that is loaded in RAM and I think using coroutines increases latency when I create new nodes or search a node. To test my assumption I removed async declaration from node functions and I created 30 objects with 100 variables and I saw a significant latency difference between asyncio usage and non asyncio usage. Is there any particular reason to have used coroutine that I have missed ?
Questtion about asyncio usage for node management
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/96/comments
3
2019-10-24T15:40:38Z
2023-03-29T09:47:20Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/96
512,027,471
96
[ "FreeOpcUa", "opcua-asyncio" ]
@oroulet I am trying to diagnose why I am seeing a latency (~0.2s, even when I decrease the publishing interval in the client to 1ms) between when I trigger an event and when the event is received on the client side. I suspect that this is probably an acceptable latency (especially because I am running the server on a machine with low computational power), but I was digging through the server code to see if there's anything that could be done to try and drop this latency further, and I came across this section of code which appears to me to not be reached. I created this issue to ask the question about whether I am misreading it, or if it's a typo that could potentially help me trigger events faster. If it is something that should be changed, I can make a PR. The section of code I am looking at is [here](https://github.com/FreeOpcUa/opcua-asyncio/blob/08861799d3413345dcc5b4ae387427739b864bad/asyncua/server/internal_subscription.py#L60-L66). In order to enter this if statement, the subscription loop task must be running, and it is started [here](https://github.com/FreeOpcUa/opcua-asyncio/blob/08861799d3413345dcc5b4ae387427739b864bad/asyncua/server/internal_subscription.py#L50-L51). In order to start the subscription loop task, the `RevisedPublishingInterval` must be greater than 0.0. Therefore, it seems impossible that both the subscription loop task is running and the `RevisedPublishingInterval` can be less than or equal to 0.0, so `publish_results()` is not called from within `_trigger_publish`. Is it possible it is supposed to be something like this instead? (added a `not`): ```python if not self._task and self.data.RevisedPublishingInterval <= 0.0: ```
`_trigger_publish` Question
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/93/comments
2
2019-10-17T23:59:10Z
2019-10-25T17:22:25Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/93
508,779,785
93
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, Many thanks for this awesome work!!! I am new to async in python so please excuse me if my expectation does not make sense... I created a class and in the init I wanted to make the connection (once) and then in every call to a method in that class I can use the connected client to perform a node read or method call. ``` class uaClient: """Class provides high-level keywords for opcua client communication. Keywords are provided for interaction with the opcua server using freeopcua client implementation: https://github.com/FreeOpcUa/opcua-asyncio """ def __init__(self, url): """Intialize the uaClient. Sets end point url for opcua communication. """ self._namespaceIdx = 0 self._client = Client(url) asyncio.run(self._connect()) async def _connect(self): await self._client.connect() async def _disconnect(self): await self._client.disconnect() async def _getNamespaceIndex(self, uri): idx = await self._client.get_namespace_index(uri) return idx async def _getNodeValue(self, nodeId): node = self._client.get_node(f"ns={self._namespaceIdx};s={nodeId}") value = await node.get_value() return value def setNamespace(self, uri): """Set namespace index for further operations. """ self._namespaceIdx = asyncio.run( self._getNamespaceIndex(uri)) def readNodes(self, nodeId): """Read node value within the set namespace. """ value = asyncio.run( self._getNodeValue(nodeId)) if __name__ == "__main__": uac = uaClient("opc.tcp://127.0.0.1:4840") uac.setNamespace("urn:Test/OPC/") uac.readNodes("::ServerTask:VarX") ``` But I get this error on execute: RuntimeError: Task <Task pending coro=<uaClient._connect() running at e:\test\opcua.py:39> cb=[_run_until_complete_cb() at C:\Users\Python\Python37-32\lib\asyncio\base_events.py:153]> got Future <Future pending cb=[BaseSelectorEventLoop._sock_connect_done(660)()]> attached to a different loop Is there a solution to this problem?
How can I avoid connect and disconnect of client for every operation?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/88/comments
1
2019-10-03T15:34:05Z
2021-01-14T14:11:46Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/88
502,140,946
88
[ "FreeOpcUa", "opcua-asyncio" ]
Hello, In `struct_to_binary` function an AttributeError is throw with LocalizedText object that are initialized like this in standard_address_space files: `ua.Variant([('Locale', 'en'), ('Text', 'Inactive')], ua.VariantType.LocalizedText)` When I use the same way used on python-opcua it work fine: `ua.Variant(LocalizedText("Inactive"), ua.VariantType.LocalizedText)`
Attribute Error in struct_to_binary with LocalizedText
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/87/comments
1
2019-10-03T07:34:40Z
2023-03-28T19:51:54Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/87
501,901,262
87
[ "FreeOpcUa", "opcua-asyncio" ]
Title is pretty explanatory: current setup script [requires](https://github.com/FreeOpcUa/opcua-asyncio/blob/08861799d3413345dcc5b4ae387427739b864bad/setup.py#L38) `pytest-runner` on installation. But this requirement is only true if you want to run tests and is an unnecessary burden on production devices. PR would be trivial. I can immediately submit it or let team handle. Thanks.
Can we move pytest-runner requirement to tests_require instead of setup_requires?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/86/comments
4
2019-10-03T04:00:12Z
2019-10-04T00:47:57Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/86
501,837,815
86
[ "FreeOpcUa", "opcua-asyncio" ]
I got second hand report that B&R OPC-UA client (of unknown version) was unable to connect to opcua-asyncio server. UA_Connect() fails with Bad_TypeMismatch 0x80740000. The reported error was on MaxBrowseContinuationPoints that returns Variant Type Null as the value instead of the the UInt16 that was expected. The specification says "The value 0 indicates that the Server does not restrict the number of parallel continuation points the client should use." and I believe the value should be set to this instead of leaving it at null. It was confirmed, that setting the value to 0 fixes the issue. There are also other mandatory variables without value, but apparently the client did not read them or error on them.
MaxBrowseContinuationPoints null value breaks B&R client compatibility
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/85/comments
3
2019-10-02T12:47:58Z
2023-03-28T19:50:50Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/85
501,467,687
85
[ "FreeOpcUa", "opcua-asyncio" ]
Hi Guys, thanks for a great package! I'm struggling a little with the certificate handling. The server always accepts self signed certificates, shouldn't the certificates have to be moved to a trust list prior to it being trusted? And hence the client will be rejected and not able to view the server nodes? Cheers. Mitch.
Certificate handling
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/82/comments
4
2019-09-23T05:45:34Z
2020-05-11T12:32:11Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/82
496,904,885
82
[ "FreeOpcUa", "opcua-asyncio" ]
I downloaded asyncua, however when I Debug the code the message "Exception has occurred: ModuleNotFoundError" pops up. If I do pip3 list, I can see asyncua 0.5.1 has been loaded.
asyncua module not loaded
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/81/comments
2
2019-09-10T00:17:38Z
2020-09-14T14:22:41Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/81
491,385,392
81
[ "FreeOpcUa", "opcua-asyncio" ]
We've observed process memory ballooning to several GBs over time, starting from an initial 80 MB, running an asyncio OPC UA server. The process is very active doing other things as well, but as long as no OPC UA clients connect, memory stays constant. A burn-in test app was created to perform a continuous connect, write value, disconnect cycle and we can observe the memory footprint increasing slowly. I ran mem_top against the server with the following results: `refs: 18566 <class 'dict'> {1: PublishResult(SubscriptionId:78, AvailableSequenceNumbers:[1], MoreNotifications:False, Notifica 10602 <class 'dict'> {'__module__': 'asyncua.ua.object_ids', 'Null': 0, 'Boolean': 1, 'SByte': 2, 'Byte': 3, 'Int16': 4, 9282 <class 'list'> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 9281 <class 'list'> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 9280 <class 'list'> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 9279 <class 'list'> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 9278 <class 'list'> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 9277 <class 'list'> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 9276 <class 'list'> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 9275 <class 'list'> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, bytes: 295016 {'__module__': 'asyncua.ua.object_ids', 'Null': 0, 'Boolean': 1, 'SByte': 2, 'Byte': 3, 'Int16': 4, 295016 {1: PublishResult(SubscriptionId:78, AvailableSequenceNumbers:[1], MoreNotifications:False, Notifica 83656 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 83648 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 83640 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 83624 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 83616 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 83608 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 83600 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 83592 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, types: 244138 <class 'dict'> 61728 <class 'list'> 57277 <class 'asyncua.ua.uatypes.StatusCode'> 57277 <class 'asyncua.ua.uatypes.Variant'> 57276 <class 'asyncua.ua.uatypes.DataValue'> 34849 <class 'asyncua.server.address_space.AttributeValue'> 22430 <class 'asyncua.ua.uaprotocol_auto.MonitoredItemNotification'> 22356 <class 'tuple'> 12341 <class 'asyncua.ua.uatypes.NumericNodeId'> 11588 <class 'asyncua.ua.uatypes.NodeId'> ` We're still investigating this, but would like some feedback in case others have noticed similar behaviour.
Memory increases monotonically from repetitive client connects and disconnects.
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/79/comments
17
2019-08-27T07:42:53Z
2019-10-25T17:24:00Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/79
485,641,502
79
[ "FreeOpcUa", "opcua-asyncio" ]
In async.ua.uatypes at line 21 we have: `FILETIME_EPOCH_AS_DATETIME = datetime(1601, 1, 1)` I am happy to be corrected, but to me this creates what the Python documentation calls a naive datetime, that is, without time zone information, and this will return the time local to my time zone. In other words, these return different results; shouldn't the last one be used? ``` datetime(1601,1,1).timestamp() datetime(1601,1,1,tzinfo=timezone.utc).timestamp() ``` (All timestamps in the OPC UA standard are in UTC, AFAIK)
SourceTimestamp and ServerTimestamp created as naive Datetime?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/77/comments
8
2019-08-07T19:58:44Z
2023-03-29T09:46:40Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/77
478,112,586
77
[ "FreeOpcUa", "opcua-asyncio" ]
I get `RuntimeWarning: coroutine 'InternalSession.add_method_callback' was never awaited` message when using the link_method() function of server.py This works for me: async def link_method(self, node, callback): """ Link a python function to a UA method in the address space; required when a UA method has been imported to the address space via XML; the python executable must be linked manually :param node: UA method node :param callback: python function that the UA method will call """ await self.iserver.isession.add_method_callback(node.nodeid, callback)
Missing await in server.link_method
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/74/comments
1
2019-07-23T15:29:20Z
2019-08-02T14:24:50Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/74
471,766,344
74
[ "FreeOpcUa", "opcua-asyncio" ]
I've installed Python 3.7 and 3.6 but I'm not able to run the example client code from the documentation. ``` from asyncua import Client async with Client(url='opc.tcp://172.16.3.51:4840/freeopcua/server/') as client: while True: # Do something with client node = client.get_node('i=85') value = await node.get_value() ``` The Error message for Python 3.7: ``` File "test.py", line 3 async with Client(url='opc.tcp://172.16.3.51:4840/freeopcua/server/') as client: ^ SyntaxError: 'async with' outside async function ``` The Error message for Python3.6: ``` File "test.py", line 3 async with Client(url='opc.tcp://172.16.3.51:4840/freeopcua/server/') as client: ^ SyntaxError: invalid syntax ``` Is the documentation outdated or am I doing something wrong?
Syntax Error: Client examples
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/73/comments
1
2019-07-23T06:58:51Z
2019-07-23T07:37:09Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/73
471,518,476
73
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, I'm trying to implement binary/https opc-ua server by using Tornado https server. But I don't know how subscription mechanism should be processed over HTTPS that is a stateless protocol. How is processed a publish request ? How is sent a publish response ? (Maybe Websocket ?) Have you an idea about this subject ?
Subscription mechanism and Publish on binary HTTPS server ?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/72/comments
2
2019-07-18T13:28:14Z
2019-08-22T13:32:09Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/72
469,769,834
72
[ "FreeOpcUa", "opcua-asyncio" ]
Hello, I try to test history function and I use `server-datavalue-history.py` from #63 . I see in log information that the datachange notifications are never acknowledged: see attached file: [log.txt](https://github.com/FreeOpcUa/opcua-asyncio/files/3397317/log.txt) We see that `AvailableSequenceNumbers` list is growing up indefinitely with opcua-asyncio whereas a publish request with acks is generated with python-opcua Have you an idea about this issue ? N.B: I run server example without connected client.
Datachange not acknowledged in History
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/71/comments
2
2019-07-16T13:57:24Z
2019-09-02T09:51:17Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/71
468,670,723
71
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, We see a warning printed by our client, whenever our OPC UA server restarts. [WARNING] asyncua.client.ua_client.UASocketProtocol - ServiceFault from server received in response to PublishRequest Once this happens, the client's data change subscriptions no longer work. Is there any particular configuration needed in code to make the client reconnect and resubscribe again? Can we get notifications from these ServiceFaults to deal with it ourselves? Thanks for your feedback, Dann
Client reconnect behaviour?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/70/comments
5
2019-07-12T15:27:16Z
2022-07-29T11:46:23Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/70
467,474,045
70
[ "FreeOpcUa", "opcua-asyncio" ]
read and write are more explicit and are the words used by spec. so it would be better. I always regretted choosing get and set originally, but that is an incompatible API change that might make some users not really happing @cbergmiller
rename get_value to read and set_value to write?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/68/comments
4
2019-06-29T07:45:16Z
2020-09-14T14:20:08Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/68
462,277,292
68
[ "FreeOpcUa", "opcua-asyncio" ]
My application creates several driver client instances connected to the same OPC server. An issue I found migrating from `python-opcua` is that every time a client session is closed, the other connected clients would stop getting updates from their subscriptions. After digging through the code a bit, I found that the the `close_session` of the `InternalSession` method now deletes all subscriptions in the subscription service ([here](https://github.com/FreeOpcUa/opcua-asyncio/blob/master/asyncua/server/internal_session.py#L63)) rather than only the ones specific to the session. I went ahead and made a PR to fix this, and verified that my application worked as expected. Would appreciate a review! https://github.com/FreeOpcUa/opcua-asyncio/pull/66
All subscriptions on server are deleted when a client session is closed
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/67/comments
1
2019-06-26T01:27:17Z
2019-07-02T17:59:22Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/67
460,715,971
67
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, I am in the process of converting our codebase from `python-opcua`, and we rely on a feature to be able to pass in an event loop into the server from [this commit](https://github.com/FreeOpcUa/opcua-asyncio/commit/56cf68dfc51cb80418ed7a94e6b84edac2ffaabe#diff-85f90aee7fd78d5c077634c3b26eb9bd). I noticed this is not in 0.5.0. When is the next planned release?
Next planned release?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/64/comments
3
2019-06-20T18:00:22Z
2019-06-21T20:24:03Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/64
458,793,471
64
[ "FreeOpcUa", "opcua-asyncio" ]
Is there a possibility to create a subscription and await data changes (in an endless loop) instead of triggering the `datachange_notification` method in a subscription handler class?
Await datachange?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/61/comments
8
2019-06-16T20:14:44Z
2020-12-15T07:57:20Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/61
456,677,656
61
[ "FreeOpcUa", "opcua-asyncio" ]
Hello, I try do test history feature on the asyncio-server unsuccessfully. I use the `server-datavalue-history.py` example script that I modify like this: ``` import asyncio import sys sys.path.insert(0, "..") import time import math from asyncua import ua, Server from asyncua.server.history_sql import HistorySQLite async def main(): # setup our server server = Server() # Configure server to use sqlite as history database (default is a simple memory dict) server.iserver.history_manager.set_storage(HistorySQLite("my_datavalue_history.sql")) # initialize server await server.init() server.set_endpoint("opc.tcp://0.0.0.0:4840/freeopcua/server/") # setup our own namespace, not really necessary but should as spec uri = "http://examples.freeopcua.github.io" idx = await server.register_namespace(uri) # get Objects node, this is where we should put our custom stuff objects = server.get_objects_node() # populating our address space myobj = await objects.add_object(idx, "MyObject") myvar = await myobj.add_variable(idx, "MyVariable", ua.Variant(0, ua.VariantType.Double)) await myvar.set_writable() # Set MyVariable to be writable by clients print(myvar) # starting! await server.start() # enable data change history for this particular node, must be called after start since it uses subscription await server.historize_node_data_change(myvar, period=None, count=100) try: count = 0 while True: time.sleep(1) count += 0.1 await myvar.set_value(math.sin(count)) print(count) finally: # close connection, remove subscriptions, etc await server.stop() if __name__ == "__main__": loop = asyncio.get_event_loop() loop.set_debug(True) loop.run_until_complete(main()) ``` The data are never saved in sqlite3 database. Has someone already had this problem?
history data are never saved in sqlite database
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/60/comments
8
2019-06-14T14:42:32Z
2019-09-01T06:14:06Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/60
456,284,911
60
[ "FreeOpcUa", "opcua-asyncio" ]
At the moment `SecureConnection._check_incoming_chunk` checks if the `SecurityToken` that was received along a message is the current token or if it is a valid previous token. If it is an previous token than all even older tokens are removed and thus declared invalid (if there are any). I don't think this behaviour conforms to the Specification. Tokens could be removed while they still should be considered valid. From the Specification: > SecurityTokens have a finite lifetime negotiated with this Service. However, differences between the system clocks on different machines and network latencies mean that valid Messages could arrive after the token has expired. To prevent valid Messages from being discarded, the applications should do the following: > * Clients should request a new SecurityToken after 75 % of its lifetime has elapsed. This should ensure that Clients will receive the new SecurityToken before the old one actually expires. > * Servers shall use the existing SecurityToken to secure outgoing Messages until the SecurityToken expires or the Server receives a Message secured with a new SecurityToken. This should ensure that Clients do not reject Messages secured with the new SecurityToken that arrive before the Client receives the new SecurityToken. > * Clients should accept Messages secured by an expired SecurityToken for up to 25 % of the token lifetime. This should ensure that Messages sent by the Server before the token expired are not rejected because of network delays. I think we should refactor `SecureConnection` and implement the 25 % token lifetime check, after which the token is removed from the `_old_tokens` list. Invalid tokens are currently ignored and only a warning is logged. This may pose a security risk? At some point in the past an uaError was raised if an invalid token was received. Did this cause too much trouble? Maybe we should make the behaviour configurable (log warning or raise uaError).
Accept SecurityTokens for some time after they expire in SecureConnection
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/59/comments
3
2019-06-06T10:39:50Z
2019-06-07T13:15:36Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/59
452,958,668
59
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, Do you guys think that the client is production ready? :)
Question: Client, production ready?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/58/comments
5
2019-06-05T08:42:58Z
2019-06-18T09:07:55Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/58
452,380,787
58
[ "FreeOpcUa", "opcua-asyncio" ]
In case of an _Acknowledge: or an _ErrorMessage_ `_call_callback` gets always called with an message id of zero. There is no special handling of message id zero in `_call_callback` though. There will be not future to resolve or cancel with id zero in the callback map. The right thing to do may be to cancel all request futures (at least in case of a received _MessageAbort_). The correct behaviour from the OPC UA spec. has to be implemented.
Special handling message id 0 in _call_callback
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/57/comments
0
2019-06-05T06:10:41Z
2023-03-29T09:44:38Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/57
452,329,760
57
[ "FreeOpcUa", "opcua-asyncio" ]
Hi, We're using a long-running client subscription loop which connects to a SIMATIC WinCC OA server in order to log events. After several days, an error internal to the library is raised, which does not propagate to the subscriber handler. As a result, the entire process stops logging events, while the subscriber continues on its loop without a clue that something has gone wrong. We're using asyncua == 0.5.0. The entire context is guarded to facilitate a clean exit in case of trouble: ``` async with self.client: try: except: ``` Yet nothing gets through to break off the client subscription. The only output is a short trace: ``` 11:37:16 [WARNING] asyncua.uaprotocol - Received an error: MessageAbort(error:StatusCode(Good), reason:None) 11:37:16 [CRITICAL] asyncua.client.ua_client.UASocketProtocol - Received an error: MessageAbort(error:StatusCode(Good), reason:None) 11:37:16 [ERROR] asyncua.client.ua_client.UASocketProtocol - Exception raised while parsing message from server Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/asyncua/client/ua_client.py", line 69, in _process_received_data self._process_received_message(msg) File "/usr/local/lib/python3.7/site-packages/asyncua/client/ua_client.py", line 86, in _process_received_message self._call_callback(0, ua.UaStatusCodeError(msg.Error.value)) File "/usr/local/lib/python3.7/site-packages/asyncua/client/ua_client.py", line 141, in _call_callback request_id, self._callbackmap.keys())) asyncua.ua.uaerrors._base.UaError: No request found for requestid: 0, callbacks in list are dict_keys([7333, 7334]) ``` We're a bit stumped. One option on the table is to fall back to the synchronous library, as this seems very black box. The last version published seems 0.5.0 on PyPI; has there been a more recent update we can try? Your feedback would be appreciated! Kind regards, Dann
Long-running loop sees internal subscription processing error
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/56/comments
10
2019-06-04T09:22:21Z
2023-03-28T19:48:38Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/56
451,887,867
56
[ "FreeOpcUa", "opcua-asyncio" ]
_callbackmap is never emptied! it might be possible to simply remove objects after a callback is used, but isnt'it any cases where _callbackmap is reused? I am thinking at subscriptions for examples.... @cbergmiller
memory leack in UaSocketProtocol
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/55/comments
2
2019-06-03T10:13:27Z
2019-06-03T10:50:39Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/55
451,400,666
55
[ "FreeOpcUa", "opcua-asyncio" ]
https://github.com/MagicStack/uvloop @cbergmiller we should try it, especially on server it might help a lot
try and benchmark uvloop
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/54/comments
3
2019-06-02T14:46:25Z
2019-10-25T17:22:13Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/54
451,199,675
54
[ "FreeOpcUa", "opcua-asyncio" ]
I created a thread (`from threading import Thread`) for loop in order to run asyncio it with Qt. I do a lot (1000/Sec) of **asyncio.run_coroutine_threadsafe(node.setvalue(), loop)** . In some circumstances I got an error. May be it's something obvious for you guys what can be wrong? ERROR:asyncua.client.ua_client.UASocketProtocol:Exception raised while parsing message from server Traceback (most recent call last): File "C:\Users\Labuser\AppData\Local\Programs\Python\Python37-32\lib\site-packages\asyncua\client\ua_client.py", line 152, in _call_callback self._callbackmap[request_id].set_result(body) asyncio.base_futures.InvalidStateError: invalid state During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\Labuser\AppData\Local\Programs\Python\Python37-32\lib\site-packages\asyncua\client\ua_client.py", line 79, in _process_received_data self._process_received_message(msg) File "C:\Users\Labuser\AppData\Local\Programs\Python\Python37-32\lib\site-packages\asyncua\client\ua_client.py", line 93, in _process_received_message self._call_callback(msg.request_id(), msg.body()) File "C:\Users\Labuser\AppData\Local\Programs\Python\Python37-32\lib\site-packages\asyncua\client\ua_client.py", line 158, in _call_callback raise ua.UaError(f"Future for request id {request_id} is already done") asyncua.ua.uaerrors._base.UaError: Future for request id 2458 is already done
Future for request id {request_id} is already done
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/53/comments
22
2019-05-25T07:58:59Z
2020-07-14T16:48:56Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/53
448,435,821
53
[ "FreeOpcUa", "opcua-asyncio" ]
When try to use a Node that is instantiated wit a GUID type string: ```python var = client.get_node("ns=4;g=35d5f86f-2777-4550-9d48-b098f5ee285c") ``` an exception is raised when it is converted to binary: ``` Traceback (most recent call last): File "client-minimal.py", line 30, in main print("My variable", var, await var.get_value()) File "..\asyncua\common\node.py", line 164, in get_value result = await self.get_data_value() File "..\asyncua\common\node.py", line 173, in get_data_value return await self.get_attribute(ua.AttributeIds.Value) File "..\asyncua\common\node.py", line 284, in get_attribute result = await self.server.read(params) File "..\asyncua\client\ua_client.py", line 343, in read data = await self.protocol.send_request(request) File "..\asyncua\client\ua_client.py", line 134, in send_request self._send_request(request, timeout, message_type), File "..\asyncua\client\ua_client.py", line 114, in _send_request binreq = struct_to_binary(request) File "..\asyncua\ua\ua_binary.py", line 246, in struct_to_binary packet.append(to_binary(uatype, val)) File "..\asyncua\ua\ua_binary.py", line 269, in to_binary return struct_to_binary(val) File "..\asyncua\ua\ua_binary.py", line 241, in struct_to_binary packet.append(list_to_binary(uatype[6:], val)) File "..\asyncua\ua\ua_binary.py", line 281, in list_to_binary pack = [to_binary(uatype, el) for el in val] File "..\asyncua\ua\ua_binary.py", line 281, in <listcomp> pack = [to_binary(uatype, el) for el in val] File "..\asyncua\ua\ua_binary.py", line 269, in to_binary return struct_to_binary(val) File "..\asyncua\ua\ua_binary.py", line 246, in struct_to_binary packet.append(to_binary(uatype, val)) File "..\asyncua\ua\ua_binary.py", line 259, in to_binary return pack_uatype(vtype, val) File "..\asyncua\ua\ua_binary.py", line 175, in pack_uatype return nodeid_to_binary(value) File "..\asyncua\ua\ua_binary.py", line 302, in nodeid_to_binary Primitives.Guid.pack(nodeid.Identifier) File "..\asyncua\ua\ua_binary.py", line 90, in pack f1 = Primitives.UInt32.pack(guid.time_low) AttributeError: 'str' object has no attribute 'time_low' ``` In `Node._from_string()` the uid string is used as `identifier`. I guess it should be parsed as `UUID` instance instead. A test for guid NodeIds from strings should also be added.
NodeId of type GUID that is parsed from string can't be converted to binary
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/49/comments
1
2019-05-08T12:55:38Z
2021-03-09T09:47:01Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/49
441,720,996
49
[ "FreeOpcUa", "opcua-asyncio" ]
@cbergmiller I found this one: https://github.com/FreeOpcUa/opcua-asyncio/pull/41/commits/3126dc89d5aef8a1bc62fef83bf8bea8f0fad24e This fixes one bug, BUT there is one more. If an exception is raised at that line in code, then the write call hangs forever, nothing printed in stdout and nothing is sent back to client. It looks like the exception is lost in some asyncio tasks?!?!? If you have two minutes it would be great if you could have a look.
lost exception in AttributeService.write
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/42/comments
10
2019-04-29T07:42:07Z
2019-05-15T07:57:29Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/42
438,186,525
42
[ "FreeOpcUa", "opcua-asyncio" ]
I got an error when I got a lot of nodes. This error is not necessarily happening,It may take a few more runs to happen. I have a device and thousands of nodes in my kepserver. **stack trace** ```111Node(StringNodeId(ns=2;s=Collection)) 222Node(StringNodeId(ns=2;s=Collection.ANDON1)) 333Node(StringNodeId(ns=2;s=Collection.ANDON1.alarm)) Exception raised while parsing message from server Traceback (most recent call last): File "C:\Python3\lib\site-packages\asyncua\client\ua_client.py", line 68, in _process_received_data msg = self._connection.receive_from_header_and_body(header, buf) File "C:\Python3\lib\site-packages\asyncua\common\connection.py", line 282, in receive_from_header_and_body return self._receive(chunk) File "C:\Python3\lib\site-packages\asyncua\common\connection.py", line 299, in _receive self._check_incoming_chunk(msg) File "C:\Python3\lib\site-packages\asyncua\common\connection.py", line 262, in _check_incoming_chunk .format(self._peer_sequence_number, num) asyncua.ua.uaerrors._base.UaError: Wrong sequence 518 -> 518 (server bug or replay attack) close_session was called but connection is closed close_secure_channel was called but connection is closed disconnect_socket was called but connection is closed Traceback (most recent call last): File "C:/work/async/client-minimal.py", line 31, in <module> loop.run_until_complete(main()) File "C:\Python3\lib\asyncio\base_events.py", line 484, in run_until_complete return future.result() File "C:/work/async/client-minimal.py", line 23, in main for d in await c.get_children(): File "C:\Python3\lib\asyncio\coroutines.py", line 110, in __next__ return self.gen.send(None) File "C:\Python3\lib\site-packages\asyncua\common\node.py", line 403, in get_referenced_nodes references = await self.get_references(refs, direction, nodeclassmask, includesubtypes) File "C:\Python3\lib\asyncio\coroutines.py", line 110, in __next__ return self.gen.send(None) File "C:\Python3\lib\site-packages\asyncua\common\node.py", line 382, in get_references results = await self.server.browse(params) File "C:\Python3\lib\asyncio\coroutines.py", line 110, in __next__ return self.gen.send(None) File "C:\Python3\lib\site-packages\asyncua\client\ua_client.py", line 300, in browse data = await self.protocol.send_request(request) File "C:\Python3\lib\asyncio\coroutines.py", line 110, in __next__ return self.gen.send(None) File "C:\Python3\lib\site-packages\asyncua\client\ua_client.py", line 122, in send_request await asyncio.wait_for(future, timeout if timeout else None) File "C:\Python3\lib\asyncio\tasks.py", line 362, in wait_for raise futures.TimeoutError() concurrent.futures._base.TimeoutError ```
I got an error when I got a lot of nodes asyncua.ua.uaerrors._base.UaError: Wrong sequence 518 -> 518 (server bug or replay attack)
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/40/comments
7
2019-04-28T14:36:23Z
2019-05-04T10:24:16Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/40
438,063,226
40
[ "FreeOpcUa", "opcua-asyncio" ]
Since e.g. `Subscription.subscribe_data_change()` returns a list of handles it would be nice if `Subscription.unsubscribe()` would accept this list in addition to a single handle. This requires minimal code changes. Typings for the `handle` parameters could further help to clarify the usage of the subscription handles.
Support single handle or list of handles in Subscription.unsubscribe()
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/39/comments
0
2019-04-28T11:49:25Z
2019-05-01T15:34:22Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/39
438,047,954
39
[ "FreeOpcUa", "opcua-asyncio" ]
Scrutinizer complains a lot about the code in the __init__,py files. @cbergmiller you wrote/changed them. I am not sure how they should be. Someone should find out what the best practices are... https://scrutinizer-ci.com/g/FreeOpcUa/opcua-asyncio/
need cleaner module/class import in __init__.py(s) files
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/36/comments
3
2019-04-20T15:26:48Z
2019-04-24T07:29:05Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/36
435,410,703
36
[ "FreeOpcUa", "opcua-asyncio" ]
Hi guys, I am trying to make the opcua subscription working with the code below. The code is just the same as is in the example folder. (ofcourse there are some adjustments for making it work on my hardware) But after a fixed time, approximately 10 secs it comes with the following error. When I play with the sleep (`await asyncio.sleep(10)`) time, for example putting it to 500, it keeps on running for about 8 minutes before it will show up with the same error. Is this something on my site wrong or can it be a issue/bug? ```python import time import asyncio import logging from asyncua import Client logging.basicConfig(level=logging.INFO) _logger = logging.getLogger('asyncua') import datetime 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): print("New data change event", node, val, data) def event_notification(self, event): print("New event", event) async def run(): url = "opc.tcp://192.168.150.1:4840/" try: async with Client(url=url) as client: root = client.get_root_node() _logger.info("Root node is: %r", root) objects = client.get_objects_node() _logger.info("Objects node is: %r", objects) # Node objects have methods to read and write node attributes as well as browse or populate address space _logger.info("Children of root are: %r", await root.get_children()) uri = "urn:OMRON:NxOpcUaServer:FactoryAutomation" idx = await client.get_namespace_index(uri) _logger.info("index of our namespace is %s", idx) Counter = await root.get_child(["0:Objects", f"{idx}:new_Controller_0", "3:GlobalVars", "4:Counter"]) obj = await root.get_child(["0:Objects", "4:new_Controller_0", "3:GlobalVars",]) _logger.info("myvar is: %r", Counter) handler = SubHandler() sub = await client.create_subscription(500, handler) vars = [Counter] handle = await sub.subscribe_data_change(vars) await asyncio.sleep(10) except Exception: _logger.exception('error') tijd_gestart = datetime.datetime.now() _logger.info("Time start: {}".format(tijd_gestart)) if __name__ == "__main__": loop = asyncio.get_event_loop() loop.set_debug(False) loop.run_until_complete(run()) tijd_gestopt = datetime.datetime.now() _logger.info("Tijdsduur: {}".format(tijd_gestopt-tijd_gestart)) ``` > uatypes.py ```python def check(self): """ Raises an exception if the status code is anything else than 0 (good). Use the is_good() method if you do not want an exception. """ if not self.is_good(): print("Value",self.value) raise UaStatusCodeError(self.value) ``` Python Console ============== ``` Value 2149974016 INFO:asyncua.client.ua_client.UaClient:call_publish_callback WARNING:asyncua.client.ua_client.UASocketProtocol:ServiceFault from server received while waiting for publish response ERROR:asyncio:Task exception was never retrieved future: <Task finished coro=<UaClient._call_publish_callback() done, defined at D:\projects\opc\lib\site-packages\asyncua\client\ua_client.py:468> exception=BadSessionClosed(2149974016)> Traceback (most recent call last): File "D:\projects\opc\lib\site-packages\asyncua\client\ua_client.py", line 471, in _call_publish_callback self.protocol.check_answer(data, "while waiting for publish response") File "D:\projects\opc\lib\site-packages\asyncua\client\ua_client.py", line 133, in check_answer hdr.ServiceResult.check() File "D:\projects\opc\lib\site-packages\asyncua\ua\uatypes.py", line 225, in check raise UaStatusCodeError(self.value) asyncua.ua.uaerrors._auto.BadSessionClosed: The session was closed by the client.(BadSessionClosed) 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 INFO:asyncua:Tijdsduur: 0:00:10.078220 ```
UaStatusCodeError(self.value) after a fixed time
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/33/comments
24
2019-04-17T20:41:12Z
2019-05-15T07:58:13Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/33
434,476,572
33
[ "FreeOpcUa", "opcua-asyncio" ]
I've started one of your simple server examples. I have easy access with your own provided client. I also have access with some Android Apps. If I try with the test client, provided by Bosch Rexroth, then I can't manage to get a connection to my server. https://www.boschrexroth.com/en/xc/products/product-groups/electric-drives-and-controls/industrial-iot/iot-gateway You have to scroll down to "Downloads" and download the OPC UA Client from there. I was not able to find out why the connection always fails but I think you have better ways of debugging.
No access to server with Bosch Rexroth OPC UA test client
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/32/comments
8
2019-04-17T13:21:38Z
2019-04-28T08:55:25Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/32
434,280,276
32
[ "FreeOpcUa", "opcua-asyncio" ]
Hi I have a UA OPC Server running in python (using the server-example.py) python script. I am able to read tags from the server using one of the example client scripts. In Kepware I get an error when I try to add browsed tags and when I try to manually add tags using their address I am also not able to view the tags. Using OPC Expert I get another error (not sure how related they are, error messages seem different) **Python** I am running server-example.py **Kepware:** I add a UA Client channel with the following settings: ![image](https://user-images.githubusercontent.com/5255272/56192374-7a696380-602e-11e9-8454-e34b83d39255.png) ![image](https://user-images.githubusercontent.com/5255272/56192403-8a814300-602e-11e9-9564-b1db66707faa.png) I can browse tags and all looks good ![image](https://user-images.githubusercontent.com/5255272/56192434-a258c700-602e-11e9-9b6b-a632ab34cb16.png) But when I click OK, Kepware GUI either crashes without an error message, or I get the following message "Failed to browse tags" I then don't try to add any tags, and use the default device settings: ![image](https://user-images.githubusercontent.com/5255272/56192630-1f843c00-602f-11e9-909b-630320083d02.png) Then manually add a tag using its address: ![image](https://user-images.githubusercontent.com/5255272/56192719-4c385380-602f-11e9-865a-9f752e1a8276.png) But the tag doesn't work: ![image](https://user-images.githubusercontent.com/5255272/56192792-75f17a80-602f-11e9-9052-4965783fd981.png) (OPC Expert shows that there is an error "Not Connected 8") **OPC Expert** By default the python OPC Server doesn't show up ![image](https://user-images.githubusercontent.com/5255272/56192959-d8e31180-602f-11e9-81f8-ffa68b3547f6.png) I manually add it using: ![image](https://user-images.githubusercontent.com/5255272/56193004-f6b07680-602f-11e9-9152-cc83230b53fa.png) It adds the server and it looks good: ![image](https://user-images.githubusercontent.com/5255272/56193162-4727d400-6030-11e9-941a-ec050143e0f7.png) It doesn't connect, the logs show: ![image](https://user-images.githubusercontent.com/5255272/56193050-134cae80-6030-11e9-9c0a-a68b4010f5d4.png)
[Bug Report] Kepware (and OPC Expert) can't read tags from Python OPC Server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/31/comments
1
2019-04-16T08:14:55Z
2023-03-28T19:48:00Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/31
433,643,282
31
[ "FreeOpcUa", "opcua-asyncio" ]
Hi I'm getting an error when I try to set a value using set_value() in a client. I have a Kepware UA OPC Server running and connecting using a simple UA Client in python When I try to use: `tag1.set_value(5)` I get: `asyncua.ua.uaerrors._auto.BadWriteNotSupported: The server does not support writing the combination of value, status and timestamps provided.(BadWriteNotSupported)` I read some of the previous issues, so I then tried a few more options: `dv = ua.DataValue(5, ua.VariantType.UInt16)` `dv.ServerTimestamp = datetime.now()` `await tag1.set_value(dv)` and `await tag1.set_attribute(ua.AttributeIds.Value, ua.Variant(value=5))` and a few other combinations but I keep getting the error: `AttributeError: 'Variant' object has no attribute 'ua_types'` or `AttributeError: 'VariantType' object has no attribute 'ua_types'` (I am able to set the value of the same tag using another UA Client) Stacktrace ERROR:asyncua:error Traceback (most recent call last): File "K:/repos/opcua-asyncio/examples/client-example.py", line 72, in run await tag1.set_value(dv) File "C:\Miniconda2\envs\python_opc\lib\asyncio\coroutines.py", line 110, in __next__ return self.gen.send(None) File "K:\repos\opcua-asyncio\asyncua\common\node.py", line 228, in set_value await self.set_attribute(ua.AttributeIds.Value, datavalue) File "C:\Miniconda2\envs\python_opc\lib\asyncio\coroutines.py", line 110, in __next__ return self.gen.send(None) File "K:\repos\opcua-asyncio\asyncua\common\node.py", line 273, in set_attribute result = await self.server.write(params) File "C:\Miniconda2\envs\python_opc\lib\asyncio\coroutines.py", line 110, in __next__ return self.gen.send(None) File "K:\repos\opcua-asyncio\asyncua\client\ua_client.py", line 340, in write data = await self.protocol.send_request(request) File "C:\Miniconda2\envs\python_opc\lib\asyncio\coroutines.py", line 110, in __next__ return self.gen.send(None) File "K:\repos\opcua-asyncio\asyncua\client\ua_client.py", line 120, in send_request future = self._send_request(request, callback, timeout, message_type) File "K:\repos\opcua-asyncio\asyncua\client\ua_client.py", line 99, in _send_request binreq = struct_to_binary(request) File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 247, in struct_to_binary packet.append(to_binary(uatype, val)) File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 270, in to_binary return struct_to_binary(val) File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 242, in struct_to_binary packet.append(list_to_binary(uatype[6:], val)) File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 282, in list_to_binary pack = [to_binary(uatype, el) for el in val] File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 282, in <listcomp> pack = [to_binary(uatype, el) for el in val] File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 270, in to_binary return struct_to_binary(val) File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 247, in struct_to_binary packet.append(to_binary(uatype, val)) File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 260, in to_binary return pack_uatype(vtype, val) File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 179, in pack_uatype return struct_to_binary(value) File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 247, in struct_to_binary packet.append(to_binary(uatype, val)) File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 260, in to_binary return pack_uatype(vtype, val) File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 179, in pack_uatype return struct_to_binary(value) File "K:\repos\opcua-asyncio\asyncua\ua\ua_binary.py", line 239, in struct_to_binary for name, uatype in obj.ua_types: AttributeError: 'VariantType' object has no attribute 'ua_types' INFO:asyncua.client.ua_client.UASocketProtocol:Socket has closed connection
Error when trying to set_value() of a tag
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/30/comments
11
2019-04-15T13:22:52Z
2022-09-05T06:41:50Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/30
433,279,754
30
[ "FreeOpcUa", "opcua-asyncio" ]
Hi I'm running an OPC Server in python (server-example.py) and trying to connect to it using an OPC UA Client in Kepware (KEPServerEX6). The connection works but I get an error message when I browse for tags and try to add them. If I manually try to add them using their address (eg. ns=2;i=13) then it works fine. Browsing for Python OPC Server works: ![image](https://user-images.githubusercontent.com/5255272/56115899-cf40a780-5f64-11e9-8532-2dce1fcdd6e5.png) Connection settings (password is blank): ![image](https://user-images.githubusercontent.com/5255272/56116001-044cfa00-5f65-11e9-8a2c-59f44de03a65.png) I can then browse for tags and it shows all of the tags that should be there: ![image](https://user-images.githubusercontent.com/5255272/56116164-7291bc80-5f65-11e9-8084-699087992a02.png) If I then select one/many of the tags I get the following error message: ![image](https://user-images.githubusercontent.com/5255272/56116334-d9af7100-5f65-11e9-8c4d-4626a7d850c3.png) Afterwards I can manually go and and tags which works fine. Am I missing something on the python side? Or is it maybe some Kepware related issue? Some log from pycharm: INFO:asyncua.server.internal_server:Created internal session ('127.0.0.1', 65001) INFO:asyncua.server.internal_server:Create session request INFO:asyncua.server.internal_server:get endpoint INFO:asyncua.server.uaprocessor:sending create session response INFO:asyncua.server.uaprocessor:Activate session request INFO:asyncua.server.internal_server:activate session INFO:asyncua.server.internal_server:Activated internal session ('127.0.0.1', 65001) for user User.Anonymous INFO:asyncua.server.uaprocessor:sending read response INFO:asyncua.server.uaprocessor:Read request INFO:asyncua.server.uaprocessor:sending read response INFO:asyncua.server.uaprocessor:Browse request INFO:asyncua.server.uaprocessor:sending browse response INFO:asyncua.server.uaprocessor:Browse request INFO:asyncua.server.uaprocessor:sending browse response INFO:asyncua.server.uaprocessor:Read request INFO:asyncua.server.uaprocessor:sending read response INFO:asyncua.server.uaprocessor:Read request INFO:asyncua.server.uaprocessor:sending read response INFO:asyncua.server.uaprocessor:Read request INFO:asyncua.server.uaprocessor:sending read response INFO:asyncua.server.uaprocessor:Read request INFO:asyncua.server.uaprocessor:sending read response INFO:asyncua.server.uaprocessor:Browse request INFO:asyncua.server.uaprocessor:sending browse response INFO:asyncua.server.uaprocessor:Read request INFO:asyncua.server.uaprocessor:sending read response INFO:asyncua.server.uaprocessor:Close session request !! This comes after I try to add the tags from the browse menu INFO:asyncua.server.internal_server:close session %s INFO:asyncua.server.subscription_service:delete subscriptions: [] INFO:asyncua.server.uaprocessor:sending close session response INFO:asyncua.server.binary_server_asyncio:processor returned False, we close connection from ('127.0.0.1', 65001) INFO:asyncua.server.binary_server_asyncio:Lost connection from ('127.0.0.1', 65001), None INFO:asyncua.server.uaprocessor:Cleanup client connection: ('127.0.0.1', 65001) INFO:asyncua.server.internal_server:close session %s INFO:asyncua.server.subscription_service:delete subscriptions: []
Kepware tag browsing issue
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/29/comments
4
2019-04-15T08:14:32Z
2020-08-22T07:39:41Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/29
433,150,629
29
[ "FreeOpcUa", "opcua-asyncio" ]
@cbergmiller Why do we have dependency to https://pypi.org/project/asyncio-contextmanager/ ? It seems to be used at one place in https://github.com/FreeOpcUa/opcua-asyncio/blob/master/asyncua/server/history_sql.py What was the issue that made it needed?
dependency to context manager
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/28/comments
3
2019-04-04T11:23:47Z
2019-04-20T06:40:41Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/28
429,224,647
28
[ "FreeOpcUa", "opcua-asyncio" ]
I am trying to write value to opcua. Basically my code is like this in example: var = client.get_node("ns=3;i=2002") print(var) var.get_data_value() # get value of node as a DataValue object var.get_value() # get value of node as a python builtin var.set_value(3.9) # set node value using implicit data type but I get this error: asyncua.ua.uaerrors._auto.BadWriteNotSupported: The server does not support writing the combination of value, status and timestamps provided.(BadWriteNotSupported) Should I be using this instead: var.set_value(ua.Variant([23], ua.VariantType.Int64)) #set node value using explicit data type If so, what is best way to make sure that VariantType is right? I can have bool, float, int16,int32 and string. Surely I can make my own function to check it I think, but is there better way?
BadWriteNotSupported
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/26/comments
3
2019-03-18T09:43:22Z
2021-11-10T12:09:46Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/26
422,120,934
26
[ "FreeOpcUa", "opcua-asyncio" ]
@cbergmiller looks like scrutinizer code checker does not like you. ![image](https://user-images.githubusercontent.com/2564046/54419278-5650f480-4707-11e9-9ac6-4997562d0d49.png) https://scrutinizer-ci.com/g/FreeOpcUa/opcua-asyncio/issues/master?orderField=issueCount&order=desc&honorSelectedPaths=0&page=1
scrutinizer report
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/25/comments
3
2019-03-15T08:47:39Z
2020-12-16T06:53:51Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/25
421,411,059
25
[ "FreeOpcUa", "opcua-asyncio" ]
should we have explicit start_thread_loop() and stop_thread_loop() or can we hide it in __del__ etc... hidding it might generate some fancy error cases....
sync-api
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/23/comments
1
2019-03-04T09:53:50Z
2019-10-25T17:21:25Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/23
416,717,730
23
[ "FreeOpcUa", "opcua-asyncio" ]
`opcua.ua.uaerrors._auto.BadTimeout: The operation timed out.(BadTimeout)` For a better understandig, with the asyncronious client I get that timeout error. See attachment of the output.dump file [output.zip](https://github.com/FreeOpcUa/opcua-asyncio/files/2905280/output.zip) The client IP is 10.2.202.253, the Server IP is 10.2.202.200. Authentification method is anonymous, no encryption, no username&password Exception: `File "/python-opcua/asyncua/common/node.py", line 149, in get_node_class result = await self.get_attribute(ua.AttributeIds.NodeClass)` `File "/coroutines.py", line 109, in __next__` `File "/python-opcua/asyncua/common/node.py", line 286, in get_attribute result = await self.server.read(params)` `File "/coroutines.py", line 109, in __next__` `File "/python-opcua/asyncua/client/ua_client.py", line 320, in read data = await self.protocol.send_request(request)` `File "/coroutines.py", line 109, in __next__` `File "/python-opcua/asyncua/client/ua_client.py", line 122, in send_request await asyncio.wait_for(future, timeout if timeout else None)` `File "/tasks.py", line 362, in wait_for concurrent.futures._base.TimeoutError` If testing a connection with the software UaExpert V1.4.4 to the same OPC-UA Server everything is good ![pqm-1588](https://user-images.githubusercontent.com/34133697/53404243-8c774000-39b5-11e9-8fe3-ac85e2945f03.JPG) [output.zip](https://github.com/FreeOpcUa/opcua-asyncio/files/2905279/output.zip)
BadTimeout Error connecting to Frako PQM-1588 OPC-UA DA Server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/22/comments
10
2019-02-26T09:46:58Z
2019-04-20T07:23:32Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/22
414,519,574
22
[ "FreeOpcUa", "opcua-asyncio" ]
@cbergmiller is returning a coroutine from sync methods really more efficient flagging that method async? I see that you often do not declare methods returning coroutine with async.... Is really ``` async def toto(): await asyncio.sleep(1) def whaterver(): return toto() await whatever ``` faster than ``` async def toto(): await asyncio.sleep(1) async def whaterver(): return toto() await whatever() ``` ? I am expecting python to create exactly ONE task when calling whatever() independantly if it is flagged with async or not. But the first version is much less readable since we do not have async declaration
is returning a coroutine from sync methods really more efficient flagging that method async?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/21/comments
4
2019-02-25T20:20:43Z
2019-03-03T07:11:06Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/21
414,288,994
21
[ "FreeOpcUa", "opcua-asyncio" ]
@cbergmiller do you have any overview of what tests are missing in asyncua compared to python-opcua? Now that I have sync wrapper that seem to completely working, it should in theary be possible to just copy the missing files to this repository, although it would be better to port them to pytest too
missing tests from python-opcua
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/20/comments
4
2019-02-25T20:15:46Z
2020-12-15T08:25:58Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/20
414,286,894
20
[ "FreeOpcUa", "opcua-asyncio" ]
@oroulet Sorry for the empty merge commit aa8105b297044d124e37913a9baf5e091bed0c6f I pulled the master and accidentally pushed it again. As far as can see no files have been changed by this - should i try to remove the commit?
Accidental empty merge commit aa8105b
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/19/comments
2
2019-02-25T10:53:02Z
2019-02-25T12:00:03Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/19
414,045,277
19
[ "FreeOpcUa", "opcua-asyncio" ]
Hello, opcua-asyncio version stops with error on connection to server step in ` async with Client(url=url) as client`. At the same time opcua works well. ```python import asyncio import sys sys.path.insert(0, "..") import logging from asyncua import Client, Node, ua logging.basicConfig(level=logging.DEBUG) _logger = logging.getLogger('asyncua') async def main(): url = 'opc.tcp://localhost:4990/FactoryTalkLinxGateway1' try: async with Client(url=url) as client: root = client.get_root_node() _logger.info('Objects node is: %r', root) except Exception: _logger.exception('error') if __name__ == '__main__': loop = asyncio.get_event_loop() loop.set_debug(True) loop.run_until_complete(main()) loop.close() ``` Debug info: INFO:asyncua.client.client:connect INFO:asyncua.client.ua_client.UaClient:opening connection DEBUG:asyncio:Get address info localhost:4990, type=<SocketKind.SOCK_STREAM: 1> DEBUG:asyncio:Getting address info localhost:4990, type=<SocketKind.SOCK_STREAM: 1> took 0.000ms: [(<AddressFamily.AF_INET6: 23>, <SocketKind.SOCK_STREAM: 1>, 0, '', ('::1', 4990, 0, 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 0, '', ('127.0.0.1', 4990))] DEBUG:asyncio:poll took 0.000 ms: 1 events DEBUG:asyncio:connect <socket.socket fd=256, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=0> to ('::1', 4990, 0, 0) DEBUG:asyncio:poll took 0.000 ms: 1 events DEBUG:asyncio:<socket.socket fd=256, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=0, laddr=('::1', 50124, 0, 0), raddr=('::1', 4990, 0, 0)> connected to localhost:4990: (<_SelectorSocketTransport fd=256 read=polling write=<idle, bufsize=0>>, <asyncua.client.ua_client.UASocketProtocol object at 0x037A7FF0>) DEBUG:asyncio:poll 4000.000 ms took 0.000 ms: 1 events INFO:asyncua.client.ua_client.UASocketProtocol:open_secure_channel DEBUG:asyncua.client.ua_client.UASocketProtocol:Sending: OpenSecureChannelRequest(TypeId:FourByteNodeId(i=446), RequestHeader:RequestHeader(AuthenticationToken:TwoByteNodeId(i=0), Timestamp:2019-02-24 08:55:37.973007, RequestHandle:1, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:1000, AdditionalHeader:ExtensionObject(TypeId:TwoByteNodeId(i=0), Encoding:0, None bytes)), Parameters:OpenSecureChannelParameters(ClientProtocolVersion:0, RequestType:0, SecurityMode:1, ClientNonce:b'', RequestedLifetime:3600000)) DEBUG:asyncio:poll 4000.000 ms took 0.000 ms: 1 events INFO:asyncua.client.ua_client.UaClient:create_session DEBUG:asyncua.client.ua_client.UASocketProtocol:Sending: CreateSessionRequest(TypeId:FourByteNodeId(i=461), RequestHeader:RequestHeader(AuthenticationToken:TwoByteNodeId(i=0), Timestamp:2019-02-24 08:55:37.975007, RequestHandle:2, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:10, AdditionalHeader:ExtensionObject(TypeId:TwoByteNodeId(i=0), Encoding:0, None bytes)), Parameters:CreateSessionParameters(ClientDescription:ApplicationDescription(ApplicationUri:urn:freeopcua:client, ProductUri:urn:freeopcua.github.io:client, ApplicationName:LocalizedText(Encoding:2, Locale:None, Text:Pure Python Async. Client), ApplicationType:1, GatewayServerUri:None, DiscoveryProfileUri:None, DiscoveryUrls:[]), ServerUri:None, EndpointUrl:opc.tcp://localhost:4990/FactoryTalkLinxGateway1, SessionName:Pure Python Async. Client Session1, ClientNonce:b'\xe4IK\x81E\x10\xdf&\xff\xdaY\xc5\x9cc\xa1\xa6\xc0\xff\xbd\xcbN\xff\x91\x12J\xacJ\xbe\x9b\xba\xe7\x95', ClientCertificate:None, RequestedSessionTimeout:3600000, MaxResponseMessageSize:0)) DEBUG:asyncio:poll 10000.000 ms took 0.000 ms: 1 events INFO:asyncua.client.client:find_endpoint [EndpointDescription(EndpointUrl:opc.tcp://localhost:4990/FactoryTalkLinxGateway1, Server:ApplicationDescription(ApplicationUri:urn:TEMP09-81OV7KU9:FactoryTalk Linx Gateway OPC UA Server, ProductUri:urn:FactoryTalk Linx Gateway OPC UA Server, ApplicationName:LocalizedText(Encoding:3, Locale:en, Text:FactoryTalkLinxGateway), ApplicationType:0, GatewayServerUri:None, DiscoveryProfileUri:None, DiscoveryUrls:['opc.tcp://localhost:4990/FactoryTalkLinxGateway1']), ServerCertificate:[...cuted...] , SecurityMode:1, SecurityPolicyUri:http://opcfoundation.org/UA/SecurityPolicy#None, UserIdentityTokens:[UserTokenPolicy(PolicyId:Anonymous_Policy, TokenType:0, IssuedTokenType:None, IssuerEndpointUrl:None, SecurityPolicyUri:None)], TransportProfileUri:http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary, SecurityLevel:11)] <MessageSecurityMode.None_: 1> 'http://opcfoundation.org/UA/SecurityPolicy#None' INFO:asyncua.client.ua_client.UaClient:activate_session DEBUG:asyncua.client.ua_client.UASocketProtocol:Sending: ActivateSessionRequest(TypeId:FourByteNodeId(i=467), RequestHeader:RequestHeader(AuthenticationToken:ByteStringNodeId(b=b'\x1an]\xd6[\x04&\x95!w\xb5\x98\xb53\xa0g2\\A<\xc1\xd8\xb9\x10\x9e\x0b\xdf\x10\xea\x00,j'), Timestamp:2019-02-24 08:55:37.979007, RequestHandle:3, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:10, AdditionalHeader:ExtensionObject(TypeId:TwoByteNodeId(i=0), Encoding:0, None bytes)), Parameters:ActivateSessionParameters(ClientSignature:SignatureData(Algorithm:http://www.w3.org/2000/09/xmldsig#rsa-sha1, Signature:b''), ClientSoftwareCertificates:[], LocaleIds:['en'], UserIdentityToken:AnonymousIdentityToken(PolicyId:Anonymous_Policy), UserTokenSignature:SignatureData(Algorithm:None, Signature:None))) DEBUG:asyncio:poll 10000.000 ms took 78.000 ms: 1 events WARNING:asyncua.client.ua_client.UASocketProtocol:ServiceFault from server received in response to ActivateSessionRequest ERROR:asyncua:error Traceback (most recent call last): File "C:\Users\Labuser\git\opcua-asyncio\examples\client-minimal_my.py", line 14, in main async with Client(url=url) as client: File "..\asyncua\client\client.py", line 65, in __aenter__ await self.connect() File "..\asyncua\client\client.py", line 209, in connect await self.activate_session(username=self._username, password=self._password, certificate=self.user_certificate) File "..\asyncua\client\client.py", line 404, in activate_session return await self.uaclient.activate_session(params) File "..\asyncua\client\ua_client.py", line 272, in activate_session data = await self.protocol.send_request(request) File "..\asyncua\client\ua_client.py", line 124, in send_request self.check_answer(data, " in response to " + request.__class__.__name__) File "..\asyncua\client\ua_client.py", line 133, in check_answer hdr.ServiceResult.check() File "..\asyncua\ua\uatypes.py", line 224, in check raise UaStatusCodeError(self.value) asyncua.ua.uaerrors._auto.BadTimeout: The operation timed out.(BadTimeout) DEBUG:asyncio:Close <_WindowsSelectorEventLoop running=False closed=False debug=True> ERROR:asyncio:Task was destroyed but it is pending! source_traceback: Object created at (most recent call last): File "C:\Users\Labuser\git\opcua-asyncio\examples\client-minimal_my.py", line 24, in <module> loop.run_until_complete(main()) File "C:\Users\Labuser\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 571, in run_until_complete self.run_forever() File "C:\Users\Labuser\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 539, in run_forever self._run_once() File "C:\Users\Labuser\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 1767, in _run_once handle._run() File "C:\Users\Labuser\AppData\Local\Programs\Python\Python37-32\lib\asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) File "C:\Users\Labuser\git\opcua-asyncio\examples\client-minimal_my.py", line 14, in main async with Client(url=url) as client: File "..\asyncua\client\client.py", line 65, in __aenter__ await self.connect() File "..\asyncua\client\client.py", line 204, in connect await self.create_session() File "..\asyncua\client\client.py", line 340, in create_session self._renew_channel_task = self.loop.create_task(self._renew_channel_loop()) task: <Task pending coro=<Client._renew_channel_loop() running at ..\asyncua\client\client.py:353> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x0383E710>()] created at C:\Users\Labuser\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py:396> created at ..\asyncua\client\client.py:340>
Can't connect to Rockwell OPCUA server
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/18/comments
14
2019-02-24T09:14:55Z
2019-05-03T16:06:28Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/18
413,800,481
18
[ "FreeOpcUa", "opcua-asyncio" ]
Use dataclasses to remove code
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/14/comments
5
2019-02-17T12:21:02Z
2021-04-26T09:10:15Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/14
411,181,711
14
[ "FreeOpcUa", "opcua-asyncio" ]
This is going to be a lot of renaming...
Rename namespace opcua. It must be possible to install both sync and asynchronous versions..
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/13/comments
4
2019-02-17T11:24:22Z
2019-02-23T16:28:50Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/13
411,176,995
13
[ "FreeOpcUa", "opcua-asyncio" ]
I would like to propose the usage of type hints [https://www.python.org/dev/peps/pep-0484/](https://www.python.org/dev/peps/pep-0484/) (at least for the complex types). For example: ```python def publish_callback(self, publishresult: ua.PublishResult): self.logger.info("Publish callback called with result: %s", publishresult) if self.subscription_id is None: self.subscription_id = publishresult.SubscriptionId ``` This could make it easier to understand the code and to enable static type checking (with some IDEs). It should work fine with python 3.5 and above. Are there any reservations against the usage of type hints in this project?
Type hints
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/12/comments
1
2019-02-17T11:17:33Z
2019-02-17T11:42:34Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/12
411,176,481
12
[ "FreeOpcUa", "opcua-asyncio" ]
@cbergmiller In fact I was trying to debug exactly that stuff right now. but I am not really sure how to do this correctly. I see that you implemented the connection renewal using create_task and recursion. This kind of fire and forget stuff in asyncio is asking for trouble. I believe, but correct me if I am wrong, that we should have a a background task, keep reference to task, and at the end cancel it and await it. This is easy to do for connectino renewale but much more difficult for subscriptions
background tasks and subcriptions
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/10/comments
2
2019-02-17T10:16:33Z
2019-02-24T11:36:55Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/10
411,171,412
10
[ "FreeOpcUa", "opcua-asyncio" ]
@cbergmiller I am now looking at the asyncio stuff. and I now see that you completely remove the KeepAlive thread. Why? How do you then keep the secure session alive?
keepalive status?
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/9/comments
1
2019-02-17T08:32:39Z
2019-02-17T08:48:41Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/9
411,162,711
9
[ "FreeOpcUa", "opcua-asyncio" ]
@cbergmiller you have some changes in your own work
make PR for cbergmiller:make/asyncio
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/8/comments
0
2018-08-12T12:48:52Z
2019-02-23T16:29:12Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/8
349,810,097
8
[ "FreeOpcUa", "opcua-asyncio" ]
We need to write status somewhere (README?) so people are clear over current state. does the client work? does the server work? for what?
opcua-asyncio status
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/7/comments
1
2018-08-12T12:44:49Z
2019-03-03T07:12:02Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/7
349,809,827
7
[ "FreeOpcUa", "opcua-asyncio" ]
port changes from python-opcua that have not been ported yet
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/6/comments
0
2018-08-12T12:43:45Z
2019-02-23T16:29:22Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/6
349,809,744
6
[ "FreeOpcUa", "opcua-asyncio" ]
It would be great to make a sync API so we do not need to maintain two branches. I am expected many users to be more than happy with sync and not everybody want to use asyncio. If we do that we may not even need to port all examples and tests It should be possible (and little work) to make wrapper around Client, Server, Subscription and Node classes. the wrapper will also need to make sure that SyncNode returns a SyncNode and AsyncNode objects. some code is there, maybe it can almost be used AS IS. I am not understand everything there, it might be over complicated..
sync API
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/5/comments
1
2018-08-12T12:43:15Z
2019-04-29T07:06:03Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/5
349,809,716
5
[ "FreeOpcUa", "opcua-asyncio" ]
When trying to re-import the nodes from the created XML file, the tests fails with the error `BadParentNodeIdInvalid: The parent node id does not to refer to a valid node.(BadParentNodeIdInvalid)`.
Test `test_xml_method` is failing.
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/4/comments
1
2018-08-12T11:19:15Z
2019-02-17T11:18:36Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/4
349,804,540
4
[ "FreeOpcUa", "opcua-asyncio" ]
Changes to the API need to be documented.
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/3/comments
0
2018-08-12T11:17:37Z
2019-05-05T05:24:55Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/3
349,804,460
3
[ "FreeOpcUa", "opcua-asyncio" ]
All command line tools need to be refactored for use with the async. API.
Command line tools are outdated
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/2/comments
1
2018-08-12T11:17:02Z
2019-04-30T11:38:08Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/2
349,804,430
2
[ "FreeOpcUa", "opcua-asyncio" ]
Most of the examples still use the synchronous API and won't work.
Most examples are outdated
https://api.github.com/repos/FreeOpcUa/opcua-asyncio/issues/1/comments
2
2018-08-12T11:15:24Z
2019-05-05T05:24:39Z
https://github.com/FreeOpcUa/opcua-asyncio/issues/1
349,804,320
1