Unicorn Hat on RPi v2 throws RuntimeError and DAM error


#1

On RPi v2, installed Raspbian and my Unicorn Hat with python script

pi@raspberrypi ~/Pimoroni/unicornhat $ pwd
/home/pi/Pimoroni/unicornhat

$ sudo python simple.py 
Can't open device file /tmp/mailbox-7729: Permission denied
Can't open device file /tmp/mailbox-7729: Permission denied
Can't open device file /tmp/mailbox-7729: Permission denied
Traceback (most recent call last):
  File "simple.py", line 3, in <module>
    import unicornhat as UH
  File "/usr/local/lib/python2.7/dist-packages/unicornhat.py", line 13, in <module>
    ws2812.begin()
  File "/usr/local/lib/python2.7/dist-packages/neopixel.py", line 100, in begin
    raise RuntimeError('ws2811_init failed with code {0}'.format(resp))
RuntimeError: ws2811_init failed with code -1
DMA Error: 76d362f0
munmap error -1

Any pointers are welcome.


#2

I swear someone had a solution to this somewhere on the forums- I’ll see if I can dredge it up because the search box is failing me!

I don’t believe you’re doing anything wrong.


#3

I’m not sure if this is related, but it sounds similar:

http://forums.pimoroni.com/t/raspberry-pi-2-what-works-and-what-doesnt/352/71?u=gadgetoid

Unfortunately I don’t have a Pi in front of me right now to test this theory, or provide instructions for fixing it!


#4

I tried again and it resolved by itself.

I reckon this was most likely a non-issue.

Thanks for trying to help


#5

From memory i saw something similar to this. And resolved it this way, whether correct or not.
In short, when installing the RPI Unicorn hat library i forgot to run the install with SUDO. As such it did not have the correct permissions to run properly. Might be wrong, or unrelated, might even be that when i re-installed it just updated or solved it… but was somehting i experienced.