LCD xpt2046 3.5" display settings

For a new knobless Zynthian
my LCD xpt2046 3.5" display works using PiScreen 3.5 (V1) settings:

Config:
dtoverlay=piscreen,speed=16000000,rotate=90

but…

…the touch are inverted: left with right, up with down.

Are there any magical settings to write in config windows to fix it? :slightly_smiling_face:

How can I do the calibration without knobs and buttons?

I seem to remember doing it with a mouse, which sits nicely with the cursor bug, recently being fixed.

1 Like

Thanks Chris: with mouse I can arrive to calibration;
touch is strill inverted
I would like to understand if I can fix by Config.

There are settings like dtoverlay=ads7846,speed=2000000,cs=1,penirq=17,penirq_pull=2,swapxy=1,xohms=100,pmax=255
but I cannot understand the meaning

There is the screen calibration tool in the GUI admin section, Have you tried it…?

https://wiki.zynthian.org/index.php/Zynthian_UI_User_Guide_-_V1/V4#Touchscreen_Calibration

yes but still the same problem of inverted touch

Now that’s a pain…

That generally sorted out those sorts of problems before. Digging into the forum will show a fair bit of discussion on this issue.

Have you looked outside the zynthian community for settings ? It can get a bit, as you describe it, magical but that might flush something out…

All I can contribute is it used to be a right pain and if you did get it right it would reset when you powered off, but this is the first mention of it that wasn’t addressed by the tool.

In my reTerminal, I had the same problem. I fixed it editing the file /usr/share/X11/xorg.conf.d/40-libinput.conf. There, look for the section InputClass with the Identifier libinput touchscreen catchall, and in that section, add the following option: Option "InvertX" "1". The whole section would be as follows:

Section "InputClass"
        Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "InvertX" "1"
EndSection

Hope it helps!

1 Like

thanks Oscaracena:
how could I use than in Zynthian?

1 Like

step 1 - get yourself to a Command Line on Zynthian - either “ssh” to Z or access terminal in webconf. If you don’t know how research or come back and ask.

step 2 - get into an editor on the file. vi is available along with many others. If you don’t know how you can find a VI tutorial on the web or in a book. Or ask if you get stuck here.

step 3 - add the section indicated by @oscaracena above.

step 4 - Try it!

2 Likes