# Piglow on Raspberry Pi 2 help

**URL:** <https://forums.pimoroni.com/t/piglow-on-raspberry-pi-2-help/775>\
**Category:** Raspberry Pi\
**Created:** [August 1, 2015, 4:16pm UTC](https://forums.pimoroni.com/t/piglow-on-raspberry-pi-2-help/775 "2015-08-01T16:16:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbtyke](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dbtyke](https://forums.pimoroni.com/u/dbtyke)\
**Post date:** [August 1, 2015, 4:16pm UTC](https://forums.pimoroni.com/t/piglow-on-raspberry-pi-2-help/775/1 "2015-08-01T16:16:02Z")

</div>

I have just purchased a PiGlow. Before I open the package I just want to know if it works with the Pi 2. If it does work, which pins on the Pi GPIO connector does it go on?

Mick

---

<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:** [August 1, 2015, 11:59pm UTC](https://forums.pimoroni.com/t/piglow-on-raspberry-pi-2-help/775/2 "2015-08-01T23:59:35Z")

</div>

Yes it does work. You need to locate it on the header so that the PiGlow is over the Pi, and it’s on the pins furthest away from the 4 USB ports.

Here’s a super useful image that I nicked from, of all places, an Ali Express shop!

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex016/uploads/pimoroni/original/1X/de7f6c94167e42cfe5c733d33611a48fa2305e76.jpg)

---

<div class="post-metadata">

**Author:** ![dbtyke](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dbtyke](https://forums.pimoroni.com/u/dbtyke)\
**Post date:** [August 14, 2015, 3:06pm UTC](https://forums.pimoroni.com/t/piglow-on-raspberry-pi-2-help/775/3 "2015-08-14T15:06:01Z")

</div>

Many thanks for this. PiGlow is now up and running. I am using the PyGlow libraries to access the device from Python 2.7. However I am getting random ‘IOError [Errno 5]’ errors during script execution. Rerunning a script will cause it to fall over at a different point. Here is the script:-

from PyGlow import PyGlow  
import time  
pyglow = PyGlow()  
while True:  
pyglow.all(0)  
for j in range(10,250,10):  
for i in range(1,19):  
print i,j  
pyglow.led(i,j)  
time.sleep(0.1)

Is this a known problem or maybe a problem with the library.

Mick

---

<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:** [August 14, 2015, 3:12pm UTC](https://forums.pimoroni.com/t/piglow-on-raspberry-pi-2-help/775/4 "2015-08-14T15:12:12Z")

</div>

Have you tried our library? It’s available here, with instructions for getting it installed: [https://github.com/pimoroni/piglow](https://github.com/pimoroni/piglow)

You’re not the first person to encounter such errors with another library- it’d be interesting to see if ours solves your problem too!

---

<div class="post-metadata">

**Author:** ![dbtyke](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dbtyke](https://forums.pimoroni.com/u/dbtyke)\
**Post date:** [August 14, 2015, 8:27pm UTC](https://forums.pimoroni.com/t/piglow-on-raspberry-pi-2-help/775/5 "2015-08-14T20:27:52Z")

</div>

Still the same problem. Some simple repeating Python scripts don’t have this problem.

However, lighting the LEDs in sequence from 1 to 18 doesn’t make them light in physical sequence. Some parts are in sequence but then it hops to another arm or does 3 LEDs in reverse sequence on one arm.

Is this to be expected?

---

<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:** [August 15, 2015, 7:27am UTC](https://forums.pimoroni.com/t/piglow-on-raspberry-pi-2-help/775/6 "2015-08-15T07:27:34Z")

</div>

Someone else pointed this out. Our version of the library doesn’t make any effort to re-order the LEDs in any particular sequence and their placement on the board is necessitated by ease of routing rather than logic. One of those “do this in hardware, then fix it in software” moments.

Are you able to exacerbate the IOErrors by touching/moving the PiGlow when it’s running?
