Is it possible to operate GPIO with user authority?

device:odyssey X86J4125
os:Ubuntu server 20.04

Is it possible to operate GPIO with user authority?
I am using python-periphery to control GPIO.
I want to run it with user privileges for my application.
However, python-periphery can only be run as root user.
I consider this problem fatal.
Please let me know your solution.

Resolved.
Added this to udev/rules.d


SUBSYSTEM=="gpio", GROUP="myuser", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
    chown -R root:myuser /sys/class/gpio* && chmod -R 770 /sys/class/gpio*;\
    chown -R root:myuser /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\
    chown -R root:myuser /sys$devpath && chmod -R 770 /sys$devpath\
'"
1 Like