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 operating sistem , there is no need for recompiling the kernel because eGalax driver is now included into 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

In order 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 messsage “not supported” on the screen.
In this case, you will have to make 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 this settings:

hdmi_cvt=800 480 60 3 0 0 0
hdmi_group=2
hdmi_mode=87
hdmi_drive=1

– 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:
./configure
make
sudo make install
Now you can run xinput calibrator from terminal by typing :

xinput_calibrator and hit Enter.
When xinput calibrator is running , it will ask tou 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:

/etc/X11/xorg.conf.d

First, we will ckeck if that folder exists:

ls /etc/X11/xorg.conf.d

create folder if it not exists:

sudo mkdir /etc/X11/xorg.conf.d

crate 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 step 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

Check these resources too:
http://home.eeti.com.tw/index2.html
https://www.raspberrypi.org/forums/viewtopic.php?p=425962#p425962

Leave a Reply

Your email address will not be published. Required fields are marked *