Without sudo you can not use PWM, nor can you control the internal pull-up/down resistors. (This may have changed, but no-ones told me)
To make wiringPi use non-root access you need to set the enviroment variable.
As of kernels 4.1.7, a user-level GPIO access mechanism is available,
however wiringPi will not use this by default - because at this time
there appears to be issues when trying to program the PWM or clock out‐
put hardware. If you can live without PWM or GPIO clocks and you want
to use the GPIO from a non-root program, then you need to make sure
that the module bcm2835_gpiomem is loaded at boot time. This should
happen automatically when you enable the device tree in raspi-config.
You may also need some additional information in /etc/udev/rules.d/ to
change the mode and ownership of the /dev/gpiomem file. Finally, you
need to set the environment variable WIRINGPI_GPIOMEM. This will go-
away in future releases once the /dev/gpiomem interface is fully opera‐
tional.
Lesezeichen