RS232 POSTouch screen Linux driver installation

(Last modify date:2008/03/04)

The files are licensed under terms and conditions of GNU General Public license v2, unless stated otherwise.


This distribution contain the below files:

  • Xinput driver for RS232 interface POSTouch controller:

X-Server version

Work for

File name

Xorg 6.7.x or newer

RedHat 7.x ~ 9.0

xfdrvtouch_drv_xorg6.7.tar.gz

Fedora

Debian 4.0R1

SlackWare 11.0

Xfree86 4.3.x or newer

RedHat 9.0

RedHat\9.0\04-10-01\xfdrvtouch_drv.tar.gz

SuSe 9.0

SuSe Linux Enterprise Desktop\9.0\RS232\xfdrvtouch_drv.tar.gz

Novell Linux Desktop 9

SuSe 9.3

SuSe Linux Enterprise Desktop\9.3\xfdrvtouch_drv.tar.gz

SuSe 10.1

SuSe Linux Enterprise Desktop\10.1\RS232SUSE10.1-1.0-1.1.i686.rpm

SuSe 10.3

SuSe Linux Enterprise Desktop\10.3\SuseSLED10SP3_RS232.tar.gz

CentOS 4.x

CentOS\v4\RS232CentOS4.x-v0.5-1.rpm

Xfree86 4.2.x or newer

RedHat 8.0

RedHat\8.0\04-10-01\xfdrvtouch.tar.gz

·         Note: It may or may not work for your environment. If it does not, contact with us.

  • Utilities:

Use for

File name

File description

GTK2.x

FreeDraw_GTK2.0.tar.gz

Free Draw Utility

Calib_3P232_GTK2.0.tar.gz

RS232 touch panel 3 points calibration utility

Linear232_GTK2.0.tar.gz

RS232 touch panel 5 / 9 points linear calibration utility

GTK1.x

FreeDraw_GTK1.0.tar.gz

Free Draw Utility

Calib_3P232_GTK1.0.tar.gz

RS232 touch panel 3 points calibration utility

Linear232_GTK1.0.tar.gz

RS232 touch panel 5 / 9 points linear calibration utility


QUICK START GUIDE (binary installation)

Index

·         1. Make sure serial port work currently

o        1.1 Check the serial port resource

o        1.2 Verify the serial port setting under Linux

o        1.3 Make sure the Linux serial port setting match with BIOS

§         1.3.1 Adjust method when cannot turn on ttyS4 and higher

§         1.3.2 Remove non-used serial port to let touch work on ttyS0~ttyS3

§         1.3.3 Rebuild kernel for support more then 4 serial port

o        1.4 Always use the currently setting for serial port

·         2. Xinput Driver installation

o        2.1 Check the version of the X-Server

o        2.2 Xinput Driver installation for Xorg

o        2.3 Xinput Driver installation for xfree86

·         3. Setup and run Touch Utility


1. Make sure serial port work currently

If you connect the touch on COM1~COM2 and use the standard resource, go to STEP2.
Cause of the COM3 or higher legacy serial port cannot be automatic install currently by Linux, please follow the below step to verify and install the legacy serial port.

1.1 Check the serial port resource

Check the serial port resource usage first.  You can into BIOS setup program to check your setting.
Example:

Port Name

I/O

IRQ

COM1

0x3F8

4

COM2

0x2F8

3

COM3

0x3E8

10

COM4

0x2E8

10

COM5

0x4F8

10

COM6

0x4E8

10

1.2 Verify the serial port setting under Linux

You can check the resources used by the COM port with the "setserial" command, as follows:

# setserial -a /dev/ttySx, where x is 0 for COM1, 1 for COM2, 2 for COM3, 3 for COM4, etc.

Example use bellow commands to check your COM1~COM6:

# setserial -a /dev/ttyS0

# setserial -a /dev/ttyS1
# setserial -a /dev/ttyS2
# setserial -a /dev/ttyS3
# setserial -a /dev/ttyS4
# setserial -a /dev/ttyS5

1.3 Make sure the Linux serial port setting match with BIOS

1.       If port resources is not currently, use the setserial command to adjust it.
Example the COM3~COM6 is not currently, so we manually use the below command to change and double check the resource setting is changed:

# setserial /dev/ttyS2 port 0x3e8 uart 16550a irq 10 baud_base 115200
# setserial -a /dev/ttyS2
# setserial /dev/ttyS3 port 0x2e8 uart 16550a irq 10 baud_base 115200
# setserial -a /dev/ttyS3
# setserial /dev/ttyS4 port 0x4f8 uart 16550a irq 10 baud_base 115200
# setserial -a /dev/ttyS4
# setserial /dev/ttyS5 port 0x4e8 uart 16550a irq 10 baud_base 115200
# setserial -a /dev/ttyS5

2.       If all of serial port setting match with BIOS, go to STEP 1.4.

1.3.1 Adjust method when cannot turn on ttyS4 and higher

Cause of some of the kernel have no enable "Support more than 4 legacy serial ports" feature, so we must rebuild the kernel (STEP 1.3.3) to support it or remove non-used serial port to let touch work on ttyS0~ttyS3 (STEP 1.3.2) or add the “8250.nr_uarts=6” option to kernel line(STEP 1.3.3).

1.3.2 Remove non-used serial port to let touch work on ttyS0~ttyS3

Disable the non-used serial port by BIOS to let touch work on ttyS0~ttyS3 under Linux.
After you successful change it, go to STEP 1.3.

Example your touch connect on COM5, so you can disable COM4 and change COM5 I/O resource to 0x2E8 to let COM5 mapping to ttyS3 under Linux.

1.       Into BIOS Setup program ---Integrated Peripherals---SuperIO Device

2.       Change [Serial Port 4] item to [Disabled] option.

3.       Change [Serial Port 5] item to [2E8] option.

4.       After you successful change it, go to STEP 1.3.

1.3.3 Rebuild kernel for support more then 4 serial port

Before rebuild the kernel, you can try to add the option “8250.nr_uarts=6” at the menu.list or grub.cfg and reboot the system. STEP 1.4 If the setup success, the system should be enable 6 serial ports, then go to STEP 1.3.

There show you the list for need / didn't need rebuild the kernel for support more than 4 legacy serial ports by our test:

Fedora Core 2 / 5

Need rebuild the kernel for support ttyS4

Mandrake 9.x / 10.x

SuSe 9.0 / 9.3 / 10.0

CentOS 4.0 / 4.4

VectorLinux 5

Debian 4.0R1

RedHat 7 ~ 9

Didn't need rebuild the kernel for support ttyS4

Ubuntu 6.06

Novell Linux Desktop 9

Slackware 11.0

If you connect the touch controller at COM5 or higher, need make sure the following features have been enabled in the kernel configuration.

  •   [*] Extended 8250/16550 serial driver options
  •   [*]   Support more than 4 legacy serial ports
  •   [*]   Support for sharing serial interrupts

After you successful rebuild the kernel, go to STEP 1.3.

If you cannot successful rebuild the kernel, go to STEP 1.3.2.

1.3.4 Add kernel command for support more then 4 serial port

Add command on your “grub.conf” or “menu.list”, and it will let your kernel to support more then 4 serial port on your system.

    * please edit /boot/grub/menu.lst and add  "8250.nr_uarts=6"  to the end of the kernel line  then use  /dev/ttyS4  in xorg.conf

1.4 Always use the currently setting for serial port

Add the setserial command into /etc/rc.local file for let the setting always available.
Example add the below lines to change the setting for COM3~COM6:

/bin/setserial /dev/ttyS2 port 0x3e8 uart 16550a irq 10 baud_base 115200
/bin/setserial /dev/ttyS3 port 0x2e8 uart 16550a irq 10 baud_base 115200
/bin/setserial /dev/ttyS4 port 0x4f8 uart 16550a irq 10 baud_base 115200
/bin/setserial /dev/ttyS5 port 0x4e8 uart 16550a irq 10 baud_base 115200


2. Xinput Driver installation

2.1 Check the version of the X-Server

Check the version of the X-Server your system is running. If you are running the XFree86 server, type the following command:

XFree86 -version

If you are running Xorg server, type the following command:

Xorg -version

2.2 Xinput Driver installation for Xorg

1.       For .rpm package:

#rpm -ivh RS232CentOS4.x-v0.5-1.rpm
 

2.       For .tar.gz package:
Decompress xfdrvtouch_drv*.tar.gz and place where your X is installed.

#tar zxvf xfdrvtouch_drv_xorg6.7.tar.gz

You need put Xinput driver file (xfdrvtouch_drv.o) in the same with file "elographics_drv.*".  Use the below command to find the destination:
# find / -name elographics_drv.*

OS

Xorg version

Location

Fedora Core 5

7.0.0

/usr/lib/xorg/modules/input/

Fedora Core 3

6.8.1

ubuntu 6.06

6.8.2-0

Debian 4.0R1

7.1.1

Fedora Core 2

6.7.0-2

/usr/X11R6/lib/modules/input/

CentOS 4.0

6.8.1

Slackware 11.0

6.9.0

