# Ledshim

**URL:** <https://forums.pimoroni.com/t/ledshim/11919>\
**Category:** Support\
**Created:** [October 14, 2019, 5:30am UTC](https://forums.pimoroni.com/t/ledshim/11919 "2019-10-14T05:30:15Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![raspgraph](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@raspgraph](https://forums.pimoroni.com/u/raspgraph)\
**Post date:** [October 14, 2019, 5:30am UTC](https://forums.pimoroni.com/t/ledshim/11919/1 "2019-10-14T05:30:15Z")

</div>

Hi Loaded software as described on your website:-  
sudo curl [https://get.pimoroni.com/ledshim](https://get.pimoroni.com/ledshim) | bash  
then  
cd Pimoroni

cd ledshim  
cd examples

python candle.py  
produces error:-

Traceback (most recent call last):  
File “candle.py”, line 12, in   
import ledshim  
ImportError: No module named ‘ledshim’  
?  
Help

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [October 14, 2019, 9:00am UTC](https://forums.pimoroni.com/t/ledshim/11919/2 "2019-10-14T09:00:20Z")

</div>

Did you clip and past the one line in, or type it by hand?  
Did it run OK when you hit enter?  
If you haven’t already, I’d reboot and try the example again.

---

<div class="post-metadata">

**Author:** ![raspgraph](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@raspgraph](https://forums.pimoroni.com/u/raspgraph)\
**Post date:** [October 15, 2019, 2:47pm UTC](https://forums.pimoroni.com/t/ledshim/11919/3 "2019-10-15T14:47:29Z")

</div>

I did cut and past. Is there a problem with that?  
I have done all the processes 3 times  
It can still not find module ledshim from either python2 or python3  
However if I use the terminal and get to led shim…master I can import led shim without error through python shell.  
But if I try to run an example it cannot find it?

---

<div class="post-metadata">

**Author:** ![raspgraph](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@raspgraph](https://forums.pimoroni.com/u/raspgraph)\
**Post date:** [October 15, 2019, 3:18pm UTC](https://forums.pimoroni.com/t/ledshim/11919/4 "2019-10-15T15:18:45Z")

</div>

Just tried again

/Pimoroni/ledshim/examples $ python3 pulse.py

Traceback (most recent call last):  
File “pulse.py”, line 39, in   
ledshim.show()  
File “/usr/lib/python3/dist-packages/ledshim/is31fl3731.py”, line 243, in show  
self.setup()  
File “/usr/lib/python3/dist-packages/ledshim/is31fl3731.py”, line 93, in setup  
raise e  
File “/usr/lib/python3/dist-packages/ledshim/is31fl3731.py”, line 89, in setup  
self.\_reset()  
File “/usr/lib/python3/dist-packages/ledshim/is31fl3731.py”, line 269, in \_reset  
self.\_sleep(True)  
File “/usr/lib/python3/dist-packages/ledshim/is31fl3731.py”, line 274, in \_sleep  
return self.\_register(\_CONFIG\_BANK, \_SHUTDOWN\_REGISTER, not value)  
File “/usr/lib/python3/dist-packages/ledshim/is31fl3731.py”, line 299, in \_register  
self.\_bank(bank)  
File “/usr/lib/python3/dist-packages/ledshim/is31fl3731.py”, line 294, in \_bank  
self.i2c.write\_i2c\_block\_data(self.address, \_BANK\_ADDRESS, [bank])  
OSError: [Errno 121] Remote I/O error  
So tried this

i2cdetect -y 1  
0 1 2 3 4 5 6 7 8 9 a b c d e f  
00: – -- – -- – -- – -- – -- – -- –  
10: – -- – -- – -- – -- – -- – -- – -- – --  
20: – -- – -- – -- – -- – -- – -- – -- – --  
30: – -- – -- – -- – -- – -- – -- – -- – --  
40: – -- – -- – -- – -- – -- – -- – -- – --  
50: – -- – -- – -- – -- – -- – -- – -- – --  
60: – -- – -- – -- – -- – -- – -- – -- – --  
70: – -- – -- – 75 – --  
but only if I hold it !

Is it defective? is it up the right way ? Are the pins connecting to the shim?..how can I tell?

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [October 15, 2019, 4:53pm UTC](https://forums.pimoroni.com/t/ledshim/11919/5 "2019-10-15T16:53:10Z")

</div>

Clipping and pasting is fine. I asked because the pipe symbol | is sometimes confused for a capital i “I” or lower case L “l”. That gets you an error message though.  
If you have to hold it down for i2c detect to find it one of more contacts aren’t making a good contact with the GPIO pins. Have a look see for any bent of out of alignment pins.  
With your Pi in front of you, USB and HDMI jacks facing you. The LED shim is on correctly if you can read the text on it. The row of LED’s will be on the other side of the Pi’s GPIO, farthest away from you. I have two LED Shims. Mine are mounted remotely away from the GPIO and soldered to headers. I did test them as they come from Pimoroni and they both worked as advertised. I just wanted mine orientated vertically not horizontally.

---

<div class="post-metadata">

**Author:** ![raspgraph](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@raspgraph](https://forums.pimoroni.com/u/raspgraph)\
**Post date:** [October 17, 2019, 2:26pm UTC](https://forums.pimoroni.com/t/ledshim/11919/6 "2019-10-17T14:26:03Z")

</div>

A vote of thanks to you. Your suggestion about bending pins away from each other worked. Used an old credit card so as not to bend them too far. Shim is now a tight fit but obviously connected correctly. Ledshim programs now working from  
examples. Nor sure about the rgb.py or blinkt programs yet.

---

<div class="post-metadata">

**Author:** ![raspgraph](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@raspgraph](https://forums.pimoroni.com/u/raspgraph)\
**Post date:** [October 17, 2019, 2:30pm UTC](https://forums.pimoroni.com/t/ledshim/11919/7 "2019-10-17T14:30:06Z")

</div>

It can’t be used with another GPIO connecter because that brings the pins back together.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [October 17, 2019, 2:48pm UTC](https://forums.pimoroni.com/t/ledshim/11919/8 "2019-10-17T14:48:05Z")

</div>

I soldered my Fan Shim to a booster header.

> **[Booster Header – Pimoroni Store](https://shop.pimoroni.com/products/booster-header)**
>
> These headers will give your HAT or pHAT a real lift!

  
And then mounted the fan a little lower in its holder. I left out the spacer nuts.  
I have a heatsink attached so there is no way to mount my fan shim in the stock location. Not without removing the heatsink.  
If you solder it to a stacking header you could then plug something in on top.  
The 11mm one from here  

> **[2x20 pin Female GPIO Header for Raspberry Pi – Pimoroni Store](https://shop.pimoroni.com/products/2x20-pin-gpio-header-for-raspberry-pi-2-b-a?variant=1132812269)**
>
> Connect your project directly to your Pi with these 2x20 pin GPIO headers!

---

<div class="post-metadata">

**Author:** ![raspgraph](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@raspgraph](https://forums.pimoroni.com/u/raspgraph)\
**Post date:** [October 17, 2019, 4:40pm UTC](https://forums.pimoroni.com/t/ledshim/11919/9 "2019-10-17T16:40:13Z")

</div>

They are written in python2… need conversion for python3

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [October 17, 2019, 5:29pm UTC](https://forums.pimoroni.com/t/ledshim/11919/10 "2019-10-17T17:29:49Z")

</div>

What is written in python 2? I have a Blinkt running on my Pi 4 no problem. The Pi’s with my LED Shim’s are still on Stretch, might even be Jessie. They are running in python3 though. I run my file from crontab with @reboot python3 /home/pi/MyFile.py &

---

<div class="post-metadata">

**Author:** ![raspgraph](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@raspgraph](https://forums.pimoroni.com/u/raspgraph)\
**Post date:** [October 17, 2019, 6:53pm UTC](https://forums.pimoroni.com/t/ledshim/11919/11 "2019-10-17T18:53:34Z")

</div>

Arggs.py is python2 but blinkt as you say might need me to do some more work.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [October 17, 2019, 8:40pm UTC](https://forums.pimoroni.com/t/ledshim/11919/12 "2019-10-17T20:40:14Z")

</div>

Ok, I see there is a blinkt\_thermo.py in the examples. The Blinkt I was referring to is the actual Blinkt.

> **[Blinkt! – Pimoroni Store](https://shop.pimoroni.com/products/blinkt)**
>
> Eight super-bright RGB LED indicators that are ideal for adding visual notifications to your Raspberry Pi without breaking the bank!

I don’t remeber what examples I ran for the fan shim, it was a while ago.

I just saw this on the Fan Shim github page

Library install for Python 2:

on Raspbian:

sudo apt-get install python-ledshim

other environments:

sudo pip2 install ledshim

---

<div class="post-metadata">

**Author:** ![Xion](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/xion/32/7060_2.png) [@Xion](https://forums.pimoroni.com/u/Xion)\
**Post date:** [August 12, 2020, 5:45am UTC](https://forums.pimoroni.com/t/ledshim/11919/13 "2020-08-12T05:45:22Z")

</div>

I am using Python3 without problem. Just remember that when you install the python libraries use: sudo pip3 install … For SMS I had to use sudo apt-get install python3-smbus.

---

<div class="post-metadata">

**Author:** ![Xion](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/xion/32/7060_2.png) [@Xion](https://forums.pimoroni.com/u/Xion)\
**Post date:** [August 12, 2020, 5:48am UTC](https://forums.pimoroni.com/t/ledshim/11919/15 "2020-08-12T05:48:44Z")

</div>

I have the same problem. The ledshim is not seated correctly. Hold you finger on it to push it down and then run the program again. You may need to use some solder or glue or bend the pins outward to press it in place.
