Raspberry pi 7 inch touch screen calibration
eGalax 7 inch touch screen calibration can be made using xinput calibrator on Raspberry Pi.
If you are using the latest version of the operating system, there is no need for recompiling the kernel because the eGalax driver is now included in the kernel.
I tested it on Raspberry Pi 3 with Raspbian Jessie installed and it works flawlessly.
How do I know what kind of touch screen I’ve got ?
Boot up the Raspberry Pi and test if the 7-inch touch screen gets recognized correctly:
dmesg | grep usb #Search for "input: eGalax Inc. Touch " in the output of the command. #Run this command to find where your input devices are linked to: ls -al /dev/input/by-id
To run a 7-inch touch screen calibration, you will have to follow these steps:
1. Raspberry Pi 7 inch display setup
If your display resolution is not supported by Raspberry Pi, you will have to make some configurations before using it. Check this page and look for your resolution.
If your 7-inch touch screen resolution is not supported, and you will try to connect it to your Raspberry Pi, you will probably see the message “not supported” on the screen.
In this case, you will have to make the following settings:
- First, connect your raspberry pi to another screen that works (pc monitor will be fine).
- Power on your raspberry pi and open terminal run this command:
sudo nano /boot/config.txt
- Go at the bottom of the file and paste these settings:
hdmi_cvt=800 480 60 3 0 0 0
- Power off and connect your Raspberry Pi to your new 7-inch touch screen display
2. Raspberry pi 7-inch touch screen calibration
Before calibrating your 7-inch touch screen, you will have to install some dependencies:
sudo apt-get install libx11-dev libxext-dev libxi-dev x11proto-input-dev
Download xinput_calibrator somewhere in the Raspberry PI’s folder structure from HERE .wget http://github.com/downloads/tias/xinput_calibrator/xinput_calibrator-0.7.5.tar.gz
Go to the folder where you downloaded xinput calibrator and run this command:
tar -zxvf file.tar.gz
After you unpacked xinput calibrator, navigate to the unpacked folder and then install it using:
sudo make install
Now you can run xinput calibrator from the terminal by typing :
xinput_calibrator and hit Enter.
When xinput calibrator is running, it will ask you to touch some points on the 7-inch touchscreen. If it fails to receive some touch events, the touch screen calibration will start over again.
It is better to use a stylus because it has a sharper tip.
When the touch screen calibration is done, you will receive a message like this :
Section "InputClass" Identifier "calibration" MatchProduct "eGalax Inc. USB TouchController" Option "Calibration" "121 1917 317 1741" Option "SwapAxes" "1" EndSection
You will need to copy that information and put it into a config file:
First, we will check if that folder exists:
create folder if it not exists:
sudo mkdir /etc/X11/xorg.conf.d
create a file called 99-calibration.conf in that folder and edit it:
sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
After saving the file (press CTRL + X , Y), reboot and then test your 7-inch touch screen calibration.
You can repeat these steps later if the calibration wasn’t enough precise.
3. Troubleshooting the Raspberry pi 7-inch touch screen calibration
If your y-axis or y-axis is inverted, modify the settings file to look like this:
Section "InputClass" Identifier "calibration" MatchProduct "eGalax Inc. USB TouchController" Option "Calibration" "121 1917 317 1741" Option "SwapAxes" "1" Option "InvertY" "true" Option "InvertX" "true" EndSection
What if you touch the point it places on the screen, but it doesn’t get detected?
This is a great post but it assumes everything is fine. My touchscreen is not working in about the top inch of the screen, so where it put that touchpoint is outside of what my screen detects.
I have a similar issue (if I have well understood Paul)
I can hit the two upper calibration points with my fingers and I can see the mouse Arrow moving half screen below, Cannot get the two lower calibration points working. It looks like the hitting points are expected below out of the screen.
So I cannot complete the calibration
If anyone has an idea, I will appreciate
Happy New Year!!!