clssn / numato-gpio

Python API for Numato GPIO Expanders
MIT License
4 stars 6 forks source link

Undiscovered Device / Unexpected result #26

Closed will-riley closed 1 year ago

will-riley commented 1 year ago

Python 3.10.9 numato-gpio 0.11.0.dev0 linux

Trying to work with a USB 16ch gpio board...no luck so far. Talks fine using "screen /dev/ttyACM0 19200", user in dialout group. Thanks for any assistance

(within python script) dev = gpio.NumatoUsbGpio("/dev/ttyACM0")

Traceback (most recent call last): File "/home/zoltan/PycharmProjects/secborg/secborg.py", line 6, in dev = gpio.NumatoUsbGpio("/dev/ttyACM0") File "/home/zoltan/PycharmProjects/secborg/venv/lib/python3.10/site-packages/numato_gpio/init.py", line 125, in init raise NumatoGpioError( numato_gpio.NumatoGpioError: Device /dev/ttyACM0 doesn't answer like a numato device: Query ''ver'' returned unexpected result 'A0M10.01'. Expected a 32 bit integer in hexadecimal notation.

$ python -m numato_gpio Discovered devices: (None)

$ python -m numato_gpio.troubleshoot /dev/ttyACM0 16 Testing device /dev/ttyACM0 with pyserial==3.5

writing to /dev/ttyACM0: b'id get\r' response (19 byte): b'id get\n\r00000000\n\r>' 0x69 0x64 0x20 0x67 0x65 0x74 0xa 0xd 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0xa 0xd 0x3e

writing to /dev/ttyACM0: b'ver\r' response (16 byte): b'ver\n\rA0M10.01\n\r>' 0x76 0x65 0x72 0xa 0xd 0x41 0x30 0x4d 0x31 0x30 0x2e 0x30 0x31 0xa 0xd 0x3e

writing to /dev/ttyACM0: b'gpio iomask ffff\r' response (19 byte): b'gpio iomask ffff\n\r>' 0x67 0x70 0x69 0x6f 0x20 0x69 0x6f 0x6d 0x61 0x73 0x6b 0x20 0x66 0x66 0x66 0x66 0xa 0xd 0x3e

writing to /dev/ttyACM0: b'gpio iomask 0000\r' response (19 byte): b'gpio iomask 0000\n\r>' 0x67 0x70 0x69 0x6f 0x20 0x69 0x6f 0x6d 0x61 0x73 0x6b 0x20 0x30 0x30 0x30 0x30 0xa 0xd 0x3e

writing to /dev/ttyACM0: b'gpio readall\r' response (21 byte): b'gpio readall\n\rFFFE\n\r>' 0x67 0x70 0x69 0x6f 0x20 0x72 0x65 0x61 0x64 0x61 0x6c 0x6c 0xa 0xd 0x46 0x46 0x46 0x45 0xa 0xd 0x3e

writing to /dev/ttyACM0: b'gpio notify off\r' response (40 byte): b'gpio notify off\n\rGpio Notify Disabled\n\r>' 0x67 0x70 0x69 0x6f 0x20 0x6e 0x6f 0x74 0x69 0x66 0x79 0x20 0x6f 0x66 0x66 0xa 0xd 0x47 0x70 0x69 0x6f 0x20 0x4e 0x6f 0x74 0x69 0x66 0x79 0x20 0x44 0x69 0x73 0x61 0x62 0x6c 0x65 0x64 0xa 0xd 0x3e

will-riley commented 1 year ago

Closing, duplicate issue