Difference between revisions of "How to use 15 inch touchscreens"

(Created page with "Link title Instructions on the usage of the 15.6 inch SAW touchscreen (LCD-15.6TS) under Debian. This guide is tested with the LCD-15.6TS (with ETT5003U controller), dis...")
 
(Instructions on the usage of the 15.6 inch SAW touchscreen (LCD-15.6TS) under Debian.)
 
(28 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Link title]]
+
==Instructions on the usage of the 15.6 inch SAW touchscreen (LCD-15.6TS) under Debian.==
  
Instructions on the usage of the 15.6 inch SAW touchscreen (LCD-15.6TS) under Debian.
+
This guide is tested with the LCD-15.6TS (with ETT5003U controller), distributed by Olimex LTD. The setup included LCD-OLinuXino-15.6-FHD and A20-OLinuXino-MICRO.
 +
 
 +
Important: for the hardware connection you would need to provide 12V to the controller via the touchscreen display using the 4-pin molex connector (yellow wire = 12V input; black wire = GND). A free USB port is also required. The powering to the touchscreen is deliver through a standard 4-pin molex connector.
 +
 
 +
Establish the hardware connections and set the LCD properly (if using our displays remember to execute change_display.sh). Then in order to get the touchscreen working under the official Linux image do the following:
  
This guide is tested with the LCD-15.6TS (with ETT5003U controller), distributed by Olimex LTD. The setup included LCD-OLinuXino-15.6-FHD and A20-OLinuXino-MICRO.
+
'''1.''' Make sure the USB connection between the display and the board is established before powering the board. If it was connected already reboot the board.
 +
 
 +
'''2.''' Identify the event number of the USB connection of the touchscreen. Type "evtest" to get the proper event associated with the display. Additionally, you might plug-unplug the USB connection of the touchscreen to get the proper event number in the console (or use command dmesg | grep ETwo). It is usually "/dev/input/eventX".
 +
 
 +
'''3.''' Create a new 20-ts.conf file or add a new section in the 20-ts.conf file (remember to replace the USB event number with the number you got in point 1, we have used event2 as example)
  
Important: for the hardware connection you would need to provide 5V and 12V to the touchscreen display. A free USB port is also required. The powering to the touchscreen is deliver through a standard 4-pin molex connector.  
+
The file location should be: /usr/share/X11/xorg.conf.d/20-ts.conf
  
After all hardware connections are established to get the touchscreen working under the official Linux image do the following:
+
To create the file type:  
  
1. Identify the event number of the USB connection of the touschreen. You might plug-unplug the USB connection of the touchscreen to get the proper event number in the console (or use command dmesg | grep ETwo).
+
touch /usr/share/X11/xorg.conf.d/20-ts.conf
  
2. Create a new 20-ts.conf file or add a new section in the 20-ts.con file (remember to replace the USB event number with the number you got in point 1, we have used event2 as example)
+
To edit the file type:
  
The file location is: /usr/share/X11/xorg.conf.d/20-ts.conf
+
nano /usr/share/X11/xorg.conf.d/20-ts.conf
  
 
The file should contain the following:
 
The file should contain the following:
  
Section "InputClass"
+
Section "InputClass"
    Identifier "ETwo TouchScreen"
+
  Identifier "ETwo TouchScreen"
    MatchDevicePath "/dev/input/event2"
+
  MatchDevicePath "/dev/input/event2"
    MatchProduct "ETwoTouch Corp. ETwo TouchScreen"
+
  MatchProduct "ETwoTouch Corp. ETwo TouchScreen"
    Driver "tslib"
+
  Driver "tslib"
    Option "ScreenNumber" "0"
+
  Option "ScreenNumber" "0"
    Option "Rotate" "NONE"
+
  Option "Rotate" "NONE"
    Option "Width" "1920"
+
  Option "Width" "1920"
    Option "Height" "1080"
+
  Option "Height" "1080"
    Option "SendCoreEvents" "yes"
+
  Option "SendCoreEvents" "yes"
    Option "Type" "touchscreen"
+
  Option "Type" "touchscreen"
EndSection
+
EndSection
  
Remember to replace the event2 number with the number you got in point 1. The configuration is suitable for the FullHD 15.6 inch display. If you are using the 1366x768 (HD-ready) display replace the driver option defaults with "Width" "1366" and "Height" "768".
+
'''Remember to replace the event2 number with the number you got in point 1. The configuration is suitable for the FullHD 15.6 inch display. If you are using the 1366x768 (HD-ready) display replace the driver option defaults with "Width" "1366" and "Height" "768".'''
  
3. Create a new environment file or edit the environment file (again we have used event2 as our USB event, remember to replace it with the number of event you get in point 1.)
+
'''4.''' Create a new environment file or edit the environment file (again we have used event2 as our USB event, remember to replace it with the number of event you get in point 1.)
  
The file location is: /etc/environment  
+
The file is typically: /etc/environment - however it might be different in your board. Type:
  
TSLIB_TSEVENTTYPE=raw
+
nano /etc/environment
TSLIB_CONSOLEDEVICE=none
+
 
TSLIB_FBDEVICE=/dev/fb0
+
Paste the following inside:
TSLIB_TSDEVICE=/dev/input/event2
+
 
TSLIB_CALIBFILE=/etc/pointercal
+
TSLIB_TSEVENTTYPE=raw
TSLIB_CONFFILE=/usr/etc/ts.conf
+
TSLIB_CONSOLEDEVICE=none
TSLIB_PLUGINDIR=/usr/lib/ts
+
TSLIB_FBDEVICE=/dev/fb0
 +
TSLIB_TSDEVICE=/dev/input/event2
 +
TSLIB_CALIBFILE=/etc/pointercal
 +
TSLIB_CONFFILE=/usr/etc/ts.conf
 +
TSLIB_PLUGINDIR=/usr/lib/ts
  
 
Again remember to replace the event2 number with the number you got in point 1.
 
Again remember to replace the event2 number with the number you got in point 1.
  
4. Reboot the board
+
'''5.''' Calibrate the display like root user
 +
 
 +
ts_calibrate
 +
 
 +
'''6.''' Make sure that you have permissions to start the GUI as another user. Execute:
 +
 
 +
dpkg-reconfigure x11-common
 +
 
 +
A menu would pop-up - select "Anybody"! You can also manually edit /etc/X11/Xwrapper.config to allowed_users=anybody
 +
 
 +
'''7.''' Open /root/.bashrc file and add the following 2 lines at the end of it:
 +
 
 +
  service lightdm stop (for newer Debian releases)
 +
 
 +
or
 +
 
 +
service slim stop (for older Debian releases)
 +
 
 +
then
 +
 
 +
su - olimex -c startx &
 +
 
 +
You can open bashrc with:
 +
 
 +
nano /root/.bashrc
 +
 
 +
For testing purposes, you can execute the two commands manually (this restarts the GUI). This has to be performed each time.
 +
 
 +
'''8.''' Reboot the board
 +
 
 +
reboot
 +
 
 +
If after reboot the touchscreen works only in a small area - you might want to link the files used by LXDE manually. The files generated by the calibration tool are located in /etc, but LXDE looks for files in /usr/etc/ - make sure that the files generated in /etc folder are the ones used by LXDE. You might need to delete or rename the files in /usr/etc/ and then either copy paste the similar files from /etc or place symlinks to them. The file to get from /etc/ and put in /usr/etc is pointercal (you can simply type: cp /etc/pointercal /usr/etc/pointercal).
 +
 
 +
Text file with some of the commands used here to get the touch working: https://drive.google.com/open?id=0BwplT87k9SCgdHNoLU1ESjJQTTQ
 +
 
 +
[[Main_Page]]

Latest revision as of 03:03, 1 June 2017

Instructions on the usage of the 15.6 inch SAW touchscreen (LCD-15.6TS) under Debian.

