Last active
August 26, 2017 04:20
-
-
Save aztecrex/a5b3f5fe0340085da2fdaf4efd253f11 to your computer and use it in GitHub Desktop.
C.H.I.P. GPIO as normal user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This allows anyone in the "gpio" group to do GPIO operations | |
------ /etc/udev/rules.d/98-gpio-group.rules | |
# UDEV RULE TO CHANGE GPIO GROUP | |
# INITIALLY WRITTEN BY IOT_STEVE | |
# UPDATED BY XTACOCOREX | |
# THIS REQUIRES change_gpio_perms.sh TO BE INSTALLED IN /usr/local/bin/ | |
SUBSYSTEM=="gpio", PROGRAM="/usr/local/bin/change_gpio_perms.sh" | |
------- /usr/local/bin/change_gpio_perms.sh | |
#!/bin/sh | |
# CHANGE PERMISSIONS AND GROUP FOR THE XIO-P* PINS | |
/bin/chown -R root:gpio /sys/devices/platform/soc\@01c00000/1c2b400.i2c/i2c-2/2-0038/gpio | |
/bin/chmod -R ug+rw /sys/devices/platform/soc\@01c00000/1c2b400.i2c/i2c-2/2-0038/gpio | |
# CHANGE PERMISSIONS AND GROUP FOR THE R8 PINS | |
/bin/chown -R root:gpio /sys/devices/platform/soc@01c00000/1c20800.pinctrl/gpio | |
/bin/chmod -R ug+rw /sys/devices/platform/soc@01c00000/1c20800.pinctrl/gpio |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment