File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 3
3
4
4
pinctrl is a more powerful replacement for raspi-gpio, a tool for displaying
5
5
and modifying the GPIO and pin muxing state of a system. It accesses the
6
- hardware directly, bypassing the kernel drivers, and as such requires root
7
- privilege (run with "sudo").
6
+ hardware directly, bypassing the kernel drivers, and as such requires the
7
+ necessary privilege. By default, root access is required (i.e. run with
8
+ "sudo"), but with a suitable udev rule to change the ownership of
9
+ /dev/gpiomem* (as found in RPiOS) this can be relaxed to group membership,
10
+ e.g. group "gpio".
8
11
9
12
The improvements over raspi-gpio include:
10
13
Original file line number Diff line number Diff line change @@ -69,7 +69,8 @@ static void usage(void)
69
69
printf ("Running %s with the help argument prints this help.\n" , name );
70
70
printf ("%s can get and print the state of a GPIO (or all GPIOs)\n" , name );
71
71
printf ("and can be used to set the function, pulls and value of a GPIO.\n" );
72
- printf ("%s must be run as root.\n" , name );
72
+ printf ("%s must be run as root (or as a member of group 'gpio'\n" , name );
73
+ printf ("on RPiOS).\n" );
73
74
printf ("Use:\n" );
74
75
printf (" %s [-p] [-v] get [GPIO]\n" , name );
75
76
printf ("OR\n" );
@@ -674,7 +675,7 @@ int main(int argc, char *argv[])
674
675
if (ret )
675
676
{
676
677
if (ret == EACCES && geteuid ())
677
- printf ("Must be root\n" );
678
+ printf ("Must be root (or group 'gpio' on RPiOS) \n" );
678
679
else
679
680
printf ("Failed to mmap gpiolib - %s\n" , strerror (ret ));
680
681
return -1 ;
You can’t perform that action at this time.
0 commit comments