Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
udev rule to set RPi GPIO group on Arch Linux ARM
SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/bin/sh -c 'chgrp -R gpio /sys/class/gpio /sys/devices/platform/soc/*.gpio && chmod -R g+rw /sys/class/gpio /sys/devices/platform/soc/*.gpio'"

This comment has been minimized.

Copy link

commented Aug 20, 2019

can you please help me to implement the code?
I understand that this's a rule to create a gpio group with permission to modify gpio ports, I've created the rule in /etc/udev/rules.d/10-alarm-gpio.rules , next I've:
$groupadd gpio
$usermod -a -G gpio alarm
but when I try to open a gpio port as not root user using python-periphery library, ODROID-XU4 hardware and Archlinux ARMv7, I get the following error:
periphery.gpio.GPIOError: [Errno 13] Setting GPIO direction: Permission denied
The code work properly with SUDO permission and root user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.