Open stiebrs opened 5 years ago
@stiebrs Before use this dln_srv should be run and adapter is plug-in. I don't test in Windows.
@eldarkg
Traceback (most recent call last):
File "C:\Users\kalan\PycharmProjects\pythonProject\Change_SPI mode function.py", line 20, in
same error can u help me out to resolve it and using window as OS and python 3.10
File "C:\Users\user\Downloads\dln-python\test.py", line 11, in print(d.get_server_version()) File "C:\Users\user\Downloads\dln-python\dln\device.py", line 70, in get_server_version cmd = build_msg_header(StructBasicCmd.size, MSG_ID_GET_SERVER_VERSION, 0, self._handle) File "C:\Users\user\Downloads\dln-python\dln\common.py", line 92, in build_msg_header return StructMsgHeader.pack(size, msg_id, echo_cnt, handle) struct.error: ushort format requires 0 <= number <= 0xffff
Python 3.7.2
Hi @stiebrs If you find solution can u share with me plss
@sunnybabu10 The message say that range of input parameter is incorrect (more than ushort). You can try to check this undocumented code https://github.com/eldarkg/dln-python/blob/c2f0abc5f230f6aeb5ff313c19567b8375433109/dln/client.py#L114 . Check range of 'handle' parameter.
Hi, @sunnybabu10 No, I didn't manage to get it running. I replaced it with FT232H that has SPI support and is more generic
File "C:\Users\user\Downloads\dln-python\test.py", line 11, in
print(d.get_server_version())
File "C:\Users\user\Downloads\dln-python\dln\device.py", line 70, in get_server_version
cmd = build_msg_header(StructBasicCmd.size, MSG_ID_GET_SERVER_VERSION, 0, self._handle)
File "C:\Users\user\Downloads\dln-python\dln\common.py", line 92, in build_msg_header
return StructMsgHeader.pack(size, msg_id, echo_cnt, handle)
struct.error: ushort format requires 0 <= number <= 0xffff
Python 3.7.2