diff --git a/src/dashboard/protocol_clients.py b/src/dashboard/protocol_clients.py index 41daf3a..b599e9e 100644 --- a/src/dashboard/protocol_clients.py +++ b/src/dashboard/protocol_clients.py @@ -23,12 +23,15 @@ class OPCUAClient: """Connect to OPC UA server.""" try: from asyncua import Client + from asyncua.crypto.security_policies import SecurityPolicyBasic256Sha256 + self._client = Client(url=self.endpoint) # Explicitly set security policy to match server configuration # The server supports both Basic256Sha256 and None security policies # Use None for development/testing - await self._client.set_security_string("http://opcfoundation.org/UA/SecurityPolicy#None") + # Try connecting without explicit security policy first + # The client should automatically negotiate with the server # Set timeout for connection await asyncio.wait_for(self._client.connect(), timeout=5.0)