Page 1 of 1

Sense HAT problem

Posted: Tue May 09, 2017 9:24 am
by Bill Johnson
I’ve had my Sense HAT working before, then I removed it from the Pi a few months ago to use the Pi for something else. Now I’ve got a problem getting the Sense HAT to work.

When I power up, all the LEDs came on in the rainbow pattern. But when I try the simplest Python scripts (which used to work OK before) I either get a run-time error 'IMU Initialisation failed', or nothing happens, e.g. when trying to light up the LEDs.

I've tried re-installing the sense-HAT software and it made no difference – same result. I also took the HAT off and put it back on again but that didn’t help either. It just seems as if the Pi can't communicate with the HAT.

Before I give up, and/or buy another sense HAT, is there any diagnostic software I can run, or anything else I can try, to make it work?

Re: Sense HAT problem

Posted: Tue May 09, 2017 10:23 am
by ShiftPlusOne
The output of dmesg and i2cdetect -y 1 could be helpful. Do the lights remain on after the pi boots?

Re: Sense HAT problem

Posted: Tue May 09, 2017 10:42 am
by Bill Johnson
ShiftPlusOne wrote:The output of dmesg and i2cdetect -y 1 could be helpful. Do the lights remain on after the pi boots?
No, the lights go off after about 20s. Sorry, I didn't understand the first bit?

Re: Sense HAT problem

Posted: Tue May 09, 2017 11:26 am
by ShiftPlusOne
In a terminal window, what's the output if you run the command 'i2cdetect -y 1'?

Re: Sense HAT problem

Posted: Tue May 09, 2017 1:58 pm
by Bill Johnson
ShiftPlusOne wrote:In a terminal window, what's the output if you run the command 'i2cdetect -y 1'?
bash: i2cdetect: command not found
and
Sudo: i2cdetect: command not found

maybe I'm doing the wrong thing?

Re: Sense HAT problem

Posted: Tue May 09, 2017 1:59 pm
by DougieLawson
sudo apt-get install i2c-tools

Re: Sense HAT problem

Posted: Tue May 09, 2017 2:55 pm
by Bill Johnson
ok, that got a result:

a grid, 0 to f along top, 00: to 70: on side -

all elements from 03 to 77 filled in.

Re: Sense HAT problem

Posted: Tue May 09, 2017 3:14 pm
by ShiftPlusOne
The actual output, placed in code tags would be helpful. Is this what you're seeing?

Code: Select all

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

Re: Sense HAT problem

Posted: Tue May 09, 2017 3:38 pm
by Bill Johnson
That's exactly what I'm seeing - but with each -- replaced by 03 04 05 ..... all the way up to 77.

Sorry I'm new to this and unfamiliar with code tags.

Re: Sense HAT problem

Posted: Tue May 09, 2017 3:40 pm
by Bill Johnson
NO!!!! I missed the one exception!

I have UU in place of 46

Re: Sense HAT problem

Posted: Tue May 09, 2017 3:42 pm
by ShiftPlusOne
What do you get if you run 'raspi-gpio get'? You should see gpio 1 and 2 set up as SDA1/SCL1. You should also not see SDA1/SCL1 on any other pins.

Re: Sense HAT problem

Posted: Tue May 09, 2017 5:12 pm
by timrowledge
I've recently had a similar kind of problem whilst working on a new case design that include the senseHAT; when first assembling the prototype and powering up the senseHAT less flashed white/bright and went dark. I thought I'd shorted something out on the metal case top, but eventually after much work we realised that the connections from the header to the HAT were not good. The IMU was happy, the pressure/temp readings were there but nonsensical and the frame buffer for the LEDs wasn't getting built, all very odd.

The solution appears to be to very slightly bend the header pins out in order to force them to play nice and rub up against the HAT connector sockets. I tried using a sewing needle to lever the socket bits inward a little as well, which maybe worked better; hard to tell. The good news is no shorting out :-)

Re: Sense HAT problem

Posted: Tue May 09, 2017 6:46 pm
by Bill Johnson
ShiftPlusOne wrote:What do you get if you run 'raspi-gpio get'? You should see gpio 1 and 2 set up as SDA1/SCL1. You should also not see SDA1/SCL1 on any other pins.
Not what I get. 1 and 2 are func=INPUT, and 3 is SCL1. I don't see SDA1 anywhere.

Re: Sense HAT problem

Posted: Tue May 09, 2017 7:13 pm
by ShiftPlusOne
yes, I should've set gpio 2 and 3, not 1 and 2.

gpio 2 should be SDA1, so something is hijacking that pin.

Re: Sense HAT problem

Posted: Tue May 09, 2017 7:45 pm
by Bill Johnson
ShiftPlusOne wrote:yes, I should've set gpio 2 and 3, not 1 and 2.

gpio 2 should be SDA1, so something is hijacking that pin.
Solution?

Re: Sense HAT problem

Posted: Tue May 09, 2017 8:31 pm
by ShiftPlusOne
It seems like an issue with your particular setup. Are you using gpio for anything else? Does this happen every time you boot? Are you running anything that might be trying to use gpio?

As a test, try running 'raspi-gpio set 2 a0' as a temporary workaround. If that works, we can try to figure out what's causing problems.

Re: Sense HAT problem

Posted: Wed May 10, 2017 6:32 am
by Bill Johnson
ShiftPlusOne wrote:It seems like an issue with your particular setup. Are you using gpio for anything else? Does this happen every time you boot? Are you running anything that might be trying to use gpio?

As a test, try running 'raspi-gpio set 2 a0' as a temporary workaround. If that works, we can try to figure out what's causing problems.
You've solved it, thank you. The problem was, I had a program that used gpio and it was running on startup, because the commands were still in rc.local. I just disabled that and on reboot the sense HAT now seems to be working.

Thank you for your help, one more small scramble up the learning curve for me - glad I didn't buy another Sense HAT!