You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
crw-rw---- 1 root gpio 245, 0 Jun 20 01:17 /dev/gpiomem.
When I'm trying to run my program without root permissions, it fails to initialize PiGPIO:
Caused by: java.lang.RuntimeException: Error initialising pigpio (must be run as root!): -1
at uk.pigpioj.PigpioJNI.<init>(PigpioJNI.java:53)
at uk.pigpioj.PigpioJ.autoDetectedImplementation(PigpioJ.java:22)
at com.diozero.internal.provider.pigpioj.PigpioJDeviceFactory.<init>(PigpioJDeviceFactory.java:84)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:780)
But when I run it with sudo, it works fine.
I prefer not to run programs as root when possible. Is there a way to run it as a usual user?
The text was updated successfully, but these errors were encountered:
pigpio when loaded as a shared library requires root access unfortunately. You can run using the sockets interface if need be. Note native PWM works with the built in device factory on 2 pins - I assume you need more than 2.
Hi, I'm trying to use your library with pigpio for native PWM support on Pi 4 B:
Linux raspberrypi 6.1.34-v8+ #1657 SMP PREEMPT Fri Jun 16 12:36:29 BST 2023 aarch64 GNU/Linux
.My user is in the
gpio
group:uid=1000(rankor) gid=1000(rankor) groups=1000(rankor),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),104(input),106(render),108(netdev),995(docker),997(gpio),998(i2c),999(spi)
/dev/gpiomem
has correct permissions:crw-rw---- 1 root gpio 245, 0 Jun 20 01:17 /dev/gpiomem
.When I'm trying to run my program without root permissions, it fails to initialize PiGPIO:
But when I run it with
sudo
, it works fine.I prefer not to run programs as root when possible. Is there a way to run it as a usual user?
The text was updated successfully, but these errors were encountered: