- 08 Feb, 2021 1 commit
-
-
Julien Prigent authored
When a session has a short session timeout, the secure_channel is renewed at 75% of it lifetime. While this is convenient to keep the session alives, this might be an overkill in some situations since the encryption involved behind the scene can be expensive, specifically on hardware with limited resources (i.e: OPC-UA server embedded on PLC module for example). What I suggested here is to have more control over the secure channel renewal and instead to rely on the subscription keepalive mechanism, thus, the client won't timeout when subscriptions are inactive. There's still the case when there's no subscription (client is connected but idling), in this situation the user has to set a secure_channel_timeout < session_timeout. Finally, the library ua-server doesn't respect the session_timeout sent by the client during session_creation. Probably worth to follow-up on this. Test with MaxKeepAliveCount == 22 (session_timeout = 30; publish_interval = 1000) ``` 2021-02-07 16:23:00,147 - asyncua.client.ua_client.UASocketProtocol - DEBUG - Sending: CreateSubscriptionRequest(TypeId:i=787, RequestHeader:RequestHeader(AuthenticationToken:b=b'2\xd2\x82w\xad\x0f\x99\x9a %\xfaj\xb6\xb9\xaf\xa8\xe7\x13\xe6\xec\x15G\xf7G\x15\xbb\x82\x1d\xda\x17\xafh', Timestamp:2021-02-08 00:23:00.147523, RequestHandle:4, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:4000, AdditionalHeader:ExtensionObject(TypeId:i=0, Encoding:0, None bytes)), Parameters:CreateSubscriptionParameters(RequestedPublishingInterval:1000, RequestedLifetimeCount:10000, RequestedMaxKeepAliveCount:22, MaxNotificationsPerPublish:10000, PublishingEnabled:True, Priority:0)) 2021-02-07 16:23:00,170 - asyncua.client.ua_client.UaClient - DEBUG - publish [] 2021-02-07 16:23:00,170 - asyncua.client.ua_client.UASocketProtocol - DEBUG - Sending: PublishRequest(TypeId:i=826, RequestHeader:RequestHeader(AuthenticationToken:b=b'2\xd2\x82w\xad\x0f\x99\x9a %\xfaj\xb6\xb9\xaf\xa8\xe7\x13\xe6\xec\x15G\xf7G\x15\xbb\x82\x1d\xda\x17\xafh', Timestamp:2021-02-08 00:23:00.170972, RequestHandle:6, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:0, AdditionalHeader:ExtensionObject(TypeId:i=0, Encoding:0, None bytes)), Parameters:PublishParameters(SubscriptionAcknowledgements:[])) 21-02-08 00:23:00.939388))], DiagnosticInfos:[])]), Results:[], DiagnosticInfos:[]) DataChangeNotification(<asyncua.common.subscription.SubscriptionItemData object at 0x7fdbf1444c10>, MonitoredItemNotification(ClientHandle:201, Value:DataValue(Value:Variant(val:300000,type:VariantType.Int32), StatusCode:StatusCode(Good), SourceTimestamp:2021-02-08 00:23:00.900000, ServerTimestamp:2021-02-08 00:23:00.939388))) 2021-02-07 16:23:01,189 - asyncua.client.ua_client.UaClient - DEBUG - publish [SubscriptionAcknowledgement(SubscriptionId:75, SequenceNumber:1)] 2021-02-07 16:23:01,189 - asyncua.client.ua_client.UASocketProtocol - DEBUG - Sending: PublishRequest(TypeId:i=826, RequestHeader:RequestHeader(AuthenticationToken:b=b'2\xd2\x82w\xad\x0f\x99\x9a %\xfaj\xb6\xb9\xaf\xa8\xe7\x13\xe6\xec\x15G\xf7G\x15\xbb\x82\x1d\xda\x17\xafh', Timestamp:2021-02-08 00:23:01.189588, RequestHandle:7, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:0, AdditionalHeader:ExtensionObject(TypeId:i=0, Encoding:0, None bytes)), Parameters:PublishParameters(SubscriptionAcknowledgements:[SubscriptionAcknowledgement(SubscriptionId:75, SequenceNumber:1)])) 2021-02-07 16:23:23,198 - asyncua.common.subscription - INFO - Publish callback called with result: PublishResult(SubscriptionId:75, AvailableSequenceNumbers:[], MoreNotifications:False, NotificationMessage:NotificationMessage(SequenceNumber:2, PublishTime:2021-02-08 00:23:23.195861, NotificationData:[]), Results:[StatusCode(Good)], DiagnosticInfos:[]) 2021-02-07 16:23:45,175 - asyncua.common.subscription - INFO - Publish callback called with result: PublishResult(SubscriptionId:75, AvailableSequenceNumbers:[], MoreNotifications:False, NotificationMessage:NotificationMessage(SequenceNumber:2, PublishTime:2021-02-08 00:23:45.172315, NotificationData:[]), Results:[], DiagnosticInfos:[]) 2021-02-07 16:23:45,175 - asyncua.client.ua_client.UaClient - DEBUG - publish [] 2021-02-07 16:23:45,175 - asyncua.client.ua_client.UASocketProtocol - DEBUG - Sending: PublishRequest(TypeId:i=826, RequestHeader:RequestHeader(AuthenticationToken:b=b'2\xd2\x82w\xad\x0f\x99\x9a %\xfaj\xb6\xb9\xaf\xa8\xe7\x13\xe6\xec\x15G\xf7G\x15\xbb\x82\x1d\xda\x17\xafh', Timestamp:2021-02-08 00:23:45.175790, RequestHandle:9, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:0, AdditionalHeader:ExtensionObject(TypeId:i=0, Encoding:0, None bytes)), Parameters:PublishParameters(SubscriptionAcknowledgements:[])) 2021-02-07 16:24:07,185 - asyncua.common.subscription - INFO - Publish callback called with result: PublishResult(SubscriptionId:75, AvailableSequenceNumbers:[], MoreNotifications:False, NotificationMessage:NotificationMessage(SequenceNumber:2, PublishTime:2021-02-08 00:24:07.182767, NotificationData:[]), Results:[], DiagnosticInfos:[]) ``` Test with MaxKeepAliveCount == 0 ``` 2021-02-07 16:25:40,994 - asyncua.client.ua_client.UaClient - DEBUG - create_subscription 2021-02-07 16:25:40,994 - asyncua.client.ua_client.UASocketProtocol - DEBUG - Sending: CreateSubscriptionRequest(TypeId:i=787, RequestHeader:RequestHeader(AuthenticationToken:b=b'\x18*m\xa6E\xf3?\x9d\x86\xe2\xe9rgI\xa7\x073\xe90\xdb\x82\x82~F\x81\xe8\xb2T\xdb\xb0\xf8\xea', Timestamp:2021-02-08 00:25:40.994336, RequestHandle:4, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:4000, AdditionalHeader:ExtensionObject(TypeId:i=0, Encoding:0, None bytes)), Parameters:CreateSubscriptionParameters(RequestedPublishingInterval:1000, RequestedLifetimeCount:10000, RequestedMaxKeepAliveCount:0, MaxNotificationsPerPublish:10000, PublishingEnabled:True, Priority:0)) 2021-02-07 16:25:45,006 - asyncua.common.subscription - INFO - Publish callback called with result: PublishResult(SubscriptionId:76, AvailableSequenceNumbers:[], MoreNotifications:False, NotificationMessage:NotificationMessage(SequenceNumber:2, PublishTime:2021-02-08 00:25:45.003386, NotificationData:[]), Results:[StatusCode(Good)], DiagnosticInfos:[]) 2021-02-07 16:25:45,007 - asyncua.client.ua_client.UaClient - DEBUG - publish [] 2021-02-07 16:25:45,007 - asyncua.client.ua_client.UASocketProtocol - DEBUG - Sending: PublishRequest(TypeId:i=826, RequestHeader:RequestHeader(AuthenticationToken:b=b'\x18*m\xa6E\xf3?\x9d\x86\xe2\xe9rgI\xa7\x073\xe90\xdb\x82\x82~F\x81\xe8\xb2T\xdb\xb0\xf8\xea', Timestamp:2021-02-08 00:25:45.007090, RequestHandle:8, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:0, AdditionalHeader:ExtensionObject(TypeId:i=0, Encoding:0, None bytes)), Parameters:PublishParameters(SubscriptionAcknowledgements:[])) 2021-02-07 16:25:42,023 - asyncua.client.ua_client.UaClient - DEBUG - publish [SubscriptionAcknowledgement(SubscriptionId:76, SequenceNumber:1)] 2021-02-07 16:25:42,023 - asyncua.client.ua_client.UASocketProtocol - DEBUG - Sending: PublishRequest(TypeId:i=826, RequestHeader:RequestHeader(AuthenticationToken:b=b'\x18*m\xa6E\xf3?\x9d\x86\xe2\xe9rgI\xa7\x073\xe90\xdb\x82\x82~F\x81\xe8\xb2T\xdb\xb0\xf8\xea', Timestamp:2021-02-08 00:25:42.023578, RequestHandle:7, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:0, AdditionalHeader:ExtensionObject(TypeId:i=0, Encoding:0, None bytes)), Parameters:PublishParameters(SubscriptionAcknowledgements:[SubscriptionAcknowledgement(SubscriptionId:76, SequenceNumber:1)])) 2021-02-07 16:25:45,006 - asyncua.common.subscription - INFO - Publish callback called with result: PublishResult(SubscriptionId:76, AvailableSequenceNumbers:[], MoreNotifications:False, NotificationMessage:NotificationMessage(SequenceNumber:2, PublishTime:2021-02-08 00:25:45.003386, NotificationData:[]), Results:[StatusCode(Good)], DiagnosticInfos:[]) 2021-02-07 16:25:45,007 - asyncua.client.ua_client.UaClient - DEBUG - publish [] 2021-02-07 16:25:45,007 - asyncua.client.ua_client.UASocketProtocol - DEBUG - Sending: PublishRequest(TypeId:i=826, RequestHeader:RequestHeader(AuthenticationToken:b=b'\x18*m\xa6E\xf3?\x9d\x86\xe2\xe9rgI\xa7\x073\xe90\xdb\x82\x82~F\x81\xe8\xb2T\xdb\xb0\xf8\xea', Timestamp:2021-02-08 00:25:45.007090, RequestHandle:8, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:0, AdditionalHeader:ExtensionObject(TypeId:i=0, Encoding:0, None bytes)), Parameters:PublishParameters(SubscriptionAcknowledgements:[])) 2021-02-07 16:25:48,016 - asyncua.common.subscription - INFO - Publish callback called with result: PublishResult(SubscriptionId:76, AvailableSequenceNumbers:[], MoreNotifications:False, NotificationMessage:NotificationMessage(SequenceNumber:2, PublishTime:2021-02-08 00:25:48.013598, NotificationData:[]), Results:[], DiagnosticInfos:[]) 2021-02-07 16:25:48,016 - asyncua.client.ua_client.UaClient - DEBUG - publish [] 2021-02-07 16:25:48,017 - asyncua.client.ua_client.UASocketProtocol - DEBUG - Sending: PublishRequest(TypeId:i=826, RequestHeader:RequestHeader(AuthenticationToken:b=b'\x18*m\xa6E\xf3?\x9d\x86\xe2\xe9rgI\xa7\x073\xe90\xdb\x82\x82~F\x81\xe8\xb2T\xdb\xb0\xf8\xea', Timestamp:2021-02-08 00:25:48.017009, RequestHandle:9, ReturnDiagnostics:0, AuditEntryId:None, TimeoutHint:0, AdditionalHeader:ExtensionObject(TypeId:i=0, Encoding:0, None bytes)), Parameters:PublishParameters(SubscriptionAcknowledgements:[])) 2021-02-07 16:25:51,016 - asyncua.common.subscription - INFO - Publish callback called with result: PublishResult(SubscriptionId:76, AvailableSequenceNumbers:[], MoreNotifications:False, NotificationMessage:NotificationMessage(SequenceNumber:2, PublishTime:2021-02-08 00:25:51.012809, NotificationData:[]), Results:[], DiagnosticInfos:[]) ```
-
- 04 Feb, 2021 2 commits
- 03 Feb, 2021 2 commits
-
-
Fabian Beitler authored
* Updated Schemas and standard_addresspaces to newest UA-Nodeset version * Add Model Uri, Version and PublicationDate to autogenerated files Add missing namespaces in fill_namespace loop * Add break to stop iteration through xml file after finding model * Update to newest UA-Nodeset version (old one was still used!) * Generate Nodes on base of newest UA-Nodeset * Remove files from UA-Nodeset * Added more infos in header of event_object
-
Fabian Beitler authored
Replace run method with asyncio.run, since it is standard in python3.7 Add missing awaits in Coroutines Fix smaller Codestyle issues
-
- 29 Jan, 2021 2 commits
- 28 Jan, 2021 3 commits
- 26 Jan, 2021 1 commit
-
-
Daniel B authored
Co-authored-by:
Julien PRIGENT <julienprigent@wanadoo.fr>
-
- 25 Jan, 2021 3 commits
-
-
Julien Prigent authored
This variable is used to trace server disconnections and renew the subscription/MI when it occurs. Consequently is had to be unique urls otherwise it could grow indefinitely is some use-cases (i.e: reconciliator is disabled or running slower that the Keepalive checks).
-
Koseng authored
-
Koseng authored
-
- 23 Jan, 2021 3 commits
-
-
Koseng authored
Support variables with properties in events and extend file generators for Alarms and Conditions (#415) * Complete client alarms and conditions example Complete client alarms and conditions example for usage with OPCFoundation UA-.NETStandard-Samples Quickstart AlarmConditionServer * Add variables to generated event filter and event object Event types can not only contain properties, but also variables. For example the ConditionType, which is the foundation of Alarms and Conditions, contains variables. Add the variables to the generated event filter and event object. * Changed schemas for Fix localtime field of events * changed schemas to autogenerate event_objects.py with conditions and alarms * expand the event model with variables which are able to have properties as children also supports custom events now we are able to generate alarms and conditions * Some refactoring and commenting in events and generate_model_event * Newly generated event_objects with Alarms and Conditions Types and Variables Co-authored-by:
mar-ar <marco.arnold@hermle.de> Co-authored-by:
oroulet <oroulet@users.noreply.github.com>
-
oroulet authored
* [InvalidSignature] Fix race condition with secure channel renewal * [InvalidSignature] Clean code and add tests * [InvalidSignature] Consider expired SecureToken for up to 25% of its lifetime Co-authored-by:
Julien Prigent <julienprigent@wanadoo.fr>
-
Fabian Beitler authored
-
- 21 Jan, 2021 1 commit
-
-
Julien Prigent authored
-
- 19 Jan, 2021 2 commits
-
-
Ankur Srivastava authored
-
Andreas Heine authored
* unlucky default value for ResultMask! @oroulet good that you asked... but i was to slow! sorry about that -_-° * Update client.py * cast to list * added test * fix missing import
-
- 18 Jan, 2021 5 commits
-
-
Andreas Heine authored
* unlucky default value for ResultMask! @oroulet good that you asked... but i was to slow! sorry about that -_-° * Update client.py
-
Andreas Heine authored
* added browse multiple nodes in one ua call https://reference.opcfoundation.org/v104/Core/docs/Part4/5.8.2/ * Update client.py
-
oroulet authored
-
oroulet authored
-
Fabian Czech authored
-
- 12 Jan, 2021 3 commits
-
-
Fabian Beitler authored
-
oroulet authored
-
oroulet authored
-
- 11 Jan, 2021 8 commits
- 06 Jan, 2021 1 commit
-
-
Fabian Beitler authored
Smaller code cleanups like "adding var" since it is not already declared, removing unused import statementes and similar.
-
- 05 Jan, 2021 1 commit
-
-
Fabian Beitler authored
Rewrite if statement to easier readable code Replace Path expressions a better way? Add absolute to get absolute path to file (I hope) Remove one obsolete import pytest Refactor method name to better name Redo nested if statement a better way Remove forgotten garbage methods Replace os path with pathlib Small Codestyle fixes Add check if both or neither xml arg was passed -> not xor Fix wrong required model handling Differ between xmlstrin and file Add tests for requirement check Add two xml files for test purposes Replace ImportError with Exception Remove unused var List all missing requirements Check server models in seperate Coroutine Add method to check requirements while xmlimport Add namespaces Node to Shortcuts
-
- 04 Jan, 2021 2 commits
-
-
Marko Kohtala authored
* uals -l option fix uals -l option conversion to async was incomplete and failed with error TypeError: 'coroutine' object is not iterable. * Fix obsolete server-example.py reference and remove unused _logger
-
oroulet authored
-