From 6b28925515f2a1c0d4708dc163008129ba5ce8d6 Mon Sep 17 00:00:00 2001 From: tomatpasser Date: Sun, 17 Jul 2016 03:37:43 +0200 Subject: [PATCH] GPIO pin permission fix Root is currently needed to control GPIO pins. I have tested this on RPi 2 B. The gpio control files in /sys/class/gpio are correctly owned by group 'gpio' with the fix applied. --- scripts/raspberryconfig.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/raspberryconfig.sh b/scripts/raspberryconfig.sh index d5d4061e6..89d6d285b 100755 --- a/scripts/raspberryconfig.sh +++ b/scripts/raspberryconfig.sh @@ -80,6 +80,10 @@ groupadd -f --system gpio chgrp gpio /usr/local/bin/gpio-admin chmod u=rwxs,g=rx,o= /usr/local/bin/gpio-admin +touch /lib/udev/rules.d/60-python-pifacecommon.rules +echo 'KERNEL=="spidev*", GROUP="spi", MODE="0660" +SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c' "'chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio; chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio; chown -R root:gpio /sys/devices/platform/soc/*.gpio/gpio && chmod -R 770 /sys/devices/platform/soc/*.gpio/gpio'"'"' > /lib/udev/rules.d/60-python-pifacecommon.rules + echo "adding volumio to gpio group" sudo adduser volumio gpio