Skip to content

RuntimeError: Failed to add edge detection #21

@ThomasBurgess2000

Description

@ThomasBurgess2000

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions