Comments (4)
I'm not using the touchscreen or a graphical desktop in my CM4 application, but I plugged it into a Raspberry Pi 400 running Bookworm with Wayland (not X11) to see.
By default, the display came up over HDMI, with the Wayland desktop, without me needing to set up the EDID as described above. It defaulted to portrait mode (HDMI port on the left as you look at the screen), and the "Screen Configuration" app did rotate the screen properly.
When I enabled SPI and added the touchscreen dtoverlay
from MPI4008-show to /boot/config.txt
, the touchscreen also worked as expected in the default portrait orientation. In other orientations, it behaved incorrectly; the X and Y axes appeared swapped and/or one of the axes was inverted.
$ sudo nano /boot/config.txt
dtparam=spi=on
dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900
While the dtoverlay
allows for swapping the axes, it doesn't allow for inverting them, so if you're not running the screen in its default portrait orientation and need the touchscreen, perhaps it's better to leave the dtoverlay
as-is and do everything with calibration.
For a rotated screen with correct touchscreen, create a new udev
rule file for the touchscreen, set the libinput
calibration matrix to correct the issues, and reboot (the Raspberry Pi Wayfire compositor doesn't appear to apply the changes live even when udevadm
is reloaded and triggered).
$ sudo nano /etc/udev/rules.d/99-mpi4008-ads7846.rules
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{name}=="ADS7846 Touchscreen", ENV{LIBINPUT_CALIBRATION_MATRIX}="0 1 0 -1 0 1"
For a "right" rotation according to Screen Configuration (HDMI port on the bottom as you look at the screen), this matrix worked: 0 1 0 -1 0 1
(this is the example above)
For a "left" rotation (HDMI port on the top): 0 -1 1 1 0 0
For an "inverted" rotation (HDMI port on the right): -1 0 1 0 -1 1
from lcd-show.
This worked perfectly!
from lcd-show.
Does this solve touchscreen issue?
from lcd-show.
This is incredibly interesting, thank you for taking the time to do this research. I am working on a few projects currently but I am very interested in trying your solution in the future.
from lcd-show.
Related Issues (20)
- RPi will not initialize with screen connected. Works if hot plugged after starting without it.
- [Solved] Raspberry Pi 5 - Display Resolution and Orientation stuck
- After installing drivers Screen White , But Touch working, Display on Hdmi HOT 4
- Question for terminal
- Two touch screens
- Scrolling is not detected on ADS7846 display
- Display stays white while bootup, how to show splash image or video instead?
- Force 4" MPI4008 to 720x1280 definition
- After this install i can not connect via vnc HOT 6
- Require TFT 3.5 display configuration for Raspberry Pi Bookworm release HOT 51
- raspi 4b LCD7C Ubuntu2404 can't work HOT 4
- MPI3508 安装脚本在 RPi 3B+ 的 Bookworm 系统下安装失败
- Low refresh rate on MHS-3.5” RPi Display HOT 4
- sudo rm -rf LCD-show git clone https://github.com/goodtft/LCD-show.git chmod -R 755 LCD-show cd LCD-show/
- sudo ./MPI3508-show
- Does the lcd screen cod work for raspberry pi 400?
- Does it support GC9106
- MPI5001 and RPi Zero 2 W and MoOde Audio
- Breaks USB serial Connection
- Conflicts With Picamera2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lcd-show.