Difference between revisions of "HIP:LittleFe Touchscreen Display"

From Earlham CS Department
Jump to navigation Jump to search
(Inch TFT Touchscreen LCD Monitor)
(Install the Kernel Module)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=Equipment=
 
=Equipment=
  
==7 Inch TFT Touchscreen LCD Monitor==
+
=7 Inch TFT Touchscreen LCD Monitor=
  
===Installation on the BCCD Version 3===
+
==Installation on the BCCD Version 3==
 +
 
 +
===Get the tarball and configure the system===
 
This section is describes the steps required to set up the TouchKit Drivers on the Debian-based BCCD platform. The software included with the unit is totally out of date, and there website hosts conflicting drivers, so watch out.
 
This section is describes the steps required to set up the TouchKit Drivers on the Debian-based BCCD platform. The software included with the unit is totally out of date, and there website hosts conflicting drivers, so watch out.
  
Line 20: Line 22:
 
This script takes care of the X configuration. It does not install the driver, although it likes to pretend that it does. You will have to do this manually.
 
This script takes care of the X configuration. It does not install the driver, although it likes to pretend that it does. You will have to do this manually.
  
Now that you have run the setup script, copy the Touchkit.tar.gz tarball and name it Touchkit-driver.tar.gz
+
===Install the Kernel Module===
 +
