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

PWM permission problem with new unrooted environment #109

Closed
ulitiy opened this issue Sep 27, 2017 · 3 comments
Closed

PWM permission problem with new unrooted environment #109

ulitiy opened this issue Sep 27, 2017 · 3 comments

Comments

@ulitiy
Copy link

ulitiy commented Sep 27, 2017

debian@beaglebone:~$ ls -la /sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip0/pwm0/enable
-rw-r--r-- 1 root root 4096 Sep 27 19:53 /sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip0/pwm0/enable

I get Error: EACCES: permission denied, open '/sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip0/pwm0/enable' when trying to analogWrite so I've added rules

SUBSYSTEM=="pwm", ACTION=="add", PROGRAM="/bin/sh -c '/bin/chown -R root:pwm /sys/devices/platform/ocp/*.epwmss'"
# Change user permissions to ensure user and group have read/write permissions
SUBSYSTEM=="pwm", ACTION=="add", PROGRAM="/bin/sh -c '/bin/chmod -R ug+rw /sys/devices/platform/ocp/*.epwmss'

but it doesn't persist after reboot. How can I fix that permanently?

@RobertCNelson
Copy link
Owner

This patch:

https://github.com/RobertCNelson/bb-kernel/blob/am33x-v4.11/patches/drivers/pwm/0001-pwm-Create-device-class-for-pwm-channels.patch

or v4.11.x-bone+ kernel or later:

Regards,

@ulitiy
Copy link
Author

ulitiy commented Sep 27, 2017

@RobertCNelson can you tell me where can I find a usable kernel-bonescript pair, please?
I've installed "testing" kernel, 4.13.4-bone1, and apparently pwm paths are not compatible with this kernel.
As for the patch http://elinux.org/BeagleBoardLinuxKernel looks a bit complicated, I'd better go for an older version with root-env but the one that works. Debian 8.7 2017-03-19 4GB SD LXQT can you tell me please if this version is reliable?

@RobertCNelson
Copy link
Owner

@ulitiy and you see why i haven't backported that patch to v4.4.x/v4.9.x..

bonescript needs to be patched. (and also the adafruit library), you'll notice in the pwm patch it's only 3 more characters. creating issue here:

jadonk/bonescript#156

Regards,

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

No branches or pull requests

2 participants