Hello, No access to GPIO without root. It is necessary for Moonraker.
in group
grep gpio /etc/group
gpio:x:1001:isp
isp@3dprinter:~$ echo 10 /sys/class/gpio/export
10 /sys/class/gpio/export
but
isp@3dprinter:~$ ls -lL /sys/class/gpio/
total 0
-rwxrwx--- 1 root gpio 4096 сен 25 23:10 export
drwxr-xr-x 3 root root 0 сен 25 23:10 gpiochip0
drwxr-xr-x 3 root root 0 сен 25 23:10 gpiochip352
-rwxrwx--- 1 root gpio 4096 сен 25 23:10 unexport
and
isp@3dprinter:~$ sudo cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-223, parent: platform/1c20800.pinctrl, 1c20800.pinctrl:
gpio-17 ( |orangepi:red:status ) out lo
gpio-20 ( |reg_vcc_wifi ) out hi
gpio-166 ( |cd ) in lo ACTIVE LOW
gpio-204 ( |usb0_id_det ) in hi IRQ
gpiochip1: GPIOs 352-383, parent: platform/1f02c00.pinctrl, 1f02c00.pinctrl:
gpio-358 ( |vdd-cpux ) out lo
gpio-359 ( |reset ) out hi ACTIVE LOW
gpio-362 ( |orangepi:green:pwr ) out hi
if i make
echo 10 | sudo tee /sys/class/gpio/export
then all ok
isp@3dprinter:~$ sudo cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-223, parent: platform/1c20800.pinctrl, 1c20800.pinctrl:
gpio-10 ( |sysfs ) in lo
gpio-17 ( |orangepi:red:status ) out lo
gpio-20 ( |reg_vcc_wifi ) out hi
gpio-166 ( |cd ) in lo ACTIVE LOW
gpio-204 ( |usb0_id_det ) in hi IRQ
gpiochip1: GPIOs 352-383, parent: platform/1f02c00.pinctrl, 1f02c00.pinctrl:
gpio-358 ( |vdd-cpux ) out lo
gpio-359 ( |reset ) out hi ACTIVE LOW
gpio-362 ( |orangepi:green:pwr ) out hi
rc.local:
chown -R root:gpio /sys/class/gpio
chmod -R 770 /sys/class/gpio
99-gpio.rules
SUBSYSTEM=="gpio", PROGRAM="/bin/sh -c 'chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio'"
SUBSYSTEM=="gpio", PROGRAM="/bin/sh -c 'chown -R root:gpio /sys/devices/platform/soc/1c20800.pinctrl/gpiochip0/gpio && chmod -R 770 /sys/devices/platform/soc/1c20800.pinctrl/gpiochip0/gpio'"
What am I doing wrong? I need to access GPIO without root to work with Moonraker. Thanks!