3.       Example command for Fedora Core 5:
#cp  xfdrvtouch_drv.o /usr/lib/xorg/modules/input
 

4.       Add the following black lines into xorg.conf file (maybe in /etc or /etc/X11).
If your system will not have a mouse, then use "CorePointer" instead of "SendCoreEvents" in the "ServerLayout" section.

Section "ServerLayout"

Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
.
.
.
InputDevice "Touchscreen0" "SendCoreEvents"

EndSection

Section "InputDevice"

Identifier "Touchscreen0"
Driver "xfdrvtouch"
Option "Device" "/dev/ttyS4"
Option "ScreenNo" "0"
Option "Rotation" "0"
Option "SwapY" "0"
Option "DebugLevel" "0"
Option "AlwaysCore"
Option "UpSound" "1"
Option "DownSound" "1"
Option "RightButtonON" "1"

EndSection

5.       *note: "Device" item is dependent on user choice, COM1=/dev/ttyS0, COM2=/dev/ttyS1, ..., etc.

6.       Press Ctrl+Alt+Backspace keys to restart X server.

2.3 Xinput Driver installation for xfree86

1.       Decompress xfdrvtouch_drv*.tar.gz and place where your X is installed.
#tar zxvf xfdrvtouch_drv.tar.gz

2.       You need put Xinput driver file (xfdrvtouch_drv.o) in the same with file "elographics_drv.*".  Use the below command to find the destination:
# find / -name elographics_drv.*

Example command:
#cp xfdrvtouch_drv.o /usr/X11R6/lib/modules/input
 

3.       Add the following black lines into XF86Config file (maybe in /etc or /etc/X11).
If your system will not have a mouse, then use "CorePointer" instead of "SendCoreEvents" in the "ServerLayout" section.

Section "ServerLayout"

Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
.
.
.
InputDevice "Touchscreen0" "SendCoreEvents"

EndSection

Section "InputDevice"

Identifier "Touchscreen0"
Driver "xfdrvtouch"
Option "Device" "/dev/ttyS4"
Option "ScreenNo" "0"
Option "Rotation" "0"
Option "SwapY" "0"
Option "DebugLevel" "0"
Option "AlwaysCore"
Option "UpSound" "1"
Option "DownSound" "1"
Option "RightButtonON" "1"

EndSection

4.       *note: "Device" item is dependent on user choice:

o        COM1=/dev/ttyS0

o        COM2=/dev/ttyS1

o        COM3=/dev/ttyS2

o        COM4=/dev/ttyS3

o        COM5=/dev/ttyS4

o        COM6=/dev/ttyS5

5.       Reboot.


3. Setup and run Touch Utility

1.       Type the following command to get GTK version:

rpm -qa | grep gtk

Example get result on Fedora Core 5:

[root@localhost ~]# rpm -qa | grep gtk
pygtk2-2.4.0-1
gtkhtml2-2.6.2-1
gtk2-2.4.13-9   <--  GTK2
gnome-python2-gtkhtml2-2.6.0-3
usermode-gtk-1.74-1
authconfig-gtk-4.6.5-3.1
gtkhtml3-3.3.2-3
gtkspell-2.0.7-2
gtk+-1.2.10-33
gtk-engines-0.12-5
gtksourceview-1.1.0-3
pygtk2-libglade-2.4.0-1
gtk2-engines-2.2.0-6
iiimf-gtk-12.1-4

2.       Installation:
Decompress the utilities and copy to /usr/local/bin
Example command for GTK2.0:

#tar zxvf Linear232_GTK2.0.tar.gz
#cp ./Linear232 /usr/local/bin
#tar zxvf Calib_3P232_GTK2.0.tar.gz
#cp ./Calib_3P232 /usr/local/bin
#tar zxvf FreeDraw_GTK2.0.tar.gz
#cp ./FreeDraw /usr/local/bin


Create empty calibration parameter file:

#touch /usr/local/bin/touch.calib
 

3.       Run utilities:

o        Touch panel 5 / 9 points linear calibration utility:
#Linear232 /dev/ttySx p
where x = 0,1,2...n, 0=COM1, 1=COM2, ... / p = 5 or 9 <default>

Note:  If you use GTK1.x , you need to AutoHide X windows taskbar by Manually to make the utility to occupy all screen area. If you don't, the mouse data will be wrong.

o        Touch panel 3 points calibration utility:
#Calib_3P232 /dev/ttySx
where x = 0,1,2...n, 0=COM1, 1=COM2, ...

Note:  If you use GTK1.x, you need to AutoHide X windows taskbar by Manually to make the utility to occupy all screen area. If you don't, the mouse data will be wrong.

o        Free Draw Utility:
#FreeDraw