The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Waveshare DSI 7.9 Touch display on Moode 9
#1
Hi
just upgraded to latest Moode 9.0 release. Unfortunately my solution for running a local Waveshare DSI 7.9 display on 8.3.9 is not working anymore.

But here is the solution to make it working again:

The necessary LCD drivers are now included in the Bookworm release, no need to install drivers Smile

Just need to enable it in /boot/firmware/config.txt

Code:
$ sudo nano /boot/firmware/config.txt
insert
Code:
dtoverlay=vc4-kms-dsi-waveshare-panel,7_9_inch
and save.
Since this display has portrait orientation one need to change it for boot messages:
Edit /boot/firmware/cmdline.txt
Code:
$ sudo nano /boot/firmware/cmdline.txt
insert this in front of the command line:
Code:
video=HDMI-1:d video=HDMI-2:d video=DSI-1:400x1280e,rotate=270
save it. after a reboot boot messages appears in landscape orientation.

Now one need to tell X11 the same. Edit .xinitrc in the home directory:
Code:
$ cd
$ sudo nano .xinitrc
insert these lines:

Code:
# disable HDMI ports
xrandr --output HDMI-1 --off
xrandr --output HDMI-2 --off

#Force rotation for Waveshare
xrandr --output DSI-1 --rotate right --mode 400x1280

fbset --geometry 1280 400 1280 400 16

# Capture screen size
#SCREENSIZE="$(fbset -s | awk '$1 == "geometry" { print $2","$3 }')"
SCREENSIZE="1280,400"
Now after a reboot the local display will work as expected in landscape orientation.
Last thing to do is change the orientation of the touchscreen. Unfortunately this needs to be done in the xserver configuration.
First install libinput if not already there:
Code:
$ sudo apt-get install xserver-xorg-input-libinput
Then create a local config directory:
Code:
$ sudo mkdir /etc/X11/xorg.conf.d
Now copy over the template and edit the copied file:
Code:
$ sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
$ sudo nano /etc/X11/xorg.conf.d/40-libinput.conf
insert the right option into the touchscreen section select from
#90°Right touch rotation: 
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"

#180° Inverted touch rotation:
#Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
#270° Left rotation:
#Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"


The resulting section should look like:
Code:
Section "InputClass"
       Identifier "libinput touchscreen catchall"
       MatchIsTouchscreen "on"
       Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
       MatchDevicePath "/dev/input/event*"
       Driver "libinput"
EndSection
Voilà one more reboot and every thing works as expected.

much joy with Waveshare 7.9 DSI Touch display!
Reply


Messages In This Thread
Waveshare DSI 7.9 Touch display on Moode 9 - by felix1024 - 05-31-2024, 03:36 PM

Forum Jump: