Ledshim

Hi Loaded software as described on your website:-
sudo curl 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

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.

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?

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?

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.

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.

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

I soldered my Fan Shim to a booster header.


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

They are written in python2… need conversion for python3

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 &

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

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

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