Much of these directions come from [http://wiki.linuxquestions.org/wiki/EGalax_Touchscreen eGalax Touchscreen on linuxquestions.org]
 +
First of all, you're going to need the kernel source for the machine on which you are configuring the touchscreen. This needs to be the exact source tree. Again, you can check the kernel version by typing
 +
 
 +
<pre>uname -r</pre>
 +
 
 +
If you are running version 2.6.22.9_aufs the source tree can be downloaded [http://cluster.earlham.edu/detail/bccd-ng/linux-2.6.22.9_aufs.tar.bz2 here]
  
now extract Touchkit-driver.tar.gz
+
You can download a pre-built kernel module for x86, and the kernel above [http://cs.earlham.edu/~purcebr/tkusb.ko here]
  
<pre>gunzip Touchkit-driver.tar.gz
 
  
tar xvf Touchkit-driver.tar
+
 
 +
extract the source to /usr/src
 +
 
 +
To make your life easier, make a sym link '''linux''' linking to '''linux-2.6.*''' for your version.
 +
 
 +
<pre>ln -s /usr/src/linux-2.6.22.9_aufs /usr/src/linux</pre>
 +
 
 +
enter the /usr/src/directory, and prepare the source to compile a module
 +
 
 +
<pre>make oldconfig
 +
 
 +
make prepare
 +
 
 +
make modules SUBDIRS=scripts/mod
 
</pre>
 
</pre>
  
cd into the extracted folder.
+
Now enter the USBsrc folder and edit the Makefile, changing
 +
 
 +
<pre>KDIR := /lib/modules/$(shell uname -r)/build</pre>
 +
 
 +
to
 +
 
 +
<pre>KDIR := /usr/src/linux</pre>
 +
 
 +
now run
 +
 
 +
<pre>make all</pre>
 +
 
 +
When make succeeds, you must copy the newly compiled module over to /lib/modules.
 +
 
 +
Then test to see everything is working. Make sure the touchscreen is not plugged in the USB ports, and load the module
 +
 
 +
<pre>insmod /lib/modules/tkusb.o</pre>
 +
 
 +
Now plug in the touchscreen. When you run
 +
 
 +
<pre>cat /proc/bus/usb/devices</pre>
 +
 
 +
You should see an entry representing the touchscreen. The important field to note is
 +
 
 +
<pre>Driver=Touchkit</pre>
 +
 
 +
If you see this field, then the driver installation went smoothly.
 +
 
 +
===Set up the touchscreen to control the mouse===
 +
 
 +
Installing the driver is great and all, but now the goal is to link the touchscreen input to the mouse. iphone anyone?
 +
 
 +
 
 +
'''Important Note'''
 +
 
 +
The Touchkit driver is fairly unstable, so it's very easy to bork it entirely. Never unplug the touchscreen while it is an active input
 +
device. The touchscreen is not as reliable as a mouse or a keyboard, and unplugging it when the tkusb.ko module is looking for it can really mess things up. Always shut down the computer before unplugging the touchscreen.
 +
 
 +
 
 +
That being said, you should be able to simply load the module, which you did in the last section, plug the touchscreen into an available USB port, and run
 +
 
 +
<pre>$ Touchkit</pre>
 +
 
 +
This will bring up a touchscreen configuration box. If it can't find the device, then you are witnessing the instability of this module first-hand. In this case, you might try to remove the module from memory
 +
 
 +
<pre>rmmod /lib/modules/tkusb.o</pre>
 +
 
 +
recopy the module from the USBsrc build directory again, because something probably got messed up with the tkusb module in memory
 +
 
 +
Then try to load the newly copied module and try the above steps again.
 +
 
 +
== Control Panel Design and Interface ==
 +
 
 +
The goal here is to develop an interface where people can approach and engage the littlefe easily using a touchscreen command system. qt is the platform of choice at this point for developing the graphical frontend and tieing actions, such as button presses and slider value changes to backend scripts that run certain jobs on the littlefe. The interface will most likely feature a few different tabs for different ''modes'' of operation.
 +
 
 +
The following directions outline the procedure for creating your own interface.
 +
 
 +
<pre>apt-get install designer-qt3</pre>
 +
 
 +
qt3 designer makes it easy to create interfaces and tie certain events pertaining to each object activate a script with certain parameters, specified by a slider or radiobuttons/check boxes.
 +
 
 +
For this specific project, we're only concerned with the more basic aspects of qt: simply designing an interface and linking events to system calls in c++. For a detailed tutorial on getting started with qt designer, see
  
 
==OutBack Powersystems MATE==
 
==OutBack Powersystems MATE==

Latest revision as of 11:20, 27 May 2009

Equipment

7 Inch TFT Touchscreen LCD Monitor

Installation on the BCCD Version 3

Get the tarball and configure the system

This section is describes the steps required to set up the TouchKit Drivers on the Debian-based BCCD platform. The software included with the unit is totally out of date, and there website hosts conflicting drivers, so watch out.

To get the good drivers, go to eGalax TouchKit Drivers Choose your appropriate kernel type. To check to see which kernel version you're using, type

uname -r

Now that the tarball has downloaded, de-tar it. Upon entering the newly unzipped directory, you should see a script named setup.sh

sudo ./setup.sh uninstall

Next install the software

sudo ./setup.sh

This script takes care of the X configuration. It does not install the driver, although it likes to pretend that it does. You will have to do this manually.

Install the Kernel Module

Much of these directions come from eGalax Touchscreen on linuxquestions.org First of all, you're going to need the kernel source for the machine on which you are configuring the touchscreen. This needs to be the exact source tree. Again, you can check the kernel version by typing

uname -r

If you are running version 2.6.22.9_aufs the source tree can be downloaded here

You can download a pre-built kernel module for x86, and the kernel above here


extract the source to /usr/src

To make your life easier, make a sym link linux linking to linux-2.6.* for your version.

ln -s /usr/src/linux-2.6.22.9_aufs /usr/src/linux

enter the /usr/src/directory, and prepare the source to compile a module

make oldconfig

make prepare

make modules SUBDIRS=scripts/mod

Now enter the USBsrc folder and edit the Makefile, changing

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

to

KDIR := /usr/src/linux

now run

make all

When make succeeds, you must copy the newly compiled module over to /lib/modules.

Then test to see everything is working. Make sure the touchscreen is not plugged in the USB ports, and load the module

insmod /lib/modules/tkusb.o

Now plug in the touchscreen. When you run

cat /proc/bus/usb/devices

You should see an entry representing the touchscreen. The important field to note is

Driver=Touchkit

If you see this field, then the driver installation went smoothly.

Set up the touchscreen to control the mouse

Installing the driver is great and all, but now the goal is to link the touchscreen input to the mouse. iphone anyone?


Important Note

The Touchkit driver is fairly unstable, so it's very easy to bork it entirely. Never unplug the touchscreen while it is an active input device. The touchscreen is not as reliable as a mouse or a keyboard, and unplugging it when the tkusb.ko module is looking for it can really mess things up. Always shut down the computer before unplugging the touchscreen.


That being said, you should be able to simply load the module, which you did in the last section, plug the touchscreen into an available USB port, and run

$ Touchkit

This will bring up a touchscreen configuration box. If it can't find the device, then you are witnessing the instability of this module first-hand. In this case, you might try to remove the module from memory

rmmod /lib/modules/tkusb.o

recopy the module from the USBsrc build directory again, because something probably got messed up with the tkusb module in memory

Then try to load the newly copied module and try the above steps again.

Control Panel Design and Interface

The goal here is to develop an interface where people can approach and engage the littlefe easily using a touchscreen command system. qt is the platform of choice at this point for developing the graphical frontend and tieing actions, such as button presses and slider value changes to backend scripts that run certain jobs on the littlefe. The interface will most likely feature a few different tabs for different modes of operation.

The following directions outline the procedure for creating your own interface.

apt-get install designer-qt3

qt3 designer makes it easy to create interfaces and tie certain events pertaining to each object activate a script with certain parameters, specified by a slider or radiobuttons/check boxes.

For this specific project, we're only concerned with the more basic aspects of qt: simply designing an interface and linking events to system calls in c++. For a detailed tutorial on getting started with qt designer, see

OutBack Powersystems MATE

  • The MATE system installed in the display case on the first floor of Dennis has a serial interface. This project will aim to connect solar power generation data to the infobomb system.

LittleFe

  • This data will then be visualized in real time on the littlefe.
  • The touch screen monitor will be connected to the little fe.