-
Notifications
You must be signed in to change notification settings - Fork 117
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
EACCES in setup() caused by race #111
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm experiencing intermittent but fairly frequent 'Permission denied' (EACCES) errors in gpio.setup() on my Raspberry Pi Zero W. My program is running as the default 'pi' user on Rasbian 10 (buster). The pi user is a member of the 'gpio' group.
The failure is always the fs.openSync() call in listen(). listen() is called immediately after setDirection(), which makes me think we're hitting the race against udev described here: https://stackoverflow.com/questions/39524234/bug-with-writing-to-file-in-linux-sys-class-gpio
I suspect that the race is more of an issue on slower hardware like the Pi Zero. This small test program usually reproduces the issue for me fairly quickly:
Output:
Adding retry logic to the call to listen works around the problem for me. I'll put up a PR with my fix.
The text was updated successfully, but these errors were encountered: