displayhatmini-python icon indicating copy to clipboard operation
displayhatmini-python copied to clipboard

RuntimeError: Failed to add edge detection

Open ThomasBurgess2000 opened this issue 1 year ago • 0 comments

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.

ThomasBurgess2000 avatar Oct 11 '24 04:10 ThomasBurgess2000