FreeOpcUa / python-opcua

LGPL Pure Python OPC-UA Client and Server
http://freeopcua.github.io/
GNU Lesser General Public License v3.0
1.36k stars 658 forks source link

opc ua client in raspberrypi #458

Open ghost opened 7 years ago

ghost commented 7 years ago

Hello, All.

I am building an OPC UA Server and Client with two RaspberryPi2 Model B, respectively.

The problem occurs on the client as follows: What is the problem? (Note that the client works fine in Ubuntu on the desktop.)

Traceback (most recent call last):
  File "test_opcua_client.py", line 27, in <module>
    client.disconnect()
  File "../opcua/client/client.py", line 258, in disconnect
    self.disconnect_socket()
  File "../opcua/client/client.py", line 267, in disconnect_socket
    self.uaclient.disconnect_socket()
  File "../opcua/client/ua_client.py", line 218, in disconnect_socket
    return self._uasocket.disconnect_socket()
  File "../opcua/client/ua_client.py", line 143, in disconnect_socket
    self._socket.socket.shutdown(socket.SHUT_RDWR)
AttributeError: 'NoneType' object has no attribute 'socket'
zerox1212 commented 7 years ago

Are you using Python 2 or 3?

ghost commented 7 years ago

python2.

      1. 오전 2:52에 "Andrew" notifications@github.com님이 작성:

Are you using Python 2 or 3?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FreeOpcUa/python-opcua/issues/458#issuecomment-308508493, or mute the thread https://github.com/notifications/unsubscribe-auth/AZAKco27GzFWPsK3oxdfCw33Av36ONecks5sEB2vgaJpZM4N5oJb .

ghost commented 7 years ago

@zerox1212 It works fine with python3.

I do not know why the above case occurs for some reason. Could you tell me if you know?

zerox1212 commented 7 years ago

At the moment I do not know, but some async libraries are no longer in development which makes Python 2 work, so you should try to use Python 3. Going forward python opcua might drop support for Python 2 because it's becoming difficult to support.