rpi-ws281x / rpi-ws281x-python

Python library wrapping for the rpi-ws281x library
BSD 2-Clause "Simplified" License
326 stars 103 forks source link

RuntimeError: ws2811_init failed with code -5 (mmap() failed) #38

Closed anwarbashir closed 4 years ago

anwarbashir commented 4 years ago

When I run strip.begin() on the local machine it works, but I am trying to execute from a website, I get

Can't open /dev/mem: Operation not permitted Traceback (most recent call last): File "/home/pi/.edublocks/output.py", line 158, in strip.begin() File "/usr/local/lib/python3.5/dist-packages/rpi_ws281x-4.2.3-py3.5-linux-armv7l.egg/rpi_ws281x/rpi_ws281x.py", line 131, in begin raise RuntimeError('ws2811_init failed with code {0} ({1})'.format(resp, str_resp)) RuntimeError: ws2811_init failed with code -5 (mmap() failed)

I tried changing the permissions for /dev/mem to no avail. Any idea what else I could try?

anwarbashir commented 4 years ago

After further research I discovered that in order to resolve this I require the library to run as an ordinary user. I will open a ticket to see if there is an issue to resolve this?