divinenanny
Posts: 5
Joined: Thu Sep 25, 2014 11:21 am

PiGlow not working on Raspberry Pi B+

Thu Oct 23, 2014 7:29 pm

Hi there,

After earlier advice I have installed my PiGlow on my Raspberry Pi (B+). However, for the life of me, I cannot get it working.

I have followed the instructions here: https://github.com/pimoroni/piglow (Section setting up).

I have installed WiringPi, PyGlow.py, piglow-sysmon and the piglow example from pimoroni.

I get either no response at all, or an I/O error.

Code: Select all

sudo i2cdetect -y -q 1
gives me:

Code: Select all

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Code: Select all

sudo modprobe i2cdev
gives me:

Code: Select all

FATAL: Module i2cdev not found.

Code: Select all

gpio load i2c
gives me:
gpio: Warning: File not present: /dev/i2c-0

Running PyGlow test.py gives me:

Code: Select all

Traceback (most recent call last):
  File "test.py", line 18, in <module>
    pyglow = PyGlow()
  File "/home/pi/lib/python/PyGlow/PyGlow.py", line 120, in __init__
    self.bus.write_byte_data(I2C_ADDR, EN_OUTPUT_ADDR, 0x01)
IOError: [Errno 5] Input/output error
Running the piglow-example.py gives me:

Code: Select all

Traceback (most recent call last):
  File "piglow-example.py", line 52, in <module>
    piglow = PiGlow(1)
  File "piglow-example.py", line 24, in __init__
    self.write_i2c(CMD_ENABLE_OUTPUT, 0x01)
  File "piglow-example.py", line 43, in write_i2c
    self.bus.write_i2c_block_data(self.i2c_addr, reg_addr, value)
IOError: [Errno 5] Input/output error
Running the piglow example program from WiringPi gives me nothing. No errors and no lights. Same for the piglow-sysmon program.

Are my PiGlow or my GPIO pins broken?
Did I install it wrong (lined up all the way to the edge of the Raspberry Pi, not at the side of the USB ports)?
Do I need to change something to make it work on my B+?
Is there any more diagnostics I can do?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: PiGlow not working on Raspberry Pi B+

Thu Oct 23, 2014 8:03 pm

The PiGlow is based round a SN3218 I2C LED controller.

So we take a look at the datasheet at: http://www.si-en.com/uploadpdf/s2011517171720.pdf which says the slave address is fixed "1010 1000". With I2C we shift that one bit to get "0101 0100" (0x54).

When you ran i2cdetect -y 1 there's nothing showing at 0x54. So we need to look at the hardware, have you got the 26pin socket on the PiGlow lined up right on the 40pin header on your B+ (are you off by one)?

Shutdown the B+, pull the PiGlow off the header and re-attach it ensuring you line up pin #1 on the B+ with pin #1 on the PiGlow

Reboot the Pi
sudo modprobe i2c-dev # or i2c_dev both names work
sudo i2cdetect -y 1 # should have an entry at 54.

If you've had it attached "off by one" you may have destroyed the SN3218 chip. In the worst case you may have destroyed the GPIO pins on your B+.

Pin #1 is on the inside of the header furthest away from the USB socket right next to C65.
Image
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: PiGlow not working on Raspberry Pi B+

Thu Oct 23, 2014 8:50 pm

It won't help if you've already caused damage to either or both the RPi or the PiGlow, but the Raspberry Pi Foundation have their own tutorial for using a PiGlow addon, here.

(It does contain a small error relating to the UPPER/lower caseness of the module name to download and import, but hopefully that will be corrected very soon.)

divinenanny
Posts: 5
Joined: Thu Sep 25, 2014 11:21 am

Re: PiGlow not working on Raspberry Pi B+

Fri Oct 24, 2014 9:43 am

I guess it is broken then.

It was installed right (starting on pin 1, furthest away from the USB).

I reinstalled it (pulled it off, put it back on).
Reloaded a pre-PiGlow backup of my SD with Rasbian.
Followed the install instructions again

Code: Select all

sudo i2cdetect -y -q 1
Still gives me:

Code: Select all

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: PiGlow not working on Raspberry Pi B+

