adafruit / Adafruit_CircuitPython_RGB_Display

Drivers for RGB displays for Adafruit CircuitPython.
MIT License
131 stars 52 forks source link

Could not open SPI device #49

Closed mfoos closed 4 years ago

mfoos commented 4 years ago

Hello, I am new to hardware. I am trying to configure the Mini PiTFT 135x240 on a Pi Zero W (https://learn.adafruit.com/adafruit-mini-pitft-135x240-color-tft-add-on-for-raspberry-pi/python-setup), and when I run the rgb_display_minipitfttest.py script, I get the following error:

Could not open SPI device - check if SPI is enabled in kernel! Traceback (most recent call last): File "rgb_display_minipitfttest.py", line 14, in width=135, height=240, x_offset=53, y_offset=40) File "/usr/local/lib/python3.7/dist-packages/adafruit_rgb_display/st7789.py", line 120, in init x_offset=x_offset, y_offset=y_offset, rotation=rotation) File "/usr/local/lib/python3.7/dist-packages/adafruit_rgb_display/rgb.py", line 250, in init super().init(width, height, rotation) File "/usr/local/lib/python3.7/dist-packages/adafruit_rgb_display/rgb.py", line 126, in init self.init() File "/usr/local/lib/python3.7/dist-packages/adafruit_rgb_display/st7789.py", line 123, in init super().init() File "/usr/local/lib/python3.7/dist-packages/adafruit_rgb_display/rgb.py", line 131, in init self.write(command, data) File "/usr/local/lib/python3.7/dist-packages/adafruit_rgb_display/rgb.py", line 266, in write spi.write(bytearray([command])) File "/usr/local/lib/python3.7/dist-packages/busio.py", line 170, in write return self._spi.write(buf, start, end) File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 49, in write self._spi.open(self._port, 0) FileNotFoundError: [Errno 2] No such file or directory

I have gone back through the CircuitPython on Linux and Raspberry Pi guide, and done every step, and the "blinka test" passed on all fronts. The only red flag was that the output from /dev/spi* did not include spidev0.0, only 0.1

Can you offer any guidance?

ladyada commented 4 years ago

did you install the TFT kernel driver? you can't use both!

mfoos commented 4 years ago

I guess that explains it, thanks. I saw the "choose one" but I didn't realize you couldn't do both.

wavesailor commented 4 years ago

I spent hours looking for a solution until I came across this issue - which then explained that you can't use both. It would be nice if someone could update the documentation to clearly indicate this. https://learn.adafruit.com/adafruit-mini-pitft-135x240-color-tft-add-on-for-raspberry-pi/kernel-module-install

ladyada commented 4 years ago

@makermelissa ^ add a warning to guide? you'll need to add same warning for gifguide

makermelissa commented 4 years ago

@ladyada will do. Thanks @wavesailor for letting us know.

makermelissa commented 4 years ago

Warning added.

ladyada commented 4 years ago

mel, warnings go here too https://learn.adafruit.com/adafruit-mini-pitft-135x240-color-tft-add-on-for-raspberry-pi/python-stats https://learn.adafruit.com/adafruit-mini-pitft-135x240-color-tft-add-on-for-raspberry-pi/python-usage

ladyada commented 4 years ago

also maybe add for later to show how to remove the kernel module from /etc/modules and /boot/config

makermelissa commented 4 years ago

Additional warning added.