Template: 7inch DSI LCD C User Manual

From Waveshare Wiki
Jump to: navigation, search

Features

  • 7inch IPS display with capacitive touch panel, hardware resolution is 1024 x 600
  • Capacitive touch, supports up to 5-points touch
  • Toughened glass capacitive touch panel, 6H hardness
  • DSI interface, refresh rate up to 60Hz.
  • Working with Raspberry Pi, we provide the driver for Raspberry Pi OS.
  • Brightness is adjustable by software

Hardware Connection

  • Connect the 7inch DSI LCD (C) (display hereafter) to the DSI interface of Raspberry Pi boards by 15PIN FPC cable.
  • For easy use, you can fix the Raspberry Pi board to the backside of the display by standoffs and screws provided.
  • Connect the 4PIN cable between the display and the 40PIN of Raspberry Pi according to the figure below.

Install Driver

Method 1
Use a pre-built image
We provide a ready-to-use image based on the 2021-05-07-raspios-buster-armhf-full image. Please download it and unzip it to get the img file. Write the .img file to your TF card and test it in your Raspberry Pi.
Method 2
Install the driver manually

Note: If you use the Raspberry Pi OS system and don’t know the two branches of Raspberry Pi OS, you can check the following introduction #Raspberry Pi OS branch introduction

  • Download the newest Raspberry Pi OS and unzip it.
  • Connect the TF card to your PC and format it by SDFormatter software
  • Write the .img file to your TF card by Win32DiskImager image. Please take care of the drive and the file path when writing.
  • After writing, eject it from PC and connect to Raspberry Pi board.
  • Power and start the Raspberry Pi, open the terminal and run the following commands to install the driver.(You may need to remote connect the Pi via ssh or connect a HDMI display for installing)
git clone git://github.com/waveshare/7inch-DSI-LCD-C.git
cd 7inch-DSI-LCD-C

Enter uname -a at the terminal to check the kernel version, and cd to the corresponding file directory

If your kernel is 5.10.63, please run the below command:

cd  WS_7inchDSI1024x600_5.10.63

If your kernel is 5.10.17, please run the below command:

cd WS_7inchDSI1024x600_5.10.17

And then install the driver as below:

chmod +x WS_7inchDSI1024x600_MAIN.sh
sudo ./WS_7inchDSI1024x600_MAIN.sh
sudo reboot

Note: To install the driver, you should connect the Rasberry Pi to the network

  • Reboot the Raspberry Pi and test

Raspberry Pi OS branch introduction

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. Use raspicam as the default camera subsystem. The Bullseye branch adds some new features, among which KMS is used as the default display driver, and libcamera is used as the default camera subsystem.
  • For projects that work with this display, we recommend that users use the Bullseye branch system, Because on this system it can be used normally with a simple configuration, and also can use the default I2C0 of the DSI interface to communicate without occupying the I2C1 in 40PIN GPIO of the Raspberry Pi.
  • For users who must use the Buster branch, we currently also provide related drivers, but because the DSI driver needs to load the KMS display driver by default, the default camera subsystem of raspicam under the Buster branch cannot be used and needs to be recompiled and installed the libcamera camera subsystem (for novices, there is a certain degree of difficulty). And in order to prevent the raspcam camera subsystem from conflicting with the DSI driver, the DSI driver will occupy the I2C1 in the Raspberry Pi 40PIN GPIO.
  • For the Bullseye branch, the Waveshare R&D team will maintain long-term updates. For the Buster branch, we will continue to support it until June 2024 (because the Raspberry Pi Foundation will not support the Buster branch after this time).

The following is the system support list for this display:

System Name Branch
2021-10-30-raspios-bullseye-armhf bullseye
2021-12-02-raspios-buster-armhf buster
2021-05-07-raspios-buster-armhf buster


The download link of the image

Raspberrypios01.jpg

Raspberry Pi OS is the Bullseye branch, and Raspberry Pi OS (Legacy) is the Buster branch. More information you can refer to:

Brightness Control

Method 1

Modify the config.txt file.
Change the line dtoverlay=WS_7inchDSI1024x600_Screen to dtoverlay=WS_7inchDSI1024x600_Screen,Backlight=x
x is the value of the brighness, it should be in the range from 0 to 255, 0 is dimest and 255 is the brightest.
For example, you can set it as dtoverlay=WS_7inchDSI1024x600_Screen,Backlight=255
After setting, reboot the Raspberry Pi.

Method 2

Waveshare provides a tool for adjusting brightness in GUI (only supports Raspberry Pi OS), you can install it with the following commands.

cd 7inch-DSI-LCD-C
cd brightness
sudo chmod +x install.sh
sudo ./install.sh

After installing, you can choose Menu -> Accessories -> Brightness to open the tool and adjust.

