bugfix: Random occurence of Failed to add edge detection #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.