POSTouch Linux driver OSE installation

(Last modify date:2011/06/01)

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/USB interface POSTouch controller:

X-Server version

Work for

X Server 1.6 to 1.9

Debian 6

Fedora 12/ 13/ 14

OpenSUSE 11.2

Ubuntu 9.10/ 10.04/10.10

Mandriva 2009/ 2010

X Server 1.10

Ubuntu 11.04/Fedora 15

·         Install Guide: POSTouch_OpenSourceDriver_InstallGuide.pdf

·         Note: The OSE version should be working on any X server 1.6 ~1.8 Linux systems. If any problem please contact with us.

  • Packages: After start install the OSE driver, please prepare the packages below.

Package

description

Linux Header Package

Linux Headers for driver implement.

You can use the softer manager to install it.

#apt-get install linux-headers-$(uname –r)

GCC compiler

Compiler for building the drivers.

#apt-get install gcc

Xorg-devel

Xorg development package

#apt-get install xorg-dev

GTK 2.0

GTK library for GUI tools.

#apt-get install libgtk2.0-dev


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

·         2. Xinput Driver installation

o    2.1 Check the version of the X-Server

o    2.2 Xinput Driver installation for Xorg

·         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 Add the boot option or Rebuild kernel for support more then 4 serial port

Usually the Linux system default enabled 4 ports.  We can 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

Example: Find the file /boot/grub/grub.cfg and modify the section of boot menu.

 

menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {

        recordfail

        insmod ext2

        set root='(hd0,1)'

        search --no-floppy --fs-uuid --set 2624db8e-7d22-4b8a-a077-f59d180d11a3

        linux /boot/vmlinuz-2.6.32-21-generic root=UUID=2624db8e-7d22-4b8a-a077-f59d180d11a3 ro   quiet splash 8250.nr_uarts=6

        initrd /boot/initrd.img-2.6.32-21-generic

}

 

·         Note: if the parameter for boot menu is not work, please refer below to rebuild kernel.

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.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.     Extract the package.

       #tar zxvf POSTouch_OSE_v1.0.0.1.tar.gz

2.     Confirm the folder structure and please make sure the necessary packages have been installed.

Folder Name

Description

AP

Application for touch driver. Please confirm you device interface and into the folder below.

1. RS232

2. USB

And it includes the Calib, FreeDraw and Linear tool.

You can into the folder and follow the steps below to make the utility.

#./configure

#make

#make install

touch.calib

The configure file for utility use, please copy to /etc folder.

#cp touch.calib /etc/

USB_Kernel

The USB driver for USB touch. Into the foler v2.6.x/touch to build the kernel driver.

#cd v2.6.x/touch

#make

#cd touch/

#rm -f /lib/modules/$(uname –r)/kernel/drivers/input/touchscreen/usbtouchscreen*

#install –o root –g root –m 666 touch.ko /lib/modules/$(uname -r)/kernel/drivers/input/touchscreen

Xorg

The touch driver for X window. Please

#cd 1.6.x-1.8.x/xdrv

#./configure

#make

#

 

3.     Add the following black lines into xorg.conf file (maybe in /etc or /etc/X11).
If the configure file is not exists, please pressed <ctrl>+<alt>+<F3> to console mode and the use the command to create the configure file.

        #X –configure :1

       #cp /root/xorg.conf.new /etc/X11/xorg.conf

4.     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, USB= /dev/idtk0.

6.     Press Ctrl+Alt+Backspace keys to restart X server or 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.     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>

#LinearUSB /dev/idtk0 p
For USB type / p = 5 or 9 <default>    

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

#Calib_3PUSB /dev/idtk0
For USB type

o    Free Draw Utility:
#FreeDraw