Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usermod: group 'gpio' does not exist #65

Open
NadavK opened this issue Jul 15, 2022 · 6 comments
Open

usermod: group 'gpio' does not exist #65

NadavK opened this issue Jul 15, 2022 · 6 comments

Comments

@NadavK
Copy link

NadavK commented Jul 15, 2022

Hardware: OrangePi PC (H3)
OS: Armbian 22.05.3 Jammy with Linux 5.15.48-sunxi
Issue: running sudo usermod -aG gpio produces error: usermod: group "gpio" "does not exist"

I created the group manually (per #47), and continued to follow the instructions but am still not able to access GPIO with non-root user (Permission denied '/sys/class/gpio/gpio7/direction').

Can it be there is a comma error in the instructions?
The instruction use "Right Double Quotation Mark", "Left Double Quotation Mark" and "Left Single Quotation Mark" instead of the more common "Quotation Mark" and "Apostrophe"
I replaced the above with the common chars, but am still not able to obtain non-root access:
SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:gpio /sys/class/gpio/export /sys/class/gpio/unexport ; chmod 220 /sys/class/gpio/export /sys/class/gpio/unexport'" SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:gpio /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value ; chmod 660 /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value'"

@drawpaint
Copy link

Same issue here. So I just run my program as root.

@varna9000
Copy link

same here. Anyone found the problem?

@varna9000
Copy link

varna9000 commented Oct 2, 2022

Ok, just dug a bit more in here. Apparently the docs haven't been updated. According to the instruction here udev rule lines need to be swapped. In the docs the rules are in the wrong order.

@mjeveritt
Copy link

Looking at my O-Pi there definitely isn't a gpio group in /etc/groups .. I am somewhat doubtful that udev creates a group too.

A quick google leads me to https://forum.armbian.com/topic/1886-gpio-access-from-user-space/ which will probably help with the non-root access; you're right - the documentation really should be updated .. I'm sure PR's would be welcome! 😁

Ok, just dug a bit more in here. Apparently the docs haven't been updated. According to the instruction here udev rule lines need to be swapped. In the docs the rules are in the wrong order.

Was this not fixed in #41 ?

The Sphinx docs are generated from the RST in the repo, so technically both should match (unless one needs rebuilding?!)
@rm-hull ?

@DansDesigns
Copy link

DansDesigns commented Dec 25, 2023

dont know if its been fixed as i just encountered this issue today on a NanoPi Neo v1.4 running armbian bookworm 6.1.63..
swapping the lines still doesnt generate the gpio group

@medeiros1
Copy link

I still have the problem with the latest bookworm armbian on an OrangePi PC. I tried adding the udev rules, but it didn't help for me. I am using the WiringOP library and get the following Message from my application when I start as normal user:

wiringPiSetup: Unable to open /dev/mem or /dev/gpiomem: Datei oder Verzeichnis nicht gefunden.
Aborting your program because if it can not access the GPIO
hardware then it most certianly won't work
Try running with sudo? (with sudo it works, but that's not what I want)

rolf@orangepipc:/sys/class/gpio$ ls -l
insgesamt 0
--w--w---- 1 root gpio 4096 9. Feb 13:37 export
lrwxrwxrwx 1 root root 0 9. Feb 13:37 gpiochip0 -> ../../devices/platform/soc/1c20800.pinctrl/gpio/gpiochip0
lrwxrwxrwx 1 root root 0 9. Feb 13:37 gpiochip352 -> ../../devices/platform/soc/1f02c00.pinctrl/gpio/gpiochip352
--w--w---- 1 root gpio 4096 9. Feb 13:37 unexport

rolf@orangepipc:~$ cat /etc/group |grep rolf
sys:x:3:rolf
tty:x:5:rolf
disk:x:6:rolf
kmem:x:15:rolf
dialout:x:20:rolf
sudo:x:27:rolf
audio:x:29:rolf
video:x:44:rolf
plugdev:x:46:rolf
games:x:60:rolf
users:x:100:rolf
systemd-journal:x:999:rolf
input:x:102:rolf
i2c:x:108:rolf
netdev:x:113:rolf
rolf:x:1000:
gpio:x:1001:rolf

I would highly appreciate to find a proper solution

Thanks in advance, Rolf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants