“echo 0 > export” throws a permission denied. I found out that “sudo sh -c 'echo 0 > export” works and I ended up having command line control over the pwm channel. An LED at the output works fine…
However, I want to control the pwm channels from my application and there the export write gives my the following error:
Error Number 30
pwm: Read-only file system
failed to export
Is there a pwm usergroup I need to add the torizon user to in the buildcommands?
Or am I missing something in the general concept?
It sounds like you’re not running this in a container, or are you? I’m asking since you mentioned running “sudo” which isn’t available in a container but is available on the host TorizonCore OS.
As stated in the article there’s a certain way you have to bindmount the PWM interface into as to not have a “read-only” error. Otherwise though there should be no user-groups required for PWM access.
docker run -it --rm -v /sys:/sys pwm-sample
WARNING: The requested image’s platform (linux/arm) does not match the detected host platform (linux/amd64) and no specific platform was requested
Error Number 2
pwm: No such file or directory
failed to export