Piano Hat: light but no sound in a few keys

Hi!

I got a Piano Hat for christmas and I have a weird problem with it.

Keys from C to G (including half tones) work perfectly. The rest of the keys (A and upper including half tones, Instrument, and both octaves) light up when touched but the Raspberry Pi doesn’t seem to get their signal. I’ve tried with the example python apps installed with the Piano Hat script and I get the same resultst in all of them. All the keys light when touched but only from C to G are logged. Where can the problem possibly be? I don’t think my GPIO is faulty, and if it was, it would probably not light the keys’ leds.

I have a Raspberry Pi 2 with the latest Raspbian Jessie image in an 8GB SD card. It is powered by a 2000mAh charger. Everything else works perfectly.

Thanks in advance!
Joan

I’m pretty sure the hardware is fine if the LEDs are lighting up (they are tied directly to the touch events). I’m summoning @gadgetoid and his knowledge of the samples/product to step in and offer advice!

This sounds like your Pi is having trouble communicating with one of the Cap1188 chips that drive the keys ( and lights ) on the Piano HAT. You can prod and poke it to see if it’s responding to test.

Try opening up Menu -> Accessories -> Terminal and running the following:

sudo i2cdetect -y 1

You should see two addresses pop up in the resulting table: 0x28 and 0x2b

Give it a go and let me know what you see!

Thanks @jon and @gadgetoid !

Sorry for the late reply I’ve been ridiculously busy lately.

Ran the command and got exactly what @gadgetoid expected: a table with only those two specific addresses showing up.

Still no luck with the hat, though. It keeps doing the same thing as before. If the hardware part seems to be ok could it be something software related?

unlikely so, but you can ‘refresh’ the lib just in case (though I don’t recall anything bad in a earlier pianohat lib):

curl -sS get.pimoroni.com/pianohat | bash

… answer ‘y’ (yes) to all requests of the installer and read all the messages carefully in case something odd pops up.

Thanks @RogueM !

Just to be sure: should I run the command as super user or don’t?

no, if your user is part of the sudoers then that’s taken care by the script internally and it will work just fine.

Ok, thanks! I’ll try ASAP.

Keys C, D, E, F and G belong to the left Cap1188 chip which has an Alert Pin that’s connected to GPIO 4 on the Raspberry Pi ( http://pinout.xyz/pinout/pin7_gpio4 ), and the remaining keys belong to the right Cap1188 chip, the Alert Pin of which is connected to GPIO 27 on the Pi ( http://pinout.xyz/pinout/pin13_gpio27 ).

The Piano HAT library uses these alert pins to get a better response rate when you hit the keys ( more playable, yay ) so I suspect there’s something wrong with the connections on the latter.

Looking at the schematic, there’s no pull-up on these lines so there could be a few things happening:

  • The pin/pull up of GPIO 27 on your Pi might be fried for some reason

or ( more likely )

  • One of the solder joints, either on the header, or the very top right most pin on the chip, is dry/flaky and not making a good connection

Have a look at the top pins on the right-most Cap1188 chip on your Piano HAT and let me know if anything looks amiss.

Similarly look at the header connection, the 7th pin from the right along the bottom edge of the header when you look at the back of the Piano HAT with the header at the top.

Sorry for all the potentially confusing and inane debugging steps! I get a little carried away when there’s a mystery to solve.

Hi!

Same problem here. just got my brand new piano hat with an also brand new raspberry pi 3 and jessie Pixel. all went fine but those keys (C, D, E, F, G and upper) dont play the sounds. A, B, C and upper work fine so do the octaves. Lights show fine and pressed commands in the terminal too. I looked at the pins and the chips as mentioned in this thread but could not find anything wrong. Any way to pinpoint the problem? Any help is more than appreciated!

what do you get if you type the following:

sudo i2cdetect -y 1

Hi @RogueM. I get a table with only those 2 adresses: 0x28 and 0x2b.

Do you have 1-wire enabled at all? The Alert A pin, BCM 4 conflicts with the default for 1-wire, which seems to be infamous at causing problems with things.

Hi @gadgetoid, Thanks for the response.

I must say I’m a complete Noob with Rpi. Could you please point me to some resource on how I enable 1-wire or debug the conflict on the pin 7? Do I have to set this 1-wire to the pin 7 (BCM 4)?

Thanks in advance!

You should just click the Pi menu icon, go to “Preferences” -> “Raspberry Pi Configuration”, and then click the “Interfaces” tab and make sure “Disabled” is checked next to “1-Wire”.

This is an educated guess at the problem, though, it may be a hardware issue!

Hi @gadgetoid, I’ll try it at home and let you know. :)

Thank you!

I encountered the same problem with the lower range of the keys not making sound when running the example code. I disabled 1-Wire per the above suggestion and everything is running as it should. Thank you, thank you!