asb / spindle

http://asbradbury.org/projects/spindle/
Other
185 stars 43 forks source link

change group permissions for /sys/class/gpio #100

Closed kazzle101 closed 10 years ago

kazzle101 commented 12 years ago

There is a problem accessing the GPIO as a normal user. For hardware projects such as blinking LED's, activating motors, controlling volcanic activity, the program needs to be run with elevated rights.

I would like to see the GPIO added to the dialout group. Then any user in the dialout group could access the GPIO in the same way that you can with the UART.

I have tried adding a udev rule, but to no avail. eg, creating a file: /etc/udev/rules.d/91-gpio.rules that contains:

KERNEL=="gpio", MODE:="0660", GROUP:="dialout"

(and numerous variations of the above) thanks K.

asb commented 12 years ago

This seems like a reasonable request, but as it stands I've not managed to get any further than you have http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=9667

kazzle101 commented 12 years ago

Good news: Someone has found a udev rule that works: SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/bin/sh -c 'chown -R pi:pi /sys%p'" http://www.raspberrypi.org/phpBB3/viewtopic.php?p=198148#p198148

Bad News: RPi.GPIO now uses /dev/mem instead

I tried adding my user to the kmem group, and changing the permissions to 0666 but it still says Try running as root!

K.

asb commented 10 years ago

A gpio group is setup now with appropriate udev rules (as a side-effect of installing the piface packages in fact).