Template: 7inch HDMI LCD H Pi Guides

From Waveshare Wiki
Jump to: navigation, search

Working with Raspberry Pi

Supports Raspberry Pi OS / Ubuntu / Kali / Retropie system.
When working with Raspberry Pi, you should set the resolution of the LCD by yourself, otherwise, the LCD screen will not work. For more detailed information, please read the following section.

Please download the latest version of the image on the Raspberry Pi official website.

1) Download the compressed file to the PC, and unzip it to get the .img file.

2) Connect the TF card to the PC, and use SDFormatter software to format the TF card.

3) Open the Win32DiskImager software, select the system image downloaded in step 1, and click 'Write' to write the system image.

4) After the image has finished writing, open the config.txt file in the root directory of the TF card. 5) Add the following lines to the end of config.txt, then save and eject the TF card safely.

hdmi_force_hotplug=1 
config_hdmi_boost=10
hdmi_group=2 
hdmi_mode=87 
hdmi_cvt 1024 600 60 6 0 0 0

6) Save and connect the TF card to your Pi then power up.

7) Connect the Touch interface of the LCD to the USB port of Raspberry Pi.

8) Connect the HDMI interface of the LCD to the HDMI port of Raspberry Pi.

Note:

  • When the Raspberry Pi is connected to multiple monitors at the same time, the touch effect of the 7-inch LCD will be applied to the main screen by default. If you need to specify the touch to the secondary screen, see#Calibrate double-touchscreen in Pi 4
  • On December 2, 2021, the Raspberry Pi OS was divided into two branches, the Buster branch, and the Bullseye branch. The Buster branch is a continuation of the old system and is more stable. The Bullseye branch added some new features, using open-source libraries and new interfaces. Since the current Bullseye branch has just been released shortly, it is not stable yet. If you are an industrial user, it is strongly recommended to use the Buster branch.
  • If you use the Buster branch system, you can use it according to the above configuration. But if you are using the Bullseye branch system, you need to modify the default KMS driver to the FKMS driver to display the system desktop normally

Modification method: Open the config.txt file in the root directory of the TF card, and find the following line:

dtoverlay=vc4-kms-v3d

change into

dtoverlay=vc4-fkms-v3d
  • If you need to use the CSI camera under the Bullseye branch system. Since this branch uses the libcamera camera library by default, the library doesn't support FKMS drivers.

So in addition to the above modification, you also need to install the Raspicam camera library.

The installation method is as follows:

cd ~
sudo apt install cmake
git clone https://github.com/raspberrypi/userland
cd userland
./buildme
sudo cp build/bin/* /bin/

Then execute the following command to shut down the system:

poweroff

Connect the Raspberry Pi camera to the CSI interface of the Raspberry Pi, power on the Raspberry Pi again, and after the system boots, execute the following command:

Take a picture:

raspistill -o image.jpg

Take a video:

raspivid -o video.h264 -t 10000

Calibrate double-touchscreen in Pi 4

  • 1. Open the terminal and input command: xrandr to check HDMI-ID of the main monitor. (It is HDMI-1 most time);

Pi4-conf-touch-1.png

  • 2. Input command xinput in the terminal, and check the touch ID of the main monitor. (There should be two IDs, you can touch displays to check which is the main one);

Pi4-conf-touch-2.png

  • 3.Tun the command:xinput map-to-output <touch ID> <HDMI-ID>

(Don't forget to change the ID to the correct one just like: xinput map-to-output 7 HDMI-1)

Pi4-conf-touch-3.png

  • 4. You can set the command to auto-run while booting and make it affect all the time:
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

Add the line to the file: xinput map-to-output 7 HDMI-1 (Don't forget to change the ID to the correct one), then reboot.

Pi4-auto-start-4.png