Odd problem with Piano Hat on Pi 4

I’ve got a Piano Hat that I bought some time ago. I was using it on a Pi 3 and I decided to move it to my Pi 4, but it only partly works on the Pi 4. I’ve tried the buttons and simple piano demos and none of the buttons below number 9 register on the computer. The lights flash when I touch the buttons but the scripts don’t get events. Buttons from 9 upwards work, they register and play notes on the simple piano.

I moved the Piano Hat back to the Pi 3 to see if I’d damaged it and it works fine there, all the buttons work. Then when I moved it back to the Pi 4 the buttons under number 9 didn’t work,

Is there some compatibility problem with this hat on the Pi 4?

sure seems like there is ,I installed mine on my pi4 to test it , and nuttin but errors ,I don’t have a fix, fixes are way above my pay grade

Are those two Pi’s both running the latest PiOS and fully updated? It sounds like a
software glitch.
If you run sudo i2c detect -y 1 from terminal do you see a 0x2B and 0x28?

Mine is on a Pi Zero that is running an older version of Buster. No issues last time I used it.

According to /etc/os-release the Pi 4 is running Version 10 (buster) and I updated and upgraded it yesterday afternoon. i2cdetect is showing 28 at grid reference 20,8 and 2b at 20,b. If I remove the Piano Hat then i2cdetect doesn’t show anything so I don’t think there is anything conflicting with it. I’ve disconnected the memory sticks and USB audio device I normally use leaving just the keyboard, mouse and hat connected but it still doesn’t work.

Since some of the buttons are working I assume there must be a working i2c connection to the hat. Having some buttons not working looks like a hardware failure on the hat but all the buttons work on the Pi 3.

I’ve been looking for documentation on how to access the hat in C or assembler but I can’t find any. I hope that if I can get access to the device closer to the hardware. I might be able to work out what is going wrong. That’s the trouble with these event based interfaces, they’re nice and easy to use when they work but when they go wrong it’s a nightmare trying to find out why.

It’s I think unrelated, but I had a similar incident when I made a typo at the last step of setting up my itty bitty beat box. I had an extra space in the piano hat line that really messed things up. I thought I had a thread on it but can’t find it? Make sure you didn’t accidentally alter the python file your sunning.

python /home/pi/Pimoroni/pianohat/examples/simple-piano.py > /dev/null 2>&1 &
python /home/pi/Pimoroni/drumhat/examples/drums.py > /dev/null 2>&1 &