-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to connect to Arburg proprietary server #135
Comments
looks like bug in exception handling here. I will commit a fix, the encryption stuff is missing tests and that king of things happen.... |
I'm experiencing exactly the same problem with Ignition Software's OPC-UA Server. |
Can one of you put their server on internet or record a session with wireshark so we understand what is happening. |
@oroulet I am not able to put the server on the internet and wireshark is not recognizing my wireless card via windows on a surface book :/ |
Then set logging to debug and send terminal output. Maybe we'll see On Thu, Feb 18, 2016, 22:44 mertz3hack notifications@github.com wrote:
|
@oroulet I downgraded to version 1.12.9 of wireshark and it is now seeing my wireless card. |
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 |
I'm not exactly sure what I should be looking for - i see the server and pc interacting but don't directly see the request @oroulet the last wireshark file you were looking at was a successful uaexpert connection and disconnection. If you have some specific code you would like me to try please let me know |
Can you fix the typo in line 451 in security_policies.py (uri -> policy_uri) then run again? It will not fix your issue but at least we will get a good error message |
@alkor In this log I see that in UserTokenPolicy the PolicyId is set to UserName_Policy_1. Is this a normal PolicyId? Can it be the reason of the crash here? any suggestion t fix this? |
@alkor Am I right to understand that name og UserTokenPolicy does not mean anything? The important thing is what is written in the SecurityPolicyUri? and in that case we are missing support for the simplest one: no encryption? |
Oh, yes, I see the problem. I'll fix this. Thank you for fixing my typo (uri -> policy_uri). |
This should now be fixed in master. Can you test and report? |
This is what I tried running to connect And the results |
Set logging to debug and run wireshark again. Then copy paste stdout here. And please try to keep some formating when pasting. |
please update master. I just added some more debug to client. Now it prints everything it sends and receives from server, so you do not need to use wireshark. |
@oroulet is there an instant messenger on here we can use? It is connecting to the server and the object node and root are fetching but the disconnect is throwing the error (Update: it does not appear to be the disconnect that is throwing the error) wait When ran with debugging on I do not get the error |
I am able to successfully connect too and specify a node to get it's value. |
the error is not visible in the minima debug.txt file. Should I understand that i only happens sometime? and only at end of connection? |
I will close this issue with successful connection and will see if I can find anything more about his other error I am getting before creating an Issue for it. |
Arburg is an injection molding machine company that runs OPC UA servers on their machines.
I am able to connect to the machine and browse with UAExpert.
Taking any suggestions. Can I set the URI?
I am trying to connect to the server with
import sys
sys.path.insert(0, "..")
from opcua import Client
client = Client("opc.tcp://admin:password@192.168.12.28:4880/Arburg")
client.connect()
client.disconnect()
I get this when I run it
Traceback (most recent call last):
File "minimal-client.py", line 11, in
client.connect()
File "..\opcua\client\client.py", line 208, in connect
self.activate_session(username=self.server_url.username, password=self.server_url.password, certificate=self.user_ce
rtificate)
File "..\opcua\client\client.py", line 384, in activate_session
self.server_policy_uri(ua.UserTokenType.UserName))
File "..\opcua\crypto\security_policies.py", line 451, in encrypt_asymmetric
raise UaError("Unsupported security policy
{}
".format(uri))NameError: name 'uri' is not defined
ServiceFault from server received in response to ReadRequest
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\python\lib\threading.py", line 914, in _bootstrap_inner
self.run()
File "..\opcua\client\client.py", line 51, in run
val = server_state.get_value()
File "..\opcua\common\node.py", line 81, in get_value
result = self.get_data_value()
File "..\opcua\common\node.py", line 90, in get_data_value
return self.get_attribute(ua.AttributeIds.Value)
File "..\opcua\common\node.py", line 155, in get_attribute
result = self.server.read(params)
File "..\opcua\client\ua_client.py", line 267, in read
data = self._uasocket.send_request(request)
File "..\opcua\client\ua_client.py", line 75, in send_request
self.check_answer(data, " in response to " + request.class.name)
File "..\opcua\client\ua_client.py", line 84, in check_answer
hdr.ServiceResult.check()
File "..\opcua\ua\uatypes.py", line 323, in check
raise UaStatusCodeError("{}({})".format(self.doc, self.name))
opcua.common.uaerrors.UaStatusCodeError: The session cannot be used because ActivateSession has not been called.(BadSessionNotActivated)
The text was updated successfully, but these errors were encountered: