ddetommaso / TobiiGlassesPyController

Tobii Pro Glasses 2 Python controller
GNU General Public License v3.0
57 stars 29 forks source link

IPv6 Interface name in socket (and quick fix) #36

Open whyhowie opened 9 months ago

whyhowie commented 9 months ago

Hello, I was trying to connect my Tobii glasses to the computer via ethernet, and after putting in the correct device IPv6 I encountered this error: [DEBUG]: Connecting to the Tobii Pro Glasses 2 ... Traceback (most recent call last): File "E:\noticeability-repo\other-python-code\unity_tobii_stream.py", line 25, in <module> tobiiglasses = TobiiGlassesController(ipv6_address) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\tobiiglassesctrl\controller.py", line 96, in __init__ if self.__connect__(timeout = timeout) is False: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\tobiiglassesctrl\controller.py", line 104, in __connect__ self.data_socket = self.__mksock__() ^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\tobiiglassesctrl\controller.py", line 188, in __mksock__ sock.setsockopt(socket.SOL_SOCKET, 25, self.iface_name+'\0') TypeError: a bytes-like object is required, not 'str'

I went through controller.py, and it seems that for line 188, self.iface_name+'\0' should beself.iface_name.encode()` instead for proper byte-like encoding.