Piano and Drum HATs don't work properly on Pi 4 - Pi 4 at fault?

Hey everyone

I’ve been getting my new Pi 4 set up so I can start tinkering with a few ideas for my local Code Club. I’ve only just got around to unwrapping and trying the Piano and Drum HATs I bought myself a while ago.

On a fresh install of Buster, with both of the full libraries installed and utilising the included examples, neither HAT works properly. The Drum HAT can light up the LEDs but touching the pads doesn’t register in any of the examples. With the Piano HAT, again, all the LEDs can light up, but only the first 3/4 keys register any touch.

I did wonder if it was the HATs or the library, so I’ve tried them on a 3B+ that I have, which is as up to date as it can be and they work fine - so this says to me that it’s a problem with the Pi 4?

Is it something that might likely be fixed with any upcoming updates, or could it be an error with the pins? I’m still new to all things Pi and Python so I’m not sure how I’d go about diagnosing any further.

Thanks in advance for any input!

It could also be an issue thats Buster related. Assuming your Pi 3B is running Jessie or Stretch.
There is a new Buster image as of 07-10, is that the one your using?
Do you get any error messages when you run sudo apt-get update?
If yes run sudo apt-get update --allow-releaseinfo-change

i’ll try my piano on a pi3b+ running blaster ,updated from Raspbian Streatch .
the pimoroni dashboard will not open on this setup ,just a quick flash of a square lines on the screen

1 Like

On first try the piano did nothing, i rebooted pi and tried again ,its working fine now, so it could be a Pi4 issue, and not a Blaster issue

1 Like

The 3B+ was running Stretch, you’re completely right.

The 4 was running whatever version of Buster gets installed by NOOBS 3.2, and that was downloaded and installed yesterday. I did install all of the updates after doing the initial NOOB install yesterday and it didn’t come up with any issues. I’ll have a go at installing the latest version of Buster directly and see it that helps at all.

Will keep you updated!

Thanks for the testing Jack. I went looking for my piano hat but I’ve forgotten what box I put it in?

your welcome…mine is loaded and ready to go at all times ,lol

I played with mine when I got it, to make sure it worked etc. Then put it away as I needed the Mini Black Hack3r for something else. I have enough spare Zero’s to leave it connected to one, just don’t have enough Micro SD cards to go around lol.

yeah i have to get some more sd-cards too

Thanks for testing that - so it’s good to know that it’s not potentially Buster!

@alphanumeric - I did a fresh install of Buster from the Pi site (without using NOOBS), and used the command you wrote down, as I got some error message about some update not being ready for 2 or so days…

The bad news is that now, all of the LEDs light up on the examples on both HATs, as before, but zero presses now register on either device. And while I am using the fan shim, I disabled that, and tried plugging both HATs in a number of different ways - via the Mini Black Hat Hack3r, via the booster header, and by removing the fan shim and plugging it onto the pins directly. I am very confused as to why they’re not working!

Also just tried the 3B+ with a fresh install of Buster, and it has the same issues as the fresh install on the 4 - the LEDs light up, but touch doesn’t register on either HAT.

Now it’s got me thinking it’s a Buster issue, but I’m not sure why it would work for @Caperjack1953, but not me…

Piano Hat pinout is here,


Drum Hat here,

And Fan Shim here,

I don’t see any hardware conflicts? Have you tried the Drum or Piano hat on a PI that hasn’t had the Fan Shim software installed? It sounds like you have just want to confirm its not that messing things up.

If you run sudo i2cdetect -y 1 do the correct addresses show up?

Yeah on the 3B+ (both Stretch and Buster) the fan hasn’t been installed and runs fine on the Stretch install, but not Buster. I haven’t tried anything else except Buster on the 4.

On the 4, I did get an error when the fan was running and I tried to use the Piano/Drum HAT - strange as I didn’t think there was a conflict and then after I took the fan shim off, it was fine!

When running the command, this is what shows - I’m not sure if this is correct?

pi@raspberrypi:~ $ sudo 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: -- -- -- -- -- -- -- --

That doesn’t look right? I get a 28 and a 2b when I run it on my Pi 4B with my Piano hat attached.
I just installed the latest 07-10 Buster and did the update upgarde. I didn’t get that weird error message this time around in the terminal window. It did fail to update via the quick start menu though.
My Piano hat kind of works. I get sounds from the first 5 or 6 keys from the left, CDEF, and all the LEDs lite up. Some of them are messed up though. Touching the Octave button lights up the Instrument LED and vise versa. Thats running simple-piano.py If I run the midi-piano example I get no sounds at all. All the LED’s light up though.
This hat worked just fine on my Pi zero running Jessie or Stretch, I don’t remeber which one was installed? It was a year or so ago I think?
I think this issue is related to Buster on a Pi 4.

It’s so odd, isn’t it? I did get the first few keys working the first go, but then not the second time with the direct Buster install.

I’m thoroughly baffled and hope the Pimoroni boffins have some idea!

I’ll do an @gadgetoid and @sandyjmacdonald to get thier attention. Phil can likely sort it out or point us in the right direction anyway.

yeah ,1 or 2 of the examples don’t work proper even on the pi3

Ok, its most likely a Buster issue then. No choice but to run Buster on a Pi 4 though. I’m pretty sure Stretch won’t run on a Pi 4. It won’t boot up.

There’s definitely an RPi.GPIO on Pi 4 issue, I believe, the GPIO library is still in beta and - afaik - there isn’t a general release for the fixed version. This prevents the interrupt pin from triggering - because it’s active-low and the Pi doesn’t enable the pull-up - and affects Drum and Piano HAT IIRC.

As far as I’m aware there are no general incompatibility issues with these on Buster on any other Pi, or any issues other than the one I mentioned above on Pi 4.

I wonder if there’s a more specific issue at play- from the i2cdetect dump possibly even an electrical connection problem between the HAT and Pi (possibly not pushed down far enough).