pimoroni / unicorn-hat

Python library for Unicorn pHAT and HAT. 32 or 64 blinding ws2812 pixels for your Raspberry Pi
https://shop.pimoroni.com/products/unicorn-hat
MIT License
370 stars 131 forks source link

Needs to be 'root' to run? #145

Open fe2o3fish opened 3 years ago

fe2o3fish commented 3 years ago

The following is from my RPi2B (or not 2B) with the latest Raspberry Pi OS (11 Jan '21):

Python 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import unicornhat as uh Can't open /dev/mem: Permission denied Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.7/dist-packages/unicornhat.py", line 35, in ws2812.begin() File "/usr/local/lib/python3.7/dist-packages/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)

This message occurs on other RPi regardless of using the 'wget' Bash script or 'git clone' from here.

ls -l /dev/mem crw-r----- 1 root kmem 1, 1 Jan 20 17:46 /dev/mem

Maybe this is more of an issue with the rpi_ws281x package?