Unicorn HAT mini not recognized


I just got the Unicorn HAT mini but I don’t get it to work.
I installed Raspbian Buster on a pi zero WH, installed the library from GitHub, but when I want to run an example I get following error:

Traceback (most recent call last):
File “./rainbow.py”, line 6, in
from unicornhatmini import UnicornHATMini
ModuleNotFoundError: No module named ‘unicornhatmini’

I did another fresh install of Raspbian and the library, but the problem stays, I tried like 5 of the examples and get the same error. I re-attached the HAT also several times, the connectors and everything looks fine. I would get my hands on another of my Pies within the next days to see if the problem also occurs on another Pi.

Does anybody have an idea what could be the problem? I hope I didn’t get a DOA HAT.

Try sudo pip3 install unicornhatmini and double check the i2c is enabled in Raspberry Pi Configuration. I think it uses i2c?

Thanks for the fast reply, sadly I receive the same kind of message:

Traceback (most recent call last):
File “./rainbow.py”, line 6, in
from unicornhatmini import UnicornHATMini
File “/usr/local/lib/python3.7/dist-packages/unicornhatmini/init.py”, line 10, in
import RPi.GPIO as GPIO
ModuleNotFoundError: No module named ‘RPi’

and with another example also this one:

Traceback (most recent call last):
File “./simon.py”, line 8, in
from gpiozero import Button
ModuleNotFoundError: No module named ‘gpiozero’

i2c was enabled but double hecked it anyways.

Raspbian Lite or Raspbian with Desktop?

Raspbian Lite, Desktop is taking too much ressources and not needed for this project.

Ah, my best guess is your missing something that would normally be there in the with Desktop version. gpiozero maybe?
What I often do is install the Desktop version, and when I’m all done with my setup, I set it to boot to command line instead of to the Desktop GUI. It’s almost as good as going with the Lite version.

1 Like

One option is to try the github clone option.

git clone https://github.com/pimoroni/unicornhatmini-python
cd unicornhatmini-python
sudo ./install.sh

Ok, it was the missing gpiozero in Raspbian lite, I installed it and now it works!
Thanks a lot for the help!

The GibHub clone is what I always do to “install” a python library so that shouldn’t be the problem too.

That’s good to hear you got it working. I have one on the way, it should arrive any day now. I like using the clone option as it gets you all the example files.
Near as I can tell, from posts on the Pi foundation Forum, there is stuff missing from the Buster Lite release, that was in previous Lite releases? That’s what it sounds like anyway. They made it even lighter.

It’s nice they make it lighter but for noobs like me Linux in general isn’t the easiest thing to use. I hope you Unicorn mini arrives soon so you can start tinkering with it.

They also striped some stuff out of the With Desktop version. I have to manually install Idle now. They want you to use Thorny.

You don’t happen to know if the Mini uses i2c or SPI? If it doesn’t show up via i2cdetetct -y 1 I’d assume its SPI. I could have sworn I saw a note saying it used i2c but can’t find it now? No pinout on the pinout site either?

The chips in the description and on the underside images are marked HT16D35A, which is the SPI version according to the datasheet.

OK, I was thinking it was likely SPI like the Unicorn Hat HD. I was going to use it with my Breakout garden mini, I’ll just have to remember to unplug the SPI LCD breakout first.