eldarkg / dln-python

Diolan DLN-Series Interface Adapters client Python API. Mirror:
https://code.launchpad.net/~eldar/dln-python/+git/dln-python
GNU Lesser General Public License v3.0
3 stars 1 forks source link

Test script in master does not work #1

Open stiebrs opened 5 years ago

stiebrs commented 5 years ago

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

eldarkg commented 4 years ago

@stiebrs Before use this dln_srv should be run and adapter is plug-in. I don't test in Windows.

sunnybabu10 commented 2 years ago

@eldarkg Traceback (most recent call last): File "C:\Users\kalan\PycharmProjects\pythonProject\Change_SPI mode function.py", line 20, in print(d.get_server_version()) File "C:\Users\kalan\PycharmProjects\pythonProject\device.py", line 52, in get_server_version cmd = build_msg_header(StructBasicCmd.size, MSG_ID_GET_SERVER_VERSION, 0, self._handle) File "C:\Users\kalan\PycharmProjects\pythonProject\common.py", line 78, in build_msg_header return StructMsgHeader.pack(size, msg_id, echo_cnt, handle) struct.error: ushort format requires 0 <= number <= 0xffff

same error can u help me out to resolve it and using window as OS and python 3.10

sunnybabu10 commented 2 years ago

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

eldarkg commented 2 years ago

@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.

stiebrs commented 2 years ago

Hi, @sunnybabu10 No, I didn't manage to get it running. I replaced it with FT232H that has SPI support and is more generic