1

I get this error from the rpi_ws281x library when trying to run as user pi (this is a java wrapper around the library):

16:43:59.060 [main] INFO  com.github.mbelling.ws281x.Ws281xLedStrip - LEDs count: 1, GPIO pin: 18, freq hZ: 800000, DMA: 10, brightness: 255, pwm channel: 0, invert: false, strip type: WS2811_STRIP_GRB, clear on exit: true
16:43:59.142 [main] INFO  com.github.mbelling.ws281x.Ws281xLedStrip - Native library loaded
Can't open /dev/mem: Permission denied
!! Failed to initialize WS2811:
java.lang.RuntimeException: Failed to setup lights driver, result code: WS2811_ERROR_MMAP
    at com.github.mbelling.ws281x.Ws281xLedStrip.init(Ws281xLedStrip.java:234)
    at com.github.mbelling.ws281x.Ws281xLedStrip.<init>(Ws281xLedStrip.java:98)

I already followed all possible steps from here, like setting the permissions of /dev/mem and adding user to group gpio, reboot etc. No success. The problem persists. I cannot run my application as super user, as it would screw up a lot of file access and caches I am writing. I really need to be able to run the WS2811 library as a normal user.

0__
  • 522
  • 8
  • 27

1 Answers1

0

There seems no way around it. A solution with added latency is to run a separate process on root to control the GPIO, and communicate to it from a user process, e.g. using OSC commands.

0__
  • 522
  • 8
  • 27