View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > EGalax Touchscreen

From LQWiki

Jump to: navigation, search

eGalax Touchscreen Setup

I have wrote this guide to help others and myself if I should ever need to setup a eGalax touch screen again under debian linux. I have wrote this based on debian linux but other 2.6 kernel based distros should be fairly similar. You will need to be the root user for most of this guide.

Getting required packages

You will need the following packages to successfully compile the module for the touchkit driver.

apt-get install gcc linux-source-2.6.18 make

Be sure to change the linux source to the kernel you are using. Use the command

uname -r

to find your current kernel version.

Build the tkusb.ko module

Extract the kernel and create link

cd /usr/src
tar -xjvf linux-source-2.6.18.tar.bz2           # Once again change to your kernel version
ln -s linux-source-2.6.18 /usr/src/linux
cd /usr/src/linux

Get ready to compile a module

make oldconfig 
make prepare
make modules                 # There must be a shorter way to get modpost than this. Anyone. 

You don't have to wait for all the modules to compile. Once you see the LD for modpost.o it should be ok to cancel (CTRL-c)

Change to your home directory and get the Touchkit driver

cd ~
wget http://210.64.17.162/web20/drivers/websit%20driver/Linux/TouchKit_1.07.0831.tar.gz   # This may change... Check out http://www.egalax.com.tw
tar -xzvf TouchKit_1.07.0831.tar.gz
cd ./TouchKit/USBSrc
nano Makefile

Change the line

KDIR := /lib/modules/$(shell uname -r)/build

to

KDIR := /usr/src/linux

Write the file to disk CTRL-x and quit

Make the module

make all

You should see something similar to below

CC [M]  /root/TouchKit/USBSrc/tkusb.o
Building modules, stage 2.
MODPOST
CC      /root/TouchKit/USBSrc/tkusb.mod.o
LD [M]  /root/TouchKit/USBSrc/tkusb.ko
make[1]: Leaving directory `/usr/src/linux-source-2.6.18'

Now copy the module to say /lib/modules and open /etc/rc.local for editing

cp tkusb.ko /lib/modules
nano /etc/rc.local

Modify rc.local to load the module on bootup. Insert the following text into the /etc/rc.local file.

## TouchKit kernel module section begin ##
rmmod touchkitusb
# This module may be renamed “usbtouchscreen”.
insmod /lib/modules/tkusb.ko
# for Kernel 2.6.x only.
## TouchKit kernel module section end ##

Save the file and quit. We must blacklist the usbtouchscreen driver from loading. (I really should have looked into if this module would have worked properly)

nano /etc/modprobe.d/blacklist

Add the following line

blacklist usbtouchscreen

Reboot the computer

reboot

After reboot check to be sure the touchscreen is detected and using the correct driver.

cat /proc/bus/usb/devices

You should see something similar to below somewhere in there

T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  4 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0eef ProdID=0001 Rev= 1.00
S:  Manufacturer=eGalax Inc.
S:  Product=USB TouchController
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=TouchKit
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=5ms

The thing to note is in the I: line shows Driver=TouchKit. If you see this you got the driver installed properly, congrats.

Now we have to setup X to load its driver so you can actually use the touchscreen. See the Driver Guide.pdf for information on this in the tar file we downloaded earlier. ~/TouchKit/Guides/Driver Guide.pdf The guide is easy to understand and is much easier to accomplish than the driver installation.. Good Luck.


Personal tools