-
Notifications
You must be signed in to change notification settings - Fork 1k
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
RF24 without sudo / root access? #194
Comments
Is this what you are looking for: Driving LED stripes as non-root user? Best Regards |
Thanks for the response -- I had tried that months ago and didn't have any luck. I just tried again and still wasn't having any luck and was in the process of replying as such, and I just realized that I never logged out and back in again after adding myself to the Seems to be working great now. If any others come across this thread, my steps on a Raspberry Pi 2 were:
If having issues, you should be able to verify permissions on your spi devices and your group membership:
|
hello mz-fuzzy, I followed your guidance about RF24 with non root, but still out any luck (http://quick2wire.com/non-root-access-to-spi-on-the-pi/). When I run the program as non root account, yield "Segmentation fault". /Dedy Yasriady |
Also getting segfault if not using sudo. Thanks for the steps n8henrie. What should be edited exactly in spi.cpp?
|
Going back to this one again. I beleive I have all it needs for allowing my pi user to use the spi. Still getting segfault however.
I strongly suspect the issue is maybe somewhere else than just spi device permissions. I tried even making pi the owner of the /dev/spidev0.*. Any ideas? |
Have you logged in and logged out since adding yourself to the |
Thanks Henrie. Yes I did restart the rpi many times. No luck. I don't get it! without sudo the program runs up to when it meets that line in spi.cpp
Not sure where to look now. My os is Raspbian Jessie. |
Can you provide more context and information?
|
On my platform the segmentation fault is thrown by vsprintf. Stepping into the code shows that the error occurs when writing to /sys/class/gpio if there are no user rights to that folder. |
I am interested in using the RF24 library on my Raspberry Pi without running as root / sudo, especially since I have a number of other processes (webapps, home automation daemons, etc.) that I'd love to be able to trigger sending or receiving through my NRF24L01+.
Even though I hardly know any c++, I've tried editing BCM2835 to use the new
/dev/gpiomem
interface instead of/dev/mem
, and my efforts over a couple weeks have been totally fruitless. (see also: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/bcm2835/ThGy-PVslE8/9coKpQTlCgAJ). I'm guessing that it may be a wasted effort because RF24 requires SPI, which is not supported by/dev/gpiomem
. Can anybody tell me if this is the case?If so, is there another good way to accomplish this? Perhaps by somehow using the wiringPi SPI library?
Or should I just do some setuid magic and give permissions to the daemon user in question? Any other suggestions? Thanks in advance.
The text was updated successfully, but these errors were encountered: