mje-nz / python_natnet

Python NatNet client library, supporting protocol version 3 (Motive version 2.0).
BSD 3-Clause "New" or "Revised" License
14 stars 15 forks source link

OSError: [Errno 22] Invalid argument #4

Open Raphtor opened 2 years ago

Raphtor commented 2 years ago

I am getting an OSError when running the example. It evidently can see the server, but can't open the socket?

python3 natnet-client-demo.py --server 192.168.0.100
Connecting to 192.168.0.100
Getting server info
Server application: Motive
Server version: Version(major=2, minor=2, build=0, revision=0)
Traceback (most recent call last):
  File "natnet-client-demo.py", line 97, in <module>
    main()
  File "natnet-client-demo.py", line 90, in main
    app = ClientApp.connect('fake' if args.fake else args.server, args.rate, args.quiet)
  File "natnet-client-demo.py", line 35, in connect
    client = natnet.Client.connect(server_name)
  File "/home/swarmtestbed/lvctestbed/ros2_ws/src/python_natnet/src/natnet/comms.py", line 418, in connect
    return cls._simple_connect(server, logger, timeout)
  File "/home/swarmtestbed/lvctestbed/ros2_ws/src/python_natnet/src/natnet/comms.py", line 401, in _simple_connect
    return cls._setup_client(conn, server_info, logger)
  File "/home/swarmtestbed/lvctestbed/ros2_ws/src/python_natnet/src/natnet/comms.py", line 344, in _setup_client
    conn.bind_data_socket(server_info.connection_info.multicast_address,
  File "/home/swarmtestbed/lvctestbed/ros2_ws/src/python_natnet/src/natnet/comms.py", line 60, in bind_data_socket
    self._data_socket.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
OSError: [Errno 22] Invalid argument
mje-nz commented 2 years ago

That sounds like a problem with your network interface: https://stackoverflow.com/questions/19403635/python-setsockopt-invalid-argument-with-ip-add-membership

Do the official SDK samples work on your machine?