Fri Oct 24, 2014 10:59 am

This isn't meant to be patronizing, but are you installing the addon overlapping the RPi, like this - http://cdn.shopify.com/s/files/1/0176/3 ... 1404378660

The big P of PiGlow is at the end where the microSDcard fits.

And there are two rows of little sockets under the PiGlow that have to be mated up with the two rows of pins on the RPi.

divinenanny
Posts: 5
Joined: Thu Sep 25, 2014 11:21 am

Re: PiGlow not working on Raspberry Pi B+

Fri Oct 24, 2014 6:28 pm

Yup, the double row of pin exactly matches the double row of holes on the PiGlow. Then it is situated as far towards the MicroSD as it wil go (first pin from MicroSD is in most left slot of PiGlow. The PiGlow itself hovers over the RaspberryPi board, not out over the edge.

grovep
Posts: 10
Joined: Sun Oct 21, 2012 8:32 pm

Re: PiGlow not working on Raspberry Pi B+

Thu Feb 12, 2015 10:31 pm

I have a similar problem I have followed the tutorials from a clean install I get the 2 modules i2c-dev
i2c-bcm2708 running at boot up but did not have a raspi-blacklist.conf file in /etc/modprobe.d so created an empty file.
When I run test I get

Code: Select all

pi@raspberrypi ~ $ sudo python piglow-example.py
Traceback (most recent call last):
  File "piglow-example.py", line 52, in <module>
    piglow = PiGlow(1)
  File "piglow-example.py", line 21, in __init__
    self.bus = SMBus(i2c_bus)
IOError: [Errno 2] No such file or directory
If I run i2c I get

Code: Select all

pi@raspberrypi ~ $ sudo i2cdetect -y 0
Error: Could not open file `/dev/i2c-0' or `/dev/i2c/0': No such file or directory
pi@raspberrypi ~ $ sudo i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory
pi@raspberrypi ~ $
I have had exactly the same results on 2 rpi any suggestions?

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: PiGlow not working on Raspberry Pi B+

Thu Feb 12, 2015 11:03 pm

If you have recent firmware a system called device tree may now be in place.

Add the line

dtparam=i2c1=on

to your /boot/config.txt and reboot.

grovep
Posts: 10
Joined: Sun Oct 21, 2012 8:32 pm

Re: PiGlow not working on Raspberry Pi B+

Sun Feb 15, 2015 12:03 pm

Spot On - Many Thanks. PiGlow now working fine

jademonkee
Posts: 1
Joined: Tue Feb 24, 2015 8:21 am

Re: PiGlow not working on Raspberry Pi B+

Tue Feb 24, 2015 8:23 am

joan wrote:If you have recent firmware a system called device tree may now be in place.

Add the line

dtparam=i2c1=on

to your /boot/config.txt and reboot.
This worked a treat for me, and my RasPi Model B, too.
Thanks a tonne!

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2943
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: PiGlow not working on Raspberry Pi B+

Wed Mar 04, 2015 9:07 pm

For compatibility with all Pi's it is recommended to use i2c_arm instead of i2c1.

Librarian
Posts: 1
Joined: Fri Mar 13, 2015 10:11 pm

Re: PiGlow not working on Raspberry Pi B+

Fri Mar 13, 2015 10:47 pm

I tried following the advice and multiple tutorials and am still getting error messages like this one when trying to run the test:

Traceback (most recent call last):
File "/home/pi/piglow/test.py", line 9, in <module>
piglow = PiGlow()
File "/home/pi/piglow/piglow.py", line 33, in __init__
self.bus = SMBus(i2c_bus)
IOError: [Errno 13] Permission denied

I've tried changing the boot/config.txt as suggested and that didn't work either.

I need a real "Dummie's" version for how to trouble shoot this thing. I'm trying to learn the basics to assist with a Raspberry Pi club at the public library, but have zero background in programming.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: PiGlow not working on Raspberry Pi B+

Sat Mar 14, 2015 10:01 am

Run it with
sudo python /home/pi/piglow/test.py

Or update your system so that the pi user is added to the i2c group.
sudo apt-get update && sudo apt-get dist-upgrade
should do it automagically.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “HATs and other add-ons”