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

RuntimeError: Failed to add edge detection #21

Open
ThomasBurgess2000 opened this issue Oct 11, 2024 · 0 comments
Open

RuntimeError: Failed to add edge detection #21

ThomasBurgess2000 opened this issue Oct 11, 2024 · 0 comments

Comments

@ThomasBurgess2000
Copy link

When running the pwm-backlight.py and pygame-button-interrupt.py demos, I got the following error:

Traceback (most recent call last):
  File "/home/thomas/displayhatmini/displayhatmini-python/examples/pwm-backlight.py", line 43, in <module>
    displayhatmini.on_button_pressed(button_callback)
  File "/home/thomas/displayhatmini/env/lib/python3.11/site-packages/displayhatmini/__init__.py", line 99, in on_button_pressed
    GPIO.add_event_detect(pin, GPIO.BOTH, callback=callback)
RuntimeError: Failed to add edge detection

I was able to solve it by running:

sudo apt remove python3-rpi.gpio
python -m pip install rpi-lgpio

(while my venv was active) (source).

Perhaps worth updating at least the readme if this is not directly fixable in the examples.

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

1 participant