Test3

From Waveshare Wiki
Revision as of 03:22, 13 March 2024 by Waveshare-admin (talk | contribs)
Jump to: navigation, search

Software Setting

Method 1: Install Manually

  1. Download the image of the newest version Raspberry Pi, download the compressed file to the PC, and extract the .img file.
  2. Connect TF card to PC, use SDFormatter to format TF card.
  3. Open Win32DiskImager software, select the system image prepared in step 1 and click write to burn the system image.
  4. After the programming is completed, connect the TF card to the Raspberry Pi, start the Raspberry Pi, and log in to the terminal of the Raspberry Pi (you can connect the Raspberry Pi to an HDMI display or log in remotely with SSH).


  1. Step 1: Download and enter the Waveshare-DSI-LCD driver folder

git clone https://github.com/waveshare/Waveshare-DSI-LCD cd Waveshare-DSI-LCD

  1. Step 2: Enter in the terminal to view the kernel version and cd to the corresponding file directory
  2. 6.1.21 then run the following command

cd 6.1.21

  1. Step 3: Please check the bits of your system, enter the 32 directory for 32-bit systems, and enter the 64 directory for 64-bit systems

cd 32

  1. cd 64
  1. Step 4: Enter your corresponding model command to install the driver, pay attention to the selection of the I2C DIP switch
  2. 2.8inch DSI LCD 480×640 Driver:

sudo bash ./WS_xinchDSI_MAIN.sh 28 I2C0

  1. Step 5: Wait for a few seconds, when the driver installation is complete and no error is prompted, restart and load the DSI driver and it can be used normally

sudo reboot

Note: The above steps need to ensure that the Raspberry Pi can be connected to the Internet normally.
5. Wait for the system to restart, it will be able to display and touch normally.

Method 2: Program Pre-install Image

1. Click to download Waveshare DSI LCD - Pi4 pre-install image and unzip it to get ".img" file.
2. Connect the TF card to the PC and use SDFormatter to format the TF card.
3. Open Win32DiskImager software, choose the system image prepared in the first step, and then click "write" to write the system image,
4. After programming, open the "config.txt" file in the root directory of the TF card, add the following code at the end of config.txt, save and then safely remove the TF card.

dtoverlay=WS_xinchDSI_Screen,SCREEN_type=5,I2C_bus=10
dtoverlay=WS_xinchDSI_Touch,invertedx,invertedy,I2C_bus=10

5. Connect the TF card to the Raspberry Pi, and start the Raspberry Pi, wait for about 30 seconds to display and touch normally.

Rotation

Method 1: Graphical Interface Rotation

In the start menu, select: Preferences -> Screen Configuration -> Configure -> Screens -> DSI-1 -> Orientation, select the corresponding angle in it, click "√", select Yes, and restart.
4inch-DSI-LCD-Manual-02.jpg

Method 2: Rotation Display In Lite Version

sudo nano /boot/cmdline.txt
#Add a command corresponding to the display rotation angle at the beginning of the cmdline.txt file, save it and restart it to take effect
#display rotated 90 degrees
video=DSI-1:400x1280M@60,rotate=90
#display rotated 180 degrees
video=DSI-1:400x1280M@60,rotate=180
#display rotated 270 degrees
video=DSI-1:400x1280M@60,rotate=270

2.8inch DSI LCD05582.png

Touch To Rotate

sudo nano /boot/config.txt
#Modify the instruction of the touch rotation angle at the end of the config.txt file, and it will take effect after restarting (there is a 0° touch direction instruction by default)
#90°:
dtoverlay=WS_xinchDSI_Touch,invertedy,swappedxy
#180°:
dtoverlay=WS_xinchDSI_Touch
#270°:
dtoverlay=WS_xinchDSI_Touch,invertedx,swappedxy
#0°:
dtoverlay=WS_xinchDSI_Touch,invertedx,invertedy

Disable Touch

At the end of the config.txt file, add the following commands corresponding to disabling touch (the config file is located in the root directory of the TF card, and can also be accessed through the command: sudo nano /boot/config.txt):

disable_touchscreen=1

Note: After adding the command, it needs to be restarted to take effect.

Precaution

1. Update the system, such as executing the following command:

sudo apt-get update
sudo apt-get full-upgrade

After updating the system, some files of the originally installed driver may be overwritten, and the driver needs to be reinstalled to display normally.
2. Replace the motherboard
If the driver is originally installed on the Raspberry Pi 4 Model B, the user replaces the motherboard, such as modifying it to a Raspberry Pi 3 Model B+, the display will not display properly.
Because Pi4 and Pi3 need to load different driver files, you need to reinstall the driver on the new motherboard to display properly.