PiGlow on Raspberry PI 2


#1

For the life of me I cannot get the PiGlow to work on the Pi2b

I have tried several guides(of which result in the script running and nothing at all happening with the piglow… I am told to sudo i2cdetect -y 0 which gets me “could not open file, no such file ETC”

Last thing I tried(that prompted me to sign up) was I tried gadget’s fork of which gets me this error running the test.py

sudo python ./test.py
White: 10
Traceback (most recent call last):
File “./test.py”, line 12, in
piglow.white(val)
File “/usr/local/lib/python2.7/dist-packages/piglow.py”, line 42, in white
self.update()
AttributeError: PiGlow instance has no attribute 'update’
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File “/usr/lib/python2.7/atexit.py”, line 24, in _run_exitfuncs
func(*targs, **kargs)
File “/usr/local/lib/python2.7/dist-packages/piglow.py”, line 33, in off
self.all(0)
File “/usr/local/lib/python2.7/dist-packages/piglow.py”, line 76, in all
self.update()
AttributeError: PiGlow instance has no attribute 'update’
Error in sys.exitfunc:
Traceback (most recent call last):
File “/usr/lib/python2.7/atexit.py”, line 24, in _run_exitfuncs
func(*targs, **kargs)
File “/usr/local/lib/python2.7/dist-packages/piglow.py”, line 33, in off
self.all(0)
File “/usr/local/lib/python2.7/dist-packages/piglow.py”, line 76, in all
self.update()
AttributeError: PiGlow instance has no attribute ‘update’

ive done all the edits of files etc… im at a loose end now. I am pretty much a noob at this too. However I have the displayotron and that works fine


#2

I am 99.9999% sure you need
i2cdetect -y 1 (not 0) for a Pi2 though I don’t know about the Piglow and what instructions you are following.


#3

i2cdetect -y 1 produces this

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --


#4

sorry, don’t know much about this stuff (yet) though I’d say it’s not picking up your Piglow at all, i.e the output of i2cdetect looks like a flat line (to me). Maybe it’s defective?


#5

yeah, I am starting to think that it was DOA as it didn’t work on the B+ - My friend has the original B and I have asked him to pop around with it at some point so we can test it. Thanks


#6

It shows the same thing when i have the displayotron plugged in ?


#7

well, I don’t know why you are running this command… are you following some tutorial, if so can you share the link?

the displayotron does not use i2c (it uses the pins but not as such) so yes, you’d get no response from i2cdetect. I don’t know about the Piglow, they share the SN3218 and maybe it’s normal you don’t get an address returned for it either.

So I guess the main question if i2cdetect is even relevant, I assumed it was since you mentioned it, pointing out that you were probing the wrong bus, but it may ge completely irrelevant.


#8

I have just tried my dot3k and i2cdetect returns nothing, so that is normal. The following link does mention specifically i2c for the Piglow, so my expectation is that you should get some output:

… I’ll dig around the code on github if I can find a definite answer, though either way that won’t help you much resolving the issue (but perhaps will help determining if it is worth persevering).


#9

actually, I stand corrected, the SN3218 does use i2c. But like I said my dot3k does not return anything using i2cdetect, nor does yours, and both work fine, so I don’t think there is anything wrong with the output of your Piglow being blank (or what I interpret as blank).

sorry I couldn’t be much help, you’re better off waiting for Phil to hit the office on Tuesday rather than listening to my ramblings. DO feel free to share any resource you are using to troubleshoot though, maybe a penny will drop in my little skull ;-)


#10

I just read here http://wiringpi.com/dev-lib/piglow/

that if you have pi2 that you have to use i2cdetect -q -y 1 rather than 0 to detect if its there…so i just ran it with the added q and got this

pi@raspberrypi ~ $ i2cdetect -q -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- 54 – -- – -- – -- – -- – -- –
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

does the 54 mean the piglow is being detected ?

some other bits ive been reading

http://forums.pimoroni.com/t/piglow-irritatingly-wont-work-on-any-pi/469



#11

yes, according to the shop link, the Piglow i2c address is indeed 0x54.

… I’m a bit confused by your resources though, they seem to be totally independent from pimoroni. Not that there is something wrong with that, but perhaps there are some incompatibilities with this forked code and the Pi2 or recent Raspbian. It seems to be rather old.

out of interest, did you run rpi-update? Not that I recommend you do, but I believe some users have had some issues after doing it.


#12

OK, I had a good look at all the repo on github and it’s clear Phil aka Gadgetoid is working on a major update to the piglow lib… I would expect it to be WIP though.

I would sit tight and wait for him to chime in, either helping you rolling back to Boeeerb’s piglow Python lib, or moving forward with his own pimglow. You can find some details here: https://github.com/Gadgetoid/python-piglow

… that said, if you follow the instructions there, you should be able to modify the examples you are working with, using ‘import pimglow as piglow’ but take this with a pinch of salt, I don’t have any way to verify that it works (having no Piglow to test with).


#13

Ahoy! Indeed… I’m working on some pretty massive refactoring and changes to PiGlow- not because anything is broken, but because we don’t really have an “official” solution to getting a PiGlow up and running which we can point to.

However, the most minimal way to get PiGlow up and running, and tested, is our very basic example here: https://github.com/pimoroni/piglow/blob/master/examples/piglow-example.py

This only requires SMBus and should just work.

Not seeing PiGlow/Dot3k when using i2cdetect -y 1 is normal- PiGlow is a write-only device, so it doesn’t respond to the reads that i2cdetect normally uses to try and detect devices.


#14

yeah i did the rpi upgrade

gadget… with that example I get the scrolling update pwm, update pwm etc… but nothing from the piglow… Perhaps its was just DOA?


#15

Could well be DOA in that case! Toss an email over to the guys in Support and mention this thread. They should get you sorted out.