Raspberry Pi: GPIO as a user

To answer your question directly, you need a udev rule or similar to set the permissions on /dev/gpiomem the way you want them.

Googling reveals that the device is actually 0660 root:gpio so the user would need to be in the gpio group to access the pins. This is sane.

However, the gpio group does not exist on core and snappy doesn’t yet allow adding users and groups to the system. This is on the roadmap though and part of Multiple users and groups in snaps (see use case ‘2’), so this will be supported in the gpio-memory-control interface where it would add the group to the system with an ACL to allow users in that group to access the device.

As mentioned elsewhere, the design is complete and on the roadmap, but not prioritized. It is something I’m trying to do in the background, but progress is slow due to prioritized items.

1 Like