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

bugfix: Random occurence of Failed to add edge detection #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jimd80
Copy link

@jimd80 jimd80 commented Jun 25, 2021

Sometimes a GPIO pin will fail to setup (RuntimeError: Failed to add edge detection). It was hard to know which pin gave the error.
With this improvement the problematic pin number is logged and the plugin will continue to work for all other pins instead of stopping.
Also try multiple times to set the event, as the error can occur randomly due to an error in PRi.GPIO, even if the pin is not in use.
Tested on a Rpi Zero W with latest Raspbian-lite.

jimd80 added 2 commits June 25, 2021 14:32
Sometimes a GPIO pin will fail to setup (RuntimeError: Failed to add edge detection). It was hard to know which pin gave the error.
With this improvement the problematic pin number is logged and the plugin will continue to work for all other pins instead of stopping.
Sometimes a GPIO pin will fail to setup (RuntimeError: Failed to add edge detection). It was hard to know which pin gave the error. 
With this improvement the problematic pin number is logged and the plugin will continue to work for all other pins instead of stopping.
Also try multiple times to set the event, as the error can occur randomly due to an error in PRi.GPIO, even if the pin is not in use.
Tested on a Rpi Zero W with latest Raspbian-lite.
@jimd80 jimd80 changed the title Update frontend.py bugfix: Random occurence of Failed to add edge detection Jun 25, 2021
@Gadgetoid
Copy link
Member

I think this library needs to ditch RPi.GPIO and switch to libgpiod, since the former no longer works on Pi 5 without a compatibility shim. That should fix this particular GPIO woe, though it'll probably unleash others.

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

Successfully merging this pull request may close these issues.

2 participants