adafruit / Adafruit_CircuitPython_STMPE610

Adafruit CircuitPython driver for the STMPE610 resistive touchscreen controller
MIT License
1 stars 10 forks source link

Error initializing `Adafruit_STMPE610_SPI` #17

Closed alex-terry closed 3 years ago

alex-terry commented 3 years ago

Hardware:

We are getting this error when we try to run the “simple test” code:

Traceback (most recent call last):
  File "../Adafruit_CircuitPython_STMPE610/examples/stmpe610_simpletest.py", line 12, in <module>
    st = Adafruit_STMPE610_SPI(spi, cs)
  File "/home/alex/mtm-chess/env/lib/python3.8/site-packages/adafruit_stmpe610.py", line 278, in __init__
    version = self.get_version
  File "/home/alex/mtm-chess/env/lib/python3.8/site-packages/adafruit_stmpe610.py", line 193, in get_version
    v_1 = self._read_byte(0)
  File "/home/alex/mtm-chess/env/lib/python3.8/site-packages/adafruit_stmpe610.py", line 164, in _read_byte
    return self._read_register(register, 1)[0]
  File "/home/alex/mtm-chess/env/lib/python3.8/site-packages/adafruit_stmpe610.py", line 291, in _read_register
    spi.write(bytearray([register]))
  File "/home/alex/mtm-chess/env/lib/python3.8/site-packages/busio.py", line 317, in write
    return self._spi.write(buf, start, end)
  File "/home/alex/mtm-chess/env/lib/python3.8/site-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 81, in write
    self._spi.mode = self.mode
  File "/home/alex/mtm-chess/env/lib/python3.8/site-packages/Adafruit_PureIO/spi.py", line 355, in mode
    self._ioctl(SPI._IOC_WR_MODE, mode)
  File "/home/alex/mtm-chess/env/lib/python3.8/site-packages/Adafruit_PureIO/spi.py", line 224, in _ioctl
    ioctl(self.handle, ioctl_bytes, arg)
OSError: [Errno 22] Invalid argument

We tried:

Can you please help? :)

ladyada commented 3 years ago

are you running as sudo? are you running the latest version of raspbian OS? did you update all pip packages?

jerryneedell commented 3 years ago

FYI - I just tried the stmpe610_simpletest on an RPI 400 with CS on D21 and it worked as expected. I was using an STMPE610 breakout board with an attached touch screen.

I did not have to use sudo...

alex-terry commented 3 years ago

Thanks for the quick response!!

I am running sudo, I am running on Manjaro ARM release 21.01. All pip packages were freshly installed.

Pip packages: Adafruit-Blinka==6.4.2 adafruit-circuitpython-busdevice==5.0.6 adafruit-circuitpython-stmpe610==1.2.5 Adafruit-PlatformDetect==3.5.0 Adafruit-PureIO==1.1.8 pyftdi==0.52.9 pyserial==3.5 pyusb==1.1.1 rpi-ws281x==4.2.6 RPi.GPIO==0.7.0 sysv-ipc==1.1.0

ladyada commented 3 years ago

manjaro isnt supporte, please use raspbian!