No output from Unicorn Hat

I have an original Unicorn Hat that I have used without problem in the past. I dug out my Pi 2 that still had it on and the original SD card in (not used for a while sadly) and all the LEDs came on in a diagonal rainbow on boot and stayed on. Running the existing scripts did nothing. The install hasn’t been updated or changed in any way.

Next I tried a clean install of the very latest Raspbian on a new card. Booted up and updated, then manually installed the Unicorn Hat bits with PIP according to the Pimoroni instructions (sudo pip install unicorn hat - the other dependencies are already there). Unfortunately although the test scripts run with no errors none of the LEDs light. I have tried detect.py which wrongly identifies it as a pHat because it thinks the height and width differ, but even changing the unicorn.set_layout to unicorn.HAT instead of unicorn.AUTO doesn’t help.

To make sure everything was properly installed I have now run the \curl command to download and run the installer, but that just confirmed everything was already setup correctly and downloaded the examples.

So far my Google Fu hasn’t located any more detailed diagnostics to work out what is and/or isn’t working properly. Has my Unicorn Hat gone the same way as my first Piglow and started getting unreliable? Does anyone have any ideas?

Is dtparam=audio=on commented out in /boot/config.txt?

Sorry for the slow reply, haven’t had the time to get back to my Pi and double check. No it wasn’t commented out, but then again it never has been (well, I’ve never changed it from the default) and it has worked. I have tried commenting it out and that makes no difference - the software is quite happy to run demo.py and consider all is well, but none of the LEDs are lit. They all light on boot, and detect.py still states “Your height is NOT equal to your width, so you must have a pHAT”, both statements are incorrect as this is an original Unicorn Hat. The install made a change to direct the audio out through the HDMI I seem to remember, but installing the Pimoroni software as per the instructions is the only change to the latest Raspbian image that has been made so far.

Update 1:
OK, to add to the diagnostic information, I have just tried my Unicorn HD Hat (never used before). This doesn’t light up any LEDs on boot, and also doesn’t light up and LEDs with the demo. It does, however, detect as a Hat and not a pHat. That said, it reports as 8x8 using a slightly modified detect.py. The original Unicorn Hat reports as 8x4. Any suggestions most welcome.

Update2:
Realised that the HD uses different libraries and the detect doesn’t cover all three Unicorns, so I’ve now tested the HD properly and all is working fine. I’m beginning to wonder whether my original Unicorn is the second Pimoroni Hat to start having hardware problems :-(

It’s certainly possible something’s up with the HAT itself, although it’s normal for it to detect as a pHAT if you plug it in while the Pi is running (since the Pi only reads the ID EEPROM on boot)

What do you see if you run:

pip freeze | grep unicornhat

I should probably add the solution in here, in spite of a serious level of embarrassment! Short answer, I was talking to a Sense Hat I had in the wrong ESD bag with the Pi I’d been using to play with the Unicorn Hat.

If it hadn’t had an 8x8 LED matrix on too my brain might have kicked in and noticed my mistake. On the other hand, if detect.py had provided a message along the lines of “go walk the plank landlubber, this isn’t a Unicorn Hat” it could have helped ;-) A quick cat /proc/device-tree/hat/product showed up my error (useful tip I now know). Actually that suggested error would have had even more impact being a sailor!

1 Like

That’s a good idea for detect.py actually :D