beyondscreen / node-rpi-ws281x-native

native bindings to drive WS2811 (or WS2812) LED-Controllers on a Raspberry Pi
MIT License
224 stars 101 forks source link

Root-less usage with /dev/gpiomem #101

Closed madc closed 4 years ago

madc commented 4 years ago

I read through #19 and was wondering, if it would now be possible to use /dev/gpiomem instead of /dev/mem. I found this discussion, where it seems to be possible for python.

There are some Node modules as well, that are able to use GPIO without root via /dev/gpiomem:

usefulthink commented 4 years ago

that discussion doesn't talk about configuring DMA-transfers for spi/pcm/pwm, which is why I believe the gpiomem-device alone might not be enough.

Also, this module doesn't use /dev/mem at all, it is the upstream-dependency (https://github.com/jgarff/rpi_ws281x) that is doing that. If anywhere, it would need to be fixed there..

usefulthink commented 4 years ago

note: it appears that it should be possible to use the SPI-mode without root-privilege: https://github.com/jgarff/rpi_ws281x/pull/257

Not sure though if that commit is already in the latests @next release.