-
Notifications
You must be signed in to change notification settings - Fork 218
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
Access to GPIO and PWM as non-root user not functioning #137
Comments
@nicnicknicky thanks for posting. I've just returned from a conference this past week and will check this out |
@nicnicknicky thank you, I've tested your udev rule and script and added to this repo in a new |
I think the real solution is actually a part of this issue: beagleboard/linux#124 |
This is a closed issue, but for those landing here and thinking the workaround works, I found out that at least for a 4.4.x kernel it doesn't for PWM. It seems that the PWM device tree attributes (
return no results, as the The previous comment refers to the kernel issue as the proper fix. The last comment on that issue refers to the landing of the patch being blocked on fixes required on adafruit-beaglebone-io-python (and bonescript). However, I don't see any related open issue here, perhaps it's fallen off the radar? |
it's created after you export 0 (or 1) in the pwm system node. only v4.11.x+ has the udev patch for permissions. (didn't want to break older userspace, we still need to fix bonescript before i backport that patch to v4.4.x/v4.9.x) Regards, |
Aha, thanks @RobertCNelson! So I guess in the meantime, for <4.11 kernels the bit to export 0 should be added to the workaround script for it to work. |
@RobertCNelson would a similar patch be required for the quadrature encoder inputs? I wrote a udev rule based on the existing
I created a new group,
And I finally rebooted, but the ownership/permissions didn't get changed after reboot. That's on a 4.4.x kernel:
|
Hello, I encountered several issues when trying to use the GPIO and PWM as a non-root user. The solutions I have seen in other similar issues have not used any concrete solutions and most were for kernels 3.xx.
Right before posting this issue, I managed to make a scrappy solution enable the GPIOs with PWM to work when my ownership is changed to non-root user. This solution was based off reading various threads and I pieced together my own which happened to work.
This was my main reference.
Essentially my contribution was that I went to look at how gpio and pwm were called in the different libraries and implemented permission changes on those files.
My kernel version:
I am still new to quite new to linux so can I verify if I am actually doing the right thing to get it to work?
I have a user nick which is part of the group digital
Create custom udev rule in
/etc/udev/rules.d/80-gpio-permissions.rules
Create script in
/usr/local/bin/udev-gpio-permissions.sh
Ensure the above file is executable
Run
udevadm control --reload-rules
Reboot and test!
The text was updated successfully, but these errors were encountered: