Rpi4 - Persist ownership and permissions of /dev/gpiomem

Ahoi,
i want to run scripts with my default (non root) user using the GPIOs from my Raspberry Pi 4.

I've done some research on the forum and found this helpful post:
https://archived.forum.manjaro.org/t/rpi4-gpio/101189/19
Everything works fine, except of -> after reboot/restart ownership and permission of /dev/gpiomem are reset back to root only.
When i logout and log back in the permissions and so on are correct.
Only on reboot the issue occurs.

My workaround for this issue was to add an autostart systemd service according to this post:
https://archived.forum.manjaro.org/t/xfce-how-to-autostart-a-sudo-script-on-boot/80925/7

Now, on system startup/reboot ownership and permissions of /dev/gpiomem are fine.
But my question is:
Is this the right way to do it? Or what is the correct way? Cause my way is not persisting ownership and permissions - it is reset it to the values i want on every reboot...

OS-Type is 64bit
Raspberry Pi 4
Output of uname -r:
4.19.122-1-MANJARO-ARM

Looks good to me.

ok - thanks :blush:

I think that an udev rule could be another solution :
First you should always create a dedicated group

sudo groupadd gpio
sudo usermod -a -G gpio your_user_name

Then create a file in /etc/udev/rules.d , i.e. 10-gpio.rules

SUBSYSTEMS=="gpiomem",GROUP="gpio",MODE="0660"

This topic was automatically closed after 90 days. New replies are no longer allowed.

Forum kindly sponsored by