# Unicorn Hat on RPi v2 throws RuntimeError and DAM error

**URL:** <https://forums.pimoroni.com/t/unicorn-hat-on-rpi-v2-throws-runtimeerror-and-dam-error/510>\
**Category:** Support\
**Created:** [March 2, 2015, 4:03pm UTC](https://forums.pimoroni.com/t/unicorn-hat-on-rpi-v2-throws-runtimeerror-and-dam-error/510 "2015-03-02T16:03:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joelmaranhao](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/joelmaranhao/32/174_2.png) [@joelmaranhao](https://forums.pimoroni.com/u/joelmaranhao)\
**Post date:** [March 2, 2015, 4:03pm UTC](https://forums.pimoroni.com/t/unicorn-hat-on-rpi-v2-throws-runtimeerror-and-dam-error/510/1 "2015-03-02T16:03:35Z")

</div>

On RPi v2, installed Raspbian and my [Unicorn Hat](http://shop.pimoroni.com/products/unicorn-hat) with [python script](https://github.com/pimoroni/unicorn-hat)

```
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.

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [March 2, 2015, 4:09pm UTC](https://forums.pimoroni.com/t/unicorn-hat-on-rpi-v2-throws-runtimeerror-and-dam-error/510/2 "2015-03-02T16:09:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [March 2, 2015, 6:16pm UTC](https://forums.pimoroni.com/t/unicorn-hat-on-rpi-v2-throws-runtimeerror-and-dam-error/510/3 "2015-03-02T18:16:32Z")

</div>

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](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!

---

<div class="post-metadata">

**Author:** ![joelmaranhao](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/joelmaranhao/32/174_2.png) [@joelmaranhao](https://forums.pimoroni.com/u/joelmaranhao)\
**Post date:** [March 3, 2015, 11:43am UTC](https://forums.pimoroni.com/t/unicorn-hat-on-rpi-v2-throws-runtimeerror-and-dam-error/510/4 "2015-03-03T11:43:15Z")

</div>

I tried again and it resolved by itself.

I reckon this was most likely a non-issue.

Thanks for trying to help

---

<div class="post-metadata">

**Author:** ![nevsie](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/nevsie/32/165_2.png) [@nevsie](https://forums.pimoroni.com/u/nevsie)\
**Post date:** [March 3, 2015, 11:44am UTC](https://forums.pimoroni.com/t/unicorn-hat-on-rpi-v2-throws-runtimeerror-and-dam-error/510/5 "2015-03-03T11:44:44Z")

</div>

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.
