Adjusting Screen display on 2.8" touch display (MPI2801) - Raspberry Pi

Hi All
Hoping someone might be able to help me with my situation.
I have a raspberry pi4 that I am using for a NAS - i essentially followed the tutorial from this site and it works perfectly. The Rasp pi is running the Bullseye 64bit legacy OS so it doesn’t have a graphical interface, only a command line.

I have written a script in Python using the Curses module to get system stats that I want to display and the code works well and does what it should on the Raspberry pi (and other devices I have tested it on)

My issue is that the monitor I am using for the NAS is the 2.8" touch screen 2.8inch RPi Display - LCD wiki
and its display of my program is so small its almost unreadable.
I have tried making changes to font sizes and window sizes in the code but no luck for one reason or another it doesn’t change the font size on the display.

Is there any way of changing the display settings to get me a more zoomed in more readable display?
Attached image to give you an example of its current display output
Screenshot 2024-03-10 at 12.25.23 pm

Any help would be appreciated.
Thank you
BPT

Hi @Ben265877 I had a look at the steps to run the screen… it prescribes running LCD28-show.py so i took a poke around in that file to see what the resolution is being set up as and came across line 31

maybe I’m clutching at straws, but this intuitively feels like it’s setting the display up for 480x360 pixels, but the wiki shows the resolution as 320x240 pixels. which is about 2/3rds.

EDIT: Though in hindsight your terminal is well under 2/3rd the size… hmm perhaps that isn’t what’s going on here.
Perhaps there’s a misconfiguration in the setup that is compounded by the 270degree rotation as well eg. the long edge becomes the short edge → 480 pixels is used as the resolution for the 240 pixels edge.

It might be worth comparing this setup script to others, and refer to other LCD products from the same lineup to check for consistency.

Hiya @Ben265877

xrandr might be able to help you here.
Good for manipulating video displays in Linux

# where DEVICE is your video display device
xrandr --output <DEVICE> --mode 1024x768

I haven’t tested this but apparently there is a -q argument that lists your devices.
xrandr -q ← Untested!!!

Pix :heavy_heart_exclamation:

Hi @Pixmusix
Thanks for the response! I appreciate it… however you may need to spell it out for me a little clearer as I’m only quite new to the world of hardware programming… are you suggesting running the xrandr script in the terminal window might help?
Again, sorry for the probably annoying question - I’m a white belt at this!

Thank you
BPT

1 Like

No worries BPT :slight_smile:
Sorry I should have asked rather than throwing craziness at you.

what is xrandr.

xrandr is a program that stands for x resize and rotation.
X is a program that helps render pixels on your screen (and much more).
We can run xrandr from the terminal.

checking for xrandr

I’m actually not certain this will work for you because you’re running Bullseye 64bit legacy OS.
It may be that bullseye uses another rendering engine other than X.
First let’s check that your PI has the xrandr comand at all.
To do that, let’s open our terminal and type command -v xrandr.

If xrandr is available to you, the terminal should return to you the location.

For example I’m on an apple computer right now.
My computer does have the list (ls) command, and it also has the manual (man) command.
It does not have the xrandr command, and so I get nothing back when I check for it.

--> command -v ls
/bin/ls
--> command -v man
/usr/bin/man
--> command -v xrandr
--> 

If you do have xrandr

I had to do a quick google and found this useful article that looks right to me. This -s flag looks like it’s the jam.

from that article
Use the xrandr command like:
xrandr -s <resolution>
So, for example:
xrandr -s 1920x1080

If this doesn’t work, have a look at some other suggestions in that article I linked above.
Does that help clarify? :slight_smile:
Pix :heavy_heart_exclamation:

2 Likes

Hi @Pixmusix
Thank you for the explanation! So well laid out, I really appreciate it.
The Pi does not have xrandr installed.
I did however fix my problem. And I believe it was an operator error, I think I originally installed incorrect drivers. When I looked closer at the goodtft/LCD-show repository I noticed there was a branch for the ‘retropie installation’ which being a older version of Bullseye 64bit that I am running I was able to load those drivers, few adjustments in the raspi config and some changes to my code in VIM and I have a much more readable version of my desired visual result.
Now to just make a few changes to my code to reflect the Pi its being run on and I have what I was after.
Thank you for your help!
BPT

3 Likes

Ah! Good to know for future.
Must be a recent addition to Raspberry PI OS.
Thanks for tuning back and letting me know.

Mate you’re super welcome.
Looking great!

Pix :heavy_heart_exclamation:

1 Like