On my Raspberry Pi 4 I had to look up the calibration procedure again which we already discussed in #646.
I would suggest to install the xinput_calibrator tool by default (build_sdcard.sh).
For the setup procedure we should either create a menu entry or a bash script. The procedure is simple but - of course - needs user interaction on the screen.
Start tool and let user calibrate:
sudo -u pi DISPLAY=:0.0 xinput_calibrator --output-filename /tmp/99-calibration.conf
Copy data to xorg config (attention: check for other things that touch this file - e.g. rotation)
sudo cp /tmp/99-calibration.conf /etc/X11/xorg.conf.d/99-calibration.conf
sudo init 3
sleep 1
sudo init 5
Unfortunately the touch on my screen is all over the place and even when the pointer would move I couldn't get it to hit the first calibration point.
I have the usual screeb from the shopping list with the XPT2046 Touch Controller
Workflow before attempting the calibration:
SERVICE menu. (otherwise error: Unable to connect to X server )Install command for the xinput-calibrator:
sudo dpkg -i /home/admin/LCD-show/xinput-calibrator_0.7.5-1_armhf.deb
when running:
sudo -u pi DISPLAY=:0.0 xinput_calibrator --output-filename /tmp/99-calibration.conf
The message suggests there is a `get_precalib.sh':
Calibrating standard Xorg driver "ADS7846 Touchscreen"
current calibration values: min_x=0, max_x=65535 and min_y=0, max_y=65535
If these values are estimated wrong, either supply it manually with the --precalib option, or run the 'get_precalib.sh' script to automatically get it (through HAL).
I could not find that on my RPi or in https://github.com/goodtft/LCD-show.
Did you need any further steps I should do to get the touchscreen working (like tusing the ts_calibrate described here: http://www.circuitbasics.com/raspberry-pi-touchscreen-calibration-screen-rotation/) ?
I will have another screen soon, will test that too.
I can't recall ever having used get_precalib.sh.
I'm not sure whether you need to Disable LCD rotate.. my config after calibration looks like this (take not of the SwapAxes):
Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "Calibration" "239 3911 3852 279"
Option "SwapAxes" "1"
EndSection
I will try to substitute your setting to the conf file, it might be that my touch settings are off by too much.
Do you have a shim fan on the GPIO under the screen (just out of curiosity)?
Do you have a shim fan on the GPIO under the screen (just out of curiosity)?
Yes, I do.
I have no luck with this screen, the pointer only moves in the lower left quarter if anywhere, I consider it is broken. Waiting an other one.
Good news, my new screen (with power pins and a fan under it) is working out of the box!
@rootzoll this somehow needs to be done when touchscreen is activated (or at least an option on the menu).
All touchscreens I had were almost working good by default. I think so we dont need to force a calibration - but it should be an option in the hardware sub menu for the future.
OK I added touchscreen calibration as an option to the main menu when touchscreen is activated.
Tested and works fine. Closing Issue.