Top-2.png

Use CSI Camera on the Buster branch

  • Description

The driver of the 7inch DSI LCD (C) will be in conflict with raspicam.

In this case, if you want to use the camera, you need to install the new libcamera.

libcamera-apps is an application based on libcamera, it have all the function of libcamera.

  • Hardware connection

Shutdown Raspberry Pi first, connect the camera to Raspberry Pi and power it on.

Note: Please do not replug the camera while the Raspberry Pi working, otherwise, the camera interface and camera may be damaged.

  • Update and open the camera
libcamera-apps support Pi 3 and Pi 4.
  • Update Raspberry Pi
sudo apt update
  • Configure dtoverlay in /boot/config.txt file according to the camera type.
sudo nano /boot/config.txt

Add the following lines to the config.txt file:

 #IMX219 Camera:
 dtoverlay=imx219
 #If you use OV5647 camera, please change it to this line:
 #dtoverlay=ov5647
 #If you use IMX477 camera, please change it to this line:
 #dtoverlay=imx477

Open camera by raspi-config:

sudo raspi-config

Choose Interface Options -》 P1 Camera and choose Yes -》 Finish -》 Yes, finally, reboot Raspberry Pi.

  • Install libcamera Method 1

Note 1: We commend you to use the Pi 4 to install and build the libcamera-apps.

Note 2: If you are not able to install it, recommend you use the ready-to-use image.

  • Install denpendencies of libcamera:
 sudo apt install libboost-dev -y
 sudo apt install libgnutls28-dev openssl libtiff5-dev -y
 sudo apt install qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5 -y
 sudo apt install meson -y
 sudo pip3 install pyyaml ply
 sudo pip3 install --upgrade meson
  • Download and built the libcamera:
 git clone git://linuxtv.org/libcamera.git
 cd libcamera
 meson build
 cd build
 meson configure -Dpipelines=raspberrypi -Dtest=false
 cd ..
 ninja -C build
 sudo ninja -C build install
  • libepoxy
 sudo apt install libegl1-mesa-dev
 cd
 git clone https://github.com/anholt/libepoxy.git
 cd libepoxy
 mkdir _build
 cd _build
 meson
 ninja
 sudo ninja install
  • libcamera-apps

Install Libcamera-apps

 sudo apt install cmake libboost-program-options-dev libdrm-dev libexif-dev
 cd
 git clone https://github.com/raspberrypi/libcamera-apps.git
 cd libcamera-apps
 mkdir build
 cd build
 cmake ..
 make -j4
<pre>
Test the camera by libcamera-hello:
<pre>
 ./libcamera-hello

About the comamnd:

libcamera-still   #Similar to raspistill
libcamera-vid     #Similar to raspivid
libcamera-raw     #a version of libcamera-vid, use for save original video without compression.
libcamera-hello   #Basic command for previewing camera.
libcamera-jpeg    #A simple version of libcamera——Preview and captur JPEG.


Note, the libcamera-app will conver the original DSI driver, you need to install it again for displaying.

cd 7inch-DSI-LCD-C
sudo ./WS_7inchDSI1024x600_MAIN.sh
sudo reboot
  • Install libcamera,Method 2

For easy use, we make a script in Github.

Please update the Raspberry Pi first:

sudo apt-get update

You can install it by the following commands:

1. Download and install the libcamera-install file

git clone https://github.com/waveshare/libcamera-install.git
cd libcamera-install
sudo chmod +x install_libcamera_all.sh
sudo ./install_libcamera_all.sh

2. It is successful if the line "echo "install Succeed" is printed, and it is failed if the line "echo "install Fail" is printed.

After installing, three folders are saved in the libcamera-install directory, libcamera libcamera-apps libepoxy folders. If you want to reinstall the libcamera, you need to detect these folders first.


3. Restart the software.

sudo reboot

4. Test the camera to preview for 5s

cd /home/pilibcamera-install/libcamera-apps/build
./libcamera-hello
  • More

For more information about the libcamera, please refer to:

https://www.raspberrypi.org/documentation/linux/software/libcamera/README.md

https://github.com/raspberrypi/libcamera-apps/blob/main/README.md

https://www.raspberrypi.org/documentation/linux/software/libcamera/rpi_SOFT_libcamera_1p2.pdf

Notes

1.Update the system

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

After updating the system, some files of the originally installed driver will be overwritten, in this case the driver needs to be reinstalled to display normally.

2. Replace the motherboard

If the driver originally installed on Raspberry Pi 4 Model B, the user replaces the motherboard, such as modifying it to Raspberry Pi 3 Model B+, which will cause the display to fail to display normally. Because Pi4 and Pi3 need to load different driver files.

In this case, the driver needs to be reinstalled on the new motherboard to display normally.