adafruit / Adafruit_CircuitPython_RGB_Display

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

/dev/spidev0.0 does not exist #86

Closed dima72 closed 3 years ago

dima72 commented 3 years ago
Traceback (most recent call last):
  File "rgb_display_minipitfttest.py", line 14, in <module>
    board.SPI(),
  File "/usr/local/lib/python3.7/dist-packages/board.py", line 186, in SPI
    return busio.SPI(SCLK, MOSI, MISO)
  File "/usr/local/lib/python3.7/dist-packages/busio.py", line 186, in __init__
    self._spi = _SPI(portId)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 22, in __init__
    self._spi = spi.SPI(device=(portid, 0))
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/spi.py", line 165, in __init__
    raise IOError("{} does not exist".format(device))
OSError: /dev/spidev0.0 does not exist

running rgb_display_minipitfttest.py after installing adafruit-circuitpython-rgb-display, spidev, ttf-dejavu, python3-numpy

please help

caternuson commented 3 years ago

Make sure you've enabled SPI: https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi#enable-i2c-and-spi-2993390-7

dima72 commented 3 years ago

Thank you Nelson,

can you suggest if I'm missing something else, looking at the picture image

thanks in advance,

caternuson commented 3 years ago

Looks like it's working in terms of hardware. Is your concern now the glitchy background?

makermelissa commented 3 years ago

Looks like you're running a 240x135 demo on a 240x240 display.

dima72 commented 3 years ago

The problem is, even if I send 240x240 into constructor, the image comes as 240x135. Do I use right st7789.ST7789 constructor?

# Create the ST7789 display:
disp = st7789.ST7789(
    spi,
    cs=cs_pin,
    dc=dc_pin,
    rst=reset_pin,
    baudrate=BAUDRATE,
    width=240,
    height=240,
    x_offset=0, #53
    y_offset=10, #40
)

image

ladyada commented 3 years ago

try tweaking the y offset!

caternuson commented 3 years ago

see here: https://learn.adafruit.com/adafruit-mini-pitft-135x240-color-tft-add-on-for-raspberry-pi/python-stats#modifications-for-the-1-dot-3-display-3066993-6

dima72 commented 3 years ago

cool. y_offset=80 works fine. thanks for your support!