Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pierrealexaline/0aa6d38ccdcf6cb21fc4c22387a413be to your computer and use it in GitHub Desktop.
Save pierrealexaline/0aa6d38ccdcf6cb21fc4c22387a413be to your computer and use it in GitHub Desktop.
How to connect and configure a 7 inch touchscreen (model C) from waveshare to a rasberry pi 4 model B

How to connect and configure a 7 inch touchscreen (model C) from waveshare to a rasberry pi 4 model B

presentation

Since the last version of Raspbian (Buster) and with the last version of the raspberry pi (rpi4b) the tutorial of the screen has not being updated correctly by Waveshare.

The 7 inch hdmi screen (model C) from waveshare

Waveshare 7 inch screen (model C). The 7 screen inch model C from Waveshare is originaly a basic LCD 1024x600x60Htz Hdmi touchscreen caracterized by a very low power consumption (5v - 30mA to 300 mA with backlight on). It can run on an USB port. This screen is compatible with most OS and architectures (it can run on 32Bit, Arm, 64bit, or Windows 10, linux Debian, and a lot of SBC like the Bananapi, Raspberry pi, Odroid ...).

The raspberry pi model 4 model B

Raspberry Pi 4 Model B - official presentation page. The Raspberry Pi 4 model B has been launched at the end of 2019. Some problems occurs and need to be fixed. For example, Ubuntu is not totaly compatible at this date. It can't manage the new 4 Gb range of ram of the rpi4b. One of this problem was : how to connect and use the 7 inch touchscreen (model C) from waveshare with this new rpi ? After a few hours of investigation this can be done !

prerequisites

  • A rpi with raspbian buster pre-installed,
  • a PC with a terminal on the same network and a ssh client installed,
  • an official adaptator 5.1V+ - 3A !very Important!.

prepare SD card before first boot

After burned the Raspbian Buster OS, open the sdcard on a pc, open the file config.txt at the root on the boot partition with a text editor.

Change the config.txt file on boot partition

comment this lines (*), just add a "#" before each line :

  #dtoverlay=vc4-fkms-v3d
  #max_framebuffers=2

And add this lines just under [rpi4] :

  max_usb_current=1
  hdmi_force_hotplug=1
  config_hdmi_boost=7
  hdmi_group=2
  hdmi_mode=88
  hdmi_drive=1
  hdmi_cvt 1024 600 60 6 0 0 0

Save the file at the same place.

(*) Recommandation from waveshare and Raspberry foundation. The fkms overlay is not supported by this type of screen. We can use standard kms overlay and work without 3d material acceleration. This work perfectly.

Add a 'ssh' file to boot partition

on the boot partition add a file named 'ssh' (without extention) for activate ssh at first boot.

Connect via SSH on first boot from your PC to the rpi4b

reboot the pi4 without the screen but with connected to your network, open a PC (connected on the same network) open a ssh client (like Putty) and connect it to the raspberry pi (with default user/password : pi/raspberry)

Debian - example on how to connect your pi in ssh : ssh 192.168.0.87 -p22 replace the ip and port with your pi ip and ssh port. First, on the PC, type in the terminal :

  sudo apt update && sudo apt-upgrade -y
  sudo raspi-config

Make some change in raspi-config

in raspi-config , go to advanced options.

  • select "resolution" set to DMT 88 1024x600 60Hz 15:9,
  • select "Pi 4 Video Output" set to V1 Enable 4Kp60 HDMI,
  • select "GL driver" and set to Legacy Original non-GL desktop driver,

last thing ... connect to USB3 port

connect the waveshare screen to the raspberry pi 4 . The screen mini USB must be connected on a USB3 port because USB2.0 seems limited in Volts or A and can't give enough to the screen) .

reboot ...

reboot the pi4... You're done !!!. You can now use VLC in 4k mode with your HDMI screen, or use touch screen for launch raspbian software ...etc

@jbprog
Copy link

jbprog commented Jul 19, 2023

Hello,
do you know if this tutorial will work with the model R as well? It's identical, but it's resistive instead of capacitive.
Another thing: can I edit the file /boot/config.txt after the installation? or do I really need to edit it in the SD card before even putting the card into the raspberry pi?

@pierrealexaline
Copy link
Author

pierrealexaline commented Jul 19, 2023

Hello, it's depend which raspberry pi you're used and which os. But you can try these solutions:

Solution 1:

official documentation.Or you can try another from Waveshare wiki.

Solution 2:

Connect the screen without any modification (with some OS it's seem to be supported natively).
Just add this in config.txt and reboot the pi (https://www.amazon.fr/Waveshare-7inch-LCD-HDMI-Resolution/dp/B01MDJ2FEX) :

max_usb_current=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 1024 600 60 6 0 0 0
hdmi_drive=1 

Nota : these modifications is only for add the touch screen support. The screen must be functional before.

You can find more informations about config.txt here : https://www.raspberrypi.com/documentation/computers/config_txt.html or here http://papy-tux.legtux.org/doc1337/index.html (in french)

Solution 3

If there is noway with this solutions you can try with the parameters described in the tutorial above(voltage and amperage seem to be the same).

About the config file

And yes you can edit the config file after the boot. But you need to reboot it if you want the new configuration to take effect.

Nota: you must create empty file named 'ssh' (without extension) at the root of the boot partition before the first boot if you want to work with ssh.

Could you write a return here please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment