Date: March 9, 2019
Me getting old. May be the best way is to document down how I did what, did everything on my RP4 (Raspberry Pi 4). I will also share what went wrong, and what is correct too. Learning from mistake will make it work.
The other day, I bought a LCD screen for my RP4. I believe it is a MHS-3.5inch Clone.
Why I know? Because there is no MHS word there. But I know it can work with the LCD driver from MHS as the chipsets used is the same.
Why there is a fan there?
This is the nice casing I bought from Amazon.
This is how you fit the the screen onto the RP4.
Remember we asked why there is a fan there?
It is to reduce heat from the RP4. The new RP4 runs at much high speed, and produce a lot of heat. So, they need a fan to clean those heat.
Won’t make a lot of diff, but at least there is a fan there.
You cover the box, it becomes like this. And since it is a touch screen, you can use a sylus with the screen.
But trust me, the screen is too small for anything. But you can write simple GUI that can touch the button for your program.
Let’s install the driver. As you can see, when you boot up the RP4, the 3.5 inch screen is blank white.
Do the following…
sudo rm -rf LCD-show
git clone https://github.com/gooddtft/LCD-show
chmod -R 755 LCD-show
This will correctly set the launch code to use specific screen. It will reboot to the correct HDMI screen.
But if you also connect the RP4 to HDMI, then, by right both screen should appear. Unfortunately, for me, HDMI working fine, but the small 3.5″ screen still give a blank white screen.
Seems like a lot of people are angry with the issue that it does not work. So, you have to read thru and try and error.
So, for me, a simple fix is…
sudo apt-get install fbi
I suspect this has something to do with the frame buffer interface. So, once you install this, and I can see my small 3.5″ is rebooted correctly. (sorry, I have to place it upside down like that. But I think I can change that too!)
So, the stupid case has the USB-C and mini HDMI on one side. So, my whole screen is upside down. No problem.
sudo nano config.txt
change the line that has
And now, the orientation of the screen is correctly done.
This is what the config.txt file should look like for the last few lines.
Now, I am happy.
For you guys, if you bought the 3.5 inch screen, in general, it should work, but you should know which one you bought. So that you can run the correct installation scripts.
Something that I did not mentioned, is the default installation script will change the screen resolution to very very low resolution. So, all you need is to go to Preference -> Raspberry Pi Configuration -> Display Tab -> Set Resolution to “CEA mode 4 1280×720 60Hz 16:9”. You can actually try a few so that it is correct for you.
Next, let’s try to see if we can optimize a bit here and there. Some will work, some won’t.
Don’t do the following. Changing it to /dev/fb1 will hang the screen.
When the screen is hung, it looks like this. Not to worry, simply go to the iMac to SSH into your RP4. The screen is hung, but not the OS. So, you still be able to revert all changes.
The other thing I found something wrong is, the touch screen is not callibrated at all!
See from the following… When I use the stylus to touch the screen, the stylus goes hay-wired. So, we need to fix this.
Forget about again, all the below. It does not work well.
just go and install the following.
sudo apt-get install -y xinput-calibrator
Then, you go to
Menu -> Prefernce -> Calibrate Touchscreen
And remember to Edit the new calibration into the 99-calibration.conf file
After changing all these, everything works. Next time, I. also have a reference point to refer to, configure my 3.5″ LCD screen and the Touch Screen.