Black God

How to get eGalax TouchScreen film (0eef:0001) working in Linux for Raspberry Pi

This is an How-To guide on getting a Touch Screen Film working in Linux. The Touch screen I use here was purchased from Deal Extreme. It is a 7″ USB based touch film layered on a glass screen. This can be used along with a 7″ monitor like the one I used here.

In this case, I have set it up with a Raspberry-Pi system + 7″ Lilliput monitor + raspbian OS (Debian derivative Linux). Setting up a 7″ Lilliput monitor is documented here in another post. This guide focuses on getting touch screen worked.  This one is coming from D-WAV Scientific Co. It comes with USB interface.

 

 

 

7-inch USB Touch Screen Film

7-inch USB Touch Screen Film

Here is how to identify the device I mentioned here.

$ lsusb
. . . . . .
Bus 006 Device 002: ID 0eef:0001 D-WAV Scientific Co., Ltd eGalax TouchScreen

The Linux kernel version is 3.2.27-cutdown+ from raspbian.

UPDATE: The first step in getting this done is to compile the raspbian kernel with necessary kernel module. Here is a nice article on compiling your kernel for Raspberry Pi. Before compiling, in menuconfig we include usbtouchscreen module, which supports this touch screen film. Here is where do we need to find this module.

Device Drivers  -> Input device support -> Generic input layer (needed for keyboard, mouse, …)  -> Touchscreens (INPUT_TOUCHSCREEN [=y]) -> TOUCHSCREEN_USB_EGALAX [=y]

Once kernel compiled and rebooted with new kernel, it should be detected as USB Touch Screen of Serial Input device as observed below.  The usbtouchscreen module loaded automatically.

$ demsg
. . . . . . . .
usb 1-1.3.3.2: new low-speed USB device number 9 using dwc_otg
usb 1-1.3.3.2: New USB device found, idVendor=0eef, idProduct=0001
usb 1-1.3.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.3.3.2: Product: USB TouchController
usb 1-1.3.3.2: Manufacturer: eGalax Inc.
input: eGalax Inc. USB TouchController as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3.2/1-1.3.3.2:1.0/input/input2
usbcore: registered new interface driver usbtouchscreen

$ lsmod | grep touch
usbtouchscreen 8856 0

$ cat /proc/bus/input/devices
I: Bus=0003 Vendor=0eef Product=0001 Version=0100
N: Name=”eGalax Inc. USB TouchController”
P: Phys=usb-bcm2708_usb-1.3.3.2/input0
S: Sysfs=/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3.2/1-1.3.3.2:1.0/input/input2
U: Uniq=
H: Handlers=mouse1 event2
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=3

Raspberry Pi Setup

Raspberry Pi Setup

Now we need to install the right X input driver. For me the xserver-xorg-input-evtouch package in repository failed to function. So I downloaded the source tar file and patch from Ubuntu’s launchpad here.

Apply the patch and build the source to get evtouch_drv.so. Once installed you should have it in /usr/local/lib/xorg/modules/input/.

Now it is time to edit xorg.conf file. Here is my xorg.conf file highlighted with touch screen specific configuration lines:

#################################################

Section “ServerLayout”
Identifier “Server Layout”
InputDevice “touchscreen” “CorePointer”
Screen 0 “DisplayLinkScreen” 0 0
EndSection

#################################################

Section “Files”
ModulePath “/usr/lib/xorg/modules”
ModulePath “/usr/local/lib/xorg/modules”
ModulePath “/usr/local/lib/xorg/modules/drivers”
ModulePath “/usr/local/lib/xorg/modules/input”
EndSection

############### DisplayLink Stuff ###############

Section “Device”
Identifier “DisplayLinkDevice”
Driver “displaylink”
Option “fbdev” “/dev/fb1″
Option “DPI” “140×140″
EndSection

Section “Monitor”
Identifier “DisplayLinkMonitor”
#DisplaySize 152 92
EndSection

Section “InputDevice”
Identifier “touchscreen”
Driver “evtouch”
Option “Device” “/dev/input/event0″
Option “DeviceName” “touchscreen”
Option “MinX” “98″
Option “MinY” “43″
Option “MaxX” “940″
Option “MaxY” “925″
Option “ReportingMode” “Raw”
Option “Emulate3Buttons”
Option “Emulate3Timeout” “50″
Option “SendCoreEvents” “On”
EndSection

Section “InputClass”
Identifier “calibration”
MatchProduct “eGalax Inc. USB TouchController”
Option “Calibration” “1962 81 1923 129″
EndSection

Section “Screen”
Identifier “DisplayLinkScreen”
Device “DisplayLinkDevice”
Monitor “DisplayLinkMonitor”
SubSection “Display”
Depth 16
Modes “800×480″
EndSubSection
EndSection

#################################################

In the above file, the line “Option “Calibration” “1962 81 1923 129″” was obtained with xinput calibration tool mentioned below. Initially I did not add this line, once calibrated the tool gave these values, so that I added to the xorg.conf file.

Build and install xinput_calibrator tool as per this guide. Download the source code from here. Then follow the usual ./configure, make and make install to install the tool.

Next step is to run the xinput_calibrator tool as root user, follow the wizard to press the arrows shown on screen using a stylus. Once the wizard is done, a piece of configuration is shown on terminal, use that configuration snippet in xorg.conf. Note that this tool should be run X windows environment. Logout and login back.

Here is the touch screen in action:

Enjoy your own touch screen build!

9 comments for “How to get eGalax TouchScreen film (0eef:0001) working in Linux for Raspberry Pi

  1. GolemXIV
    June 26, 2014 at 7:43 am

    Thank you, God!
    But i have some troubles with build evtouch_drv.so from source.
    When i trying to make a build evtouch_drv.so on my Raspbian i’ve got error:
    > evtouch.c:33:25: error: xf86Version.h: No such file or directory.

  2. Kevin Vilbig
    August 8, 2013 at 3:55 am

    Great writeup!

    This is pro, dude. This worked like a charm.

  3. Yannick
    January 29, 2013 at 11:23 pm

    Thank you very much for the Tutorial. I’m a linux newbie and I dont know how to patch and build the source to get the evtouch_drv.so. Can you please explain it al little bit? I downloaded the three files and extract it with dpkg-source -x *.dsc but i have no idea how to move on.

  4. Sir Santa
    January 29, 2013 at 6:50 pm

    Hi, i’ve trying to take my touchscreen monitor running, but i can’t compile the kernel with EETI egalax multitouch panel support, because it shows me a make error. irq_to_gpio. How did you build the kernel without this error??

  5. phrk
    January 18, 2013 at 5:54 pm

    Thank you for the post! What exactly (kernel, modules…) do you use? Freshly nstalled raspbian 3.2.27 does not load usbtouchscreen kernel module automatically (actually this module cannot be modprobed even manually – not found)… Strange! The same device (0eef:0001) used on my ubuntu laptop works out of the box.. Thank you for answer!

    • phrk
      January 22, 2013 at 2:35 am

      Thank you for the update :) It seems to be clear now.

  6. DaveInTheWave
    January 17, 2013 at 4:35 pm

    Hey Black God, thanks for the tutorial this looks like a really fun project!

    Do you happen to have a youtube video of this up and running at all?

    Cheers

    • Black God
      January 18, 2013 at 12:51 am

      Hi DaveInTheWave, I have uploaded a video of this setup and demo in youtube and embedded the same in this post.

      • DaveInTheWave
        January 18, 2013 at 2:15 am

        Oh wow! That’s great, thank you very much!

Leave a Reply

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