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

avoid root permissions? #22

Open
fquirin opened this issue Apr 4, 2022 · 2 comments
Open

avoid root permissions? #22

fquirin opened this issue Apr 4, 2022 · 2 comments

Comments

@fquirin
Copy link

fquirin commented Apr 4, 2022

Using the library requires root permissions aka sudo or you will get:

...$ node led-control.js
Can't open /dev/mem: Permission denied
Segmentation fault

My hope was that /dev/gpiomem is enough (see this issue) so I made sure my user has access: sudo usermod -a -G gpio $USER but it doesn't seem to work. Still the same error.

Is it because of PWM? I found this but I'm not sure if it plays any role here.

@krisdahl
Copy link

Yeah so I've had same issue. If you want PWM you need root access. But you can use SPI on like port 10 and you won't need root access, just to be part of the gpio group.

@fquirin
Copy link
Author

fquirin commented Nov 19, 2022

I think that was what I did. It was a bit messy to get it right though if I remember correctly :-|. Since I had 'spi-device' already as dependency I sticked with that in the end.

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