Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge of pull request #33 broke examples in other Repositories #36

Open
dwaardenburg opened this issue Nov 16, 2023 · 9 comments
Open

Comments

@dwaardenburg
Copy link

The examples in the other repositories that are using this library are outdated due to this pull request.

Downloading the old version of this repository (commit c0733d6) and pip installing that one fixes the issues.

If I may suggest to using a development branch for the currently new versions.
The errors that are generated are not very instructive yet.

@Gadgetoid
Copy link
Member

If I may suggest to using a development branch for the currently new versions. The errors that are generated are not very instructive yet.

It's not in development. The main branch currently tracks release v1.0.0.

I'm dragging a whole ecosystem kicking and screaming into "the future of GPIO" and unfortunately I don't have the time to tread lightly. I would recommend ensuring any examples relying upon this library pin themselves to st7735==0.0.5 until such a time as they're ready to migrate.

There's a bug in gpiodevice which causes very unhelpful errors to be produced when you use an integer - as per the old way - instead of a pin label. Look up the pins you're using and swap them out for "PINX" or "GPIOX" or whatever labels your hardware has when you run gpioinfo (sudo apt install gpiod).

Welcome to the future 😭

@dwaardenburg
Copy link
Author

The libraries are from pimoroni, would it not be worth while to update the setups for at least those ones?

@dwaardenburg
Copy link
Author

I can help out with some PRs, but I just started building mine today. So it might take some time before I can get the new versions working.

@Gadgetoid
Copy link
Member

Gadgetoid commented Nov 16, 2023

The libraries are from pimoroni, would it not be worth while to update the setups for at least those ones?

Oh good fun 😆

I plan to upgrade everything but couldn't do it simultaneously. Part of this is a huge rejig of the python packaging to the latest and greatest. The other part is migration from the defunct (and always rather non-standard) RPi.GPIO over to gpiod and my weird gpiodevice library. Things are already so broken that I totally didn't think how much more broken they could get.

The gpiodevice library - which is, ironically, probably the bit responsible for throwing weird cryptic errors when using a newer st7735 library with older code - is currently a very experimental effort to solve the "gpiod doesn't give you very helpful error messages" problem.

Any feedback at all is useful, I'm being a little bit more reactive than proactive here and I've been distracted from Pi/Python by RP2040/Pico/MicroPython for a couple of years, so I've lost the plot somewhat.

Which libraries/projects were you trying to use?

Edit: A WIP for better surfacing errors - pimoroni/gpiodevice-python#3

@wardbox
Copy link

wardbox commented Nov 29, 2023

FWIW I can't get the scrolling-text example in this repo working. Installing from scratch I ended up with a few issues.

  • Running pip install st7735 doesn't install gpiod or gpiodevice (this might be because I'm in a venv?)
  • Once those are installed, I get
Woah there, suitable gpiochip not found!
PIN21: not found - /dev/gpiochip0 (pinctrl-bcm2835)!

Downgrading to 0.0.5 and switching the strings for dc and backlight to ints does result in the example working.

Let me know if I can provide any other details - don't mean for this to be a "same here" comment, just seemed like the issue wasn't known to be for the examples here as well. Happy to pitch in on a PR as well!

@nemecek-filip
Copy link

@wardbox can you share which changes you made? I am running into this same issue and simply downgrading the library is not enough to get it to work. Thanks!

@wardbox
Copy link

wardbox commented Dec 4, 2023

@wardbox can you share which changes you made? I am running into this same issue and simply downgrading the library is not enough to get it to work. Thanks!

This snippet worked for my setup following the wiring suggestion on the store page:

Here's which pins to connect between your 0.96" LCD Breakout and your Pi's GPIO (note that it's BCM pin numbering):

3-5V to any 5V or 3V pin
CS to BCM 7
SCK to BCM 11
MOSI to BCM 10
DC to BCM 9
BL to BCM 19
GND to any ground pin

import ST7735
    # Create TFT LCD display class.
disp = ST7735.ST7735(
        port=0,
        cs=ST7735.BG_SPI_CS_FRONT,
        dc=9,
        backlight=35,
        rotation=90,
        spi_speed_hz=4000000,
    )

ymmv for the actual pin numbers on cs, dc, and backlight

@Gadgetoid
Copy link
Member

  • Once those are installed, I get
Woah there, suitable gpiochip not found!
PIN21: not found - /dev/gpiochip0 (pinctrl-bcm2835)!

You should run gpioinfo, it's likely instead of 'PIN21' you need 'GPIO9'.

@wardbox
Copy link

wardbox commented Dec 5, 2023

  • Once those are installed, I get
Woah there, suitable gpiochip not found!
PIN21: not found - /dev/gpiochip0 (pinctrl-bcm2835)!

You should run gpioinfo, it's likely instead of 'PIN21' you need 'GPIO9'.

I did try that out as well with no luck :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants