First, we need the GNU toolchain to cross-compile things for the Chumby. Download and install it from:
Now, we need to decide where to install our files to; i.e., our prefix. Since I'm having some trouble with my NFS share, I'll use my USB stick. (Located at /mnt/usb). Feel free to replace this with your prefix wherever you see me mention this location. Next, we need to download and install tslib for the touchscreen.
I used version 1.0 from: http://tslib.berlios.de/
Make sure you have autoconf, libtool, and the other usual suspects installed. Then from the extracted files directory run:
./autogen.sh
./configure --prefix=/mnt/usb --host=arm-linux
make
If you get some errors about rpl_malloc, simply comment out that evil line in config.h and try make again.
And finally:
make install
Next up is Qt.
Unpack it, and run:
./configure -embedded arm -pch -prefix /mnt/usb -qt-kbd-usb -qt-mouse-tslib \
-L/mnt/usb/lib/ -I/mnt/usb/include/ -nomake examples -nomake demos
Note:You can leave out the -qt-kbd-usb if you want. I kept it in since I like being able to type on the Chumby with my USB keyboard ;). Also, thanks to orangerobot from the Chumby forum for pointing out the mangled -L line.
Next:
make
make install
So far we don't have any Qt programs to play with. Let's compile a small Qt widget/app called PictureFlow (http://code.google.com/p/pictureflow/) by Ariya Hidayat.
I have modified the sources slightly (added basic mouse support, some images, resizing), and packaged it here:
pictureflow-chumby_1_0_tar.gz
Uncompress it, and in that very directory:
/mnt/usb/bin/qmake
make
Copy the resulting binary and images to a place on your prefix:
mkdir /mnt/usb/test
cp pictureflow *jpg /mnt/usb/test/
Now, we need to create a file with some environment variables that you can use when you're in your Chumby shell.
Create a file in your prefix (/mnt/usb for me) called chumby.env with the following contents:
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_PLUGINDIR=/mnt/usb/lib/ts
export TSLIB_CONSOLEDEVICE=/dev/ttyS0
export TSLIB_CONFFILE=/mnt/usb/etc/ts.conf
export TSLIB_CALIBFILE=/mnt/usb/etc/pointercal
export LD_LIBRARY_PATH=/lib:/mnt/usb/lib
export POINTERCAL_FILE=/mnt/usb/etc/pointercal
export QWS_MOUSE_PROTO=Tslib:/dev/input/event0
export QWS_KEYBOARD=USB:/dev/input/event1
Enable SSH on the Chumby as per:
http://wiki.chumby.com/mediawiki/index.php/Chumby_tricks#Open_a_secure_s...
SSH in and cd in to your directory of installed files.
For me, this meant:
Plugging in my USB stick.
ssh root@<ChumbyIpAddress>
cd /mnt
umount usb
mount usb
cd usb
Lets start off by killing the current Chumby GUI:
/usr/chumby/scripts/stop_control_panel
Now, we need to source that file with environment variables:
source /mnt/usb/chumby.env
Then, we need to configure the touch screen for tslib.
Make sure that your etc/ts.conf file has the input module un-commented.
My /mnt/usb/etc/ts.conf looks like:
module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear
Finally, we need to calibrate the touchscreen:
/mnt/usb/bin/ts_calibrate
Make sure that you touch the five different crosshair locations. If you accidently tap twice at the same spot, re-run ts_calibrate untill you get it right :)
To test and make sure that tslib is working correctly, feel free to play with:
/mnt/usb/bin/ts_test
You should be able to drag the crosshair around.
And last but not least - it's time to try out our Qt app:
cd /mnt/usb/test
./pictureflow -qws
If all is well, you should see something that looks like this:
(http://www.youtube.com/watch?v=v2yN0F7_YlI)
Hopefully you didn't encounter any problems. These steps worked for me, but I may have just been lucky ;). More likely though is that I forgot to mention something. Please feel free to ask questions on this Chumby forum thread:
http://forum.chumby.com/viewtopic.php?id=720/
Allthough I realize that this was quite cumbersome, the good new is that you basically only need to do this once. Thereafter you just need to write your Qt app (Google for tutorials ;)), qmake, make, and copy the executable to your Chumby! :)