Hyperpixel4 screen rotation, touchscreen fix - How?

This is my first post, so hello everyone.

I’ve got a rectangular Hyperpixel4 and a Pi3B+. Yesterday I updated Raspbian and installed the Hyperpixel4 using the Curl command. It worked fine and it looks a very nice screen, but it was in portrait mode, so menu bars were all squashed up and it wasn’t an ideal layout. I found out on the forum how to edit config.txt to rotate the display to landscape, but even though I also edited the touchscreen config line to rotate, it still hadn’t rotated.

I had a look on Github and found I need to do something to the driver. However, I’m not very fluent in Linux and it may as well have been written in Greek:

Note: You must build the latest dtoverlay file to enable rotation support:

1. Go into src
2. run make to build a new hyperpixel4.dtbo with rotation support
3. copy the overlay with sudo cp hyperpixel4.dtbo /boot/overlays/

Ok, sounds great, now how do I actually do that?

Is SRC a directory? If so which one, there are several?

How do I run “make”? How to I use it to build a new .dtbo file?

How do I copy the overlay?

Sorry for my noob questions.

This may or may not help but I have to do something similar on my Pirate Radio to adjust the VU sensitivity on the pHat Beat. For me it goes like this.
cd Pimoroni/pivumeter
nano src/devices/phat-beat.c
Change line 88 to:
int bar = (meter_level * (meter_level / 8) / 131071.0f) * (brightness * (NUM_PIXELS/2));

Then Recompile the library by doing the following:
sudo make
sudo make install
sudo reboot

Thanks for the response, but unfortunately there doesn’t seem to be such a directory.

I can get into /usr/local/src/ in terminal, but if I type “Make” it says no makefile specified and no makefile found.

I can see there is a Hyperpixel4.dtbo in the /boot/overlays/ directory, but the Make command doesn’t work in that directory either.

I “think” you need to go here, https://github.com/pimoroni/hyperpixel4/tree/pi3
And clone that to your Pi.

git clone https://github.com/pimoroni/hyperpixel4 -b <branch name>

branch name will be pi3
Then go to the pimoroni/hyperpixel4/src folder and run make.
Then copy the overlay with sudo cp hyperpixel4.dtbo /boot/overlays/
Once you do that you can edit the confix.txt file to rotate the screen as it says for the Pi 4.

I typed in the git clone command on the link you gave and followed the instructions 1 to 4 for the installation. Do I still need to run “Make” and copy the overlay? Does the install not do that automatically?

I’ve looked in the Config.txt file and the commands on the Git hub page do not seem to be in the file. It does look as if another Display_rotate=0 command has appeared at the bottom of the file, so now there are two entries for the display rotate, the first says 1 and the second says 0.

Not sure what to do next…

I would remove the two display rotate lines. If you put a # in front of them they will be ignored.
Then add hyperpixel4-rotate left or hyperpixel4-rotate right, reboot and see what happens. If nothing happens you have to do the make and copy bit.

ok, I put a # in front of the old rotate lines and also took away the :rotate to the line dtoverlay=hyperpixel4 line:rotate to make that just dtoverlay=hyperpixel4

I found the hyperpixel files in home/pi/hyperpixel4/src. I ran make, but it came back with a lot of lines about unit name but no registered property.

Then I typed in the copy command and nothing seemed to happen, it didn’t say anything.

Then I rebooted and the screen is portrait again, even though there is the command hyperpixel4-rotate right.

So no further forward…

I wish I could help more but this is above my skill level.
You could try opening an issue on that github page?

Thanks for your help.

I took the comment# out of display_rotate=1 and got the screen orientation back to landscape.

I tried:

But that didn’t help.

Then I tried:


And interestingly, X in landscape mode is the right way round and orientation. However, if I try adding another line:




Both axis are completely wrong again.

Ok, I think I have something that works:


So I don’t know if I’ve done this right, don’t know if I have the right driver in the right place, or even if the commands are right…this is purely trial and error and a bit of help from alphanumeric, but it seems to work.

Sometimes you just get lucky. I’d clip and past what worked into a text file and save it some place for next time. I have a thumb drive full of crib notes that are also backed up on my daily user PC.
Sometimes I can go years with a custom install, but when it finally won’t boot up any more, I need those notes to remember how I got it all working the first time. ;)

1 Like