Hyperpixel 2.1 Display issues on older RasPis

I’m attempting to set up a Hyperpixel 2.1 with a Raspberry Pi Zero V1.1w, I’ve followed the guides on both setting up the display and the touch drivers, including using the pygame error fix shown on the touch driver github.

When using the RasPi4, example apps display correctly, however on my Pi3b+ and the intended Zero 1.1w, apps are drawn off centre and incorrectly (Pi3b+ pictured, same on the Zero). I’m using the version of Buster provided on the product page to avoid the issues with Bullseye.

Does anyone have any insight as to how to fix this? I was under the impression the Pi4 was the less stable option for HyperPixel displays at the moment.

Try updating to a newer version of Pygame!

Thanks a lot, that fixed it completely!

1 Like

I have the same problem. Default clock.py script has that same problem. updated Pygame with pip3 install pygame --upgrade and now it shows pygame 2.5.2 installed. But the problem persists.
I wouldn’t really care about it, except if use pygame to draw a circle it crops the display so a circle with diameter 240, centre 0,0 shows 4 arcs. I cannot get full use of the display. I used the clock.py command to init the screen;
pygame.display.set_mode((640,480), pygame.FULLSCREEN | pygame.NOFRAME) and it still crops the circle.
None of the demo apps work properly actually. Something else need updating?

I have just noticed, that although I have upgrade pygame, that when I run the clock.py app the pygame reports as 1.9.4


Rebooted the rPi Zero W to see if the new pygame takes effect and I still get the 1.9.4 message.

That will be because when you run it via sudo, it runs under root (so probably picking up the system-installed version of pygame), and your pip3 install pygame --upgrade has just upgraded your local (user specific) python library.

Welcome to dependency hell; the lazy way out is to sudo pip3 install pygame --upgrade, which feels dirty but should work.

Thank you so much, such a small thing and that got the clock.py working inside Buster. In fact it seems all demo’s work.
Tried to get it to run with Bullseye OS and no good that way as I was assuming days until a reply here. So I thank you again as that worked and I can get on with the good stuff now.

I have come up with a build plan to get the display running using buster-lite and installing the bits enough to get clock.py without the touch running. Sorry I don’t need touch.

Use Rufus to Burn rPI Buster to the SD card, then Insert the SD card and power up.
You will need a USB hub to attach a mouse and keyboard.
Use a HDMI cable to monitor and turn on the unit.
Turn on the PSU and allow to boot

Initial boot username:pi
Password : raspberry

sudo raspi-config

Set new password for user pi to “YOURPASSWORD”
Set boot to console logged in
Set up WIFI network so you can SSH in.
Set local stuff to what is good for you.
Under interface options Enable SSH, Enable I2C interface
Exit raspi-config and restart

Can log in with putty/SSH now. Issue ifconfig to get IP address if needed.

first update apt-get
sudo apt-get update --allow-releaseinfo-change
sudo apt fullupgrade

mentions that repository name change has happened, but --allow gets it to go ahead
if --allow is not used commands below will error with 404 not found files

Need to install i2c tools
sudo apt-get install i2c-tools

Check that i2c is detected
i2cdetect -l

should detect qty 2 x i2c port, i2c and i2c-X

Python defaulit is 2, need to change to 3 with;
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 3

Python pip3 is not installed.
sudo apt install python3-pip

pygame will need to be installed
sudo pip3 install pygame

pgame won’t do fonts and PNG without these 2

sudo apt install libsdl2-ttf-2.0-0
sudo apt-get install libsdl2-image-2.0-0

python will error with GPIO module missing, need to install GPIO module
sudo apt-get install python3-rpi.gpio

smbus2 seems to be missing from python
pip3 install smbus2

Need to install git
sudo apt install git

Need to backup config.txt before installing hyper-pixel drivers
cd /boot
sudo cp config.txt config-hdmi.txt

Get hyperpixel stuff from git
git clone GitHub - pimoroni/hyperpixel2r-python
git clone GitHub - pimoroni/hyperpixel2r

go into folders and install
cd hyperpixel2r
sudo ./install.sh

cd hyperpixel2r-python
sudo ./install.sh

Config.txt file now updated in /boot, time to add the following to it
cd /boot
sudo nano config.txt

add

Force 640x480 video for Pygame / HyperPixel2r

hdmi_force_hotplug=1
hdmi_mode=1
hdmi_group=1

Find the dtoverlay= line and add the :disable-touch to the file
dtoverlay=hyperpixel2r:disable-touch

after exit and save, copy new config.txt to config-hyper.txt
sudo cp config.txt config-hyper.txt

This will allow you to swap between HDMI monitor and pixel display should you copy the config-hdmi.txt over the config.txt and reboot.

time for a reboot
sudo reboot now

after reboot HDMI screen will be rainbow, and small display running.
dial in with putty, move to examples folder

sudo SDL_FBDEV=/dev/fb0 python3 clock.py

Touch error, go into the clock.py and remove the references to touch at the end of the script.

There still is an error reported from pygame XDG_RUNTIME_DIR not set. Not sorted it out yet.
This got me to a point that my script development can start as I don’t need touch for this.