This guide is tested with the LCD-15.6TS (with ETT5003U controller), distributed by Olimex LTD. The setup included LCD-OLinuXino-15.6-FHD and A20-OLinuXino-MICRO.

Important: for the hardware connection you would need to provide 12V to the controller via the touchscreen display using the 4-pin molex connector (yellow wire = 12V input; black wire = GND). A free USB port is also required. The powering to the touchscreen is deliver through a standard 4-pin molex connector.

Establish the hardware connections and set the LCD properly (if using our displays remember to execute change_display.sh). Then in order to get the touchscreen working under the official Linux image do the following:

1. Make sure the USB connection between the display and the board is established before powering the board. If it was connected already reboot the board.

2. Identify the event number of the USB connection of the touchscreen. Type "evtest" to get the proper event associated with the display. Additionally, you might plug-unplug the USB connection of the touchscreen to get the proper event number in the console (or use command dmesg | grep ETwo). It is usually "/dev/input/eventX".

3. Create a new 20-ts.conf file or add a new section in the 20-ts.conf file (remember to replace the USB event number with the number you got in point 1, we have used event2 as example)

The file location should be: /usr/share/X11/xorg.conf.d/20-ts.conf

To create the file type:

touch /usr/share/X11/xorg.conf.d/20-ts.conf

To edit the file type:

nano /usr/share/X11/xorg.conf.d/20-ts.conf

The file should contain the following:

Section "InputClass"
 Identifier "ETwo TouchScreen"
 MatchDevicePath "/dev/input/event2"
 MatchProduct "ETwoTouch Corp. ETwo TouchScreen"
 Driver "tslib"
 Option "ScreenNumber" "0"
 Option "Rotate" "NONE"
 Option "Width" "1920"
 Option "Height" "1080"
 Option "SendCoreEvents" "yes"
 Option "Type" "touchscreen"
EndSection

Remember to replace the event2 number with the number you got in point 1. The configuration is suitable for the FullHD 15.6 inch display. If you are using the 1366x768 (HD-ready) display replace the driver option defaults with "Width" "1366" and "Height" "768".

4. Create a new environment file or edit the environment file (again we have used event2 as our USB event, remember to replace it with the number of event you get in point 1.)

The file is typically: /etc/environment - however it might be different in your board. Type:

nano /etc/environment

Paste the following inside:

TSLIB_TSEVENTTYPE=raw
TSLIB_CONSOLEDEVICE=none
TSLIB_FBDEVICE=/dev/fb0
TSLIB_TSDEVICE=/dev/input/event2
TSLIB_CALIBFILE=/etc/pointercal
TSLIB_CONFFILE=/usr/etc/ts.conf
TSLIB_PLUGINDIR=/usr/lib/ts

Again remember to replace the event2 number with the number you got in point 1.

5. Calibrate the display like root user

ts_calibrate

6. Make sure that you have permissions to start the GUI as another user. Execute:

dpkg-reconfigure x11-common

A menu would pop-up - select "Anybody"! You can also manually edit /etc/X11/Xwrapper.config to allowed_users=anybody

7. Open /root/.bashrc file and add the following 2 lines at the end of it:

 service lightdm stop (for newer Debian releases)

or

service slim stop (for older Debian releases)

then

su - olimex -c startx &

You can open bashrc with:

nano /root/.bashrc

For testing purposes, you can execute the two commands manually (this restarts the GUI). This has to be performed each time.

8. Reboot the board

reboot

If after reboot the touchscreen works only in a small area - you might want to link the files used by LXDE manually. The files generated by the calibration tool are located in /etc, but LXDE looks for files in /usr/etc/ - make sure that the files generated in /etc folder are the ones used by LXDE. You might need to delete or rename the files in /usr/etc/ and then either copy paste the similar files from /etc or place symlinks to them. The file to get from /etc/ and put in /usr/etc is pointercal (you can simply type: cp /etc/pointercal /usr/etc/pointercal).

Text file with some of the commands used here to get the touch working: https://drive.google.com/open?id=0BwplT87k9SCgdHNoLU1ESjJQTTQ

Main_Page