{"action":"created","issue":{"url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/135","repository_url":"https://api.github.com/repos/FreeOpcUa/python-opcua","labels_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/135/comments","events_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/135/events","html_url":"https://github.com/FreeOpcUa/python-opcua/issues/135","id":134388355,"number":135,"title":"Attempt to connect to Arburg proprietary server","user":{"login":"mertz3hack","id":4985248,"avatar_url":"https://avatars.githubusercontent.com/u/4985248?v=3","gravatar_id":"","url":"https://api.github.com/users/mertz3hack","html_url":"https://github.com/mertz3hack","followers_url":"https://api.github.com/users/mertz3hack/followers","following_url":"https://api.github.com/users/mertz3hack/following{/other_user}","gists_url":"https://api.github.com/users/mertz3hack/gists{/gist_id}","starred_url":"https://api.github.com/users/mertz3hack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mertz3hack/subscriptions","organizations_url":"https://api.github.com/users/mertz3hack/orgs","repos_url":"https://api.github.com/users/mertz3hack/repos","events_url":"https://api.github.com/users/mertz3hack/events{/privacy}","received_events_url":"https://api.github.com/users/mertz3hack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-02-17T20:17:19Z","updated_at":"2016-02-19T11:32:19Z","closed_at":null,"body":"Arburg is an injection molding machine company that runs OPC UA servers on their machines.\r\nI am able to connect to the machine and browse with UAExpert.\r\n\r\nTaking any suggestions.  Can I set the URI?\r\n\r\nI am trying to connect to the server with\r\n\r\n<code>import sys\r\nsys.path.insert(0, \"..\")\r\nfrom opcua import Client\r\n\r\nclient = Client(\"opc.tcp://admin:password@192.168.12.28:4880/Arburg\")\r\nclient.connect()\r\nclient.disconnect()</code>\r\n\r\nI get this when I run it\r\n\r\n<code>\r\nTraceback (most recent call last):\r\n  \r\nFile \"minimal-client.py\", line 11, in <module>\r\n    client.connect()\r\n  \r\nFile \"..\\opcua\\client\\client.py\", line 208, in connect\r\n    self.activate_session(username=self.server_url.username, password=self.server_url.password, certificate=self.user_ce\r\nrtificate)\r\n  \r\nFile \"..\\opcua\\client\\client.py\", line 384, in activate_session\r\n    self.server_policy_uri(ua.UserTokenType.UserName))\r\n  \r\nFile \"..\\opcua\\crypto\\security_policies.py\", line 451, in encrypt_asymmetric\r\n    raise UaError(\"Unsupported security policy `{}`\".format(uri))\r\nNameError: name 'uri' is not defined\r\nServiceFault from server received  in response to ReadRequest\r\nException in thread Thread-2:\r\n\r\nTraceback (most recent call last):\r\n  \r\nFile \"C:\\python\\lib\\threading.py\", line 914, in _bootstrap_inner\r\n    self.run()\r\n  \r\nFile \"..\\opcua\\client\\client.py\", line 51, in run\r\n    val = server_state.get_value()\r\n  \r\nFile \"..\\opcua\\common\\node.py\", line 81, in get_value\r\n    result = self.get_data_value()\r\n  \r\nFile \"..\\opcua\\common\\node.py\", line 90, in get_data_value\r\n    return self.get_attribute(ua.AttributeIds.Value)\r\n \r\n File \"..\\opcua\\common\\node.py\", line 155, in get_attribute\r\n    result = self.server.read(params)\r\n  \r\nFile \"..\\opcua\\client\\ua_client.py\", line 267, in read\r\n    data = self._uasocket.send_request(request)\r\n \r\n File \"..\\opcua\\client\\ua_client.py\", line 75, in send_request\r\n    self.check_answer(data, \" in response to \" + request.__class__.__name__)\r\n  \r\nFile \"..\\opcua\\client\\ua_client.py\", line 84, in check_answer\r\n    hdr.ServiceResult.check()\r\n \r\n File \"..\\opcua\\ua\\uatypes.py\", line 323, in check\r\n    raise UaStatusCodeError(\"{}({})\".format(self.doc, self.name))\r\nopcua.common.uaerrors.UaStatusCodeError: The session cannot be used because ActivateSession has not been called.(BadSessionNotActivated)\r\n</code>"},"comment":{"url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/comments/186180380","html_url":"https://github.com/FreeOpcUa/python-opcua/issues/135#issuecomment-186180380","issue_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/135","id":186180380,"user":{"login":"oroulet","id":2564046,"avatar_url":"https://avatars.githubusercontent.com/u/2564046?v=3","gravatar_id":"","url":"https://api.github.com/users/oroulet","html_url":"https://github.com/oroulet","followers_url":"https://api.github.com/users/oroulet/followers","following_url":"https://api.github.com/users/oroulet/following{/other_user}","gists_url":"https://api.github.com/users/oroulet/gists{/gist_id}","starred_url":"https://api.github.com/users/oroulet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oroulet/subscriptions","organizations_url":"https://api.github.com/users/oroulet/orgs","repos_url":"https://api.github.com/users/oroulet/repos","events_url":"https://api.github.com/users/oroulet/events{/privacy}","received_events_url":"https://api.github.com/users/oroulet/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T11:32:19Z","updated_at":"2016-02-19T11:32:19Z","body":"the log seems corrupt. I cannot see the request freeopcua sends. But from the responses we see, the connection has succeeded and you read some nodes values then tried to subscribe to a node and that is where something fails. I cannot see what node you are trying to subscribe too, but the server sends a serviceFault response. This looks very different to what you say and the error message you wrote above... How does you code looks like? does it fail even you do not attempt to subcsribe a node?  You can only subscribe to variable nodes"}}