Topic: Qt 4.6.3 Chumby One - a complete quide to helloworld
Hi,
I spent a few days testing out some Qt helloworld applications with my Chumby One. Seem to work fine.
In case somebody else is interested, please find below a complete quide to installation of virtual linux development environment to Windows 7 host PC from scratch, compiling and running Qt applications with Chumby:
First installed VirtualBox (with non-gpl extension pack)
http://download.virtualbox.org/virtualb … 51-Win.exe
http://download.virtualbox.org/virtualb … ox-extpack
Downloaded Xubuntu 10.10 Maverick Meerkat
http://se.archive.ubuntu.com/mirror/cdi … 0/release/
Created virtual machine with two virtual hard disks, 15 GB each
Mounted Xubuntu installation image as a CD-ROM to virtual machine.
Booted up virtual machine. Installed Xubuntu with custom hard drive partitioning. Partitioned 15GB to be mounted as root (/) and swap 1 GB partitions for first virtual hard disk. Partitioned second virtual hard disk to be mounted as /home.
Finished with xubuntu installation with installing all pending updates (an icon in the upper right corner). Installed virtualbox guest additions to xubuntu (virtualbox menu -> Devices -> install guest additions).
For remote ssh connections to xubuntu virtual machine, installed ssh server. (I do not use xubuntu graphical desktop but instead I use putty ssh to connect from my Windows 7 host to virtualbox-xubuntu.)
$ sudo apt-get install openssh-server
Configured virtual machine network adapter as "bridged" (virtualbox menu -> Devices -> network).
For easy transfer of files between host Windows 7 and virtualbox,
created a shared folder "Shared". (virtualbox menu -> Devices -> shared folders).
Xubuntu will mount it automatically to "/media/sf_Shared". (after reboot?)
To be able to acccess the shared folder in xubuntu,
added my user to group vboxsf:x:1001:jaik
Installed standard gcc compiler and tools:
$ sudo apt-get install build-essential
$ sudo apt-get install libtool
$ sudo apt-get install autoconf
Installed GNU arm toolchain as specified on
http://wiki.chumby.com/mediawiki/index. … _Toolchain
$ mkdir -p ~/dev/toolchain
$ cd ~/dev/toolchain
$ wget http://files.chumby.com/toolchain/arm-2 … nu.tar.bz2
$ tar xjvf arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
$ sudo mv arm-2008q3 /usr/local
$ sudo ln -s /usr/local/arm-2008q3 /usr/local/arm-linux
$ for i in *; do sudo ln -s $i `echo $i|awk -F"-" '{print $NF;}'`; done
$ sudo rm -f 4.3.2
$ for i in `ls /usr/local/arm-2008q3/bin/arm-none-linux-gnueabi-*`; do name=`echo $i|awk -F"-" {'print $NF'}`; sudo ln -s $i /usr/local/bin/arm-linux-$name; done
$ sudo ln -s /usr/local/arm-2008q3/bin/arm-none-linux-gnueabi-gcc-4.3.2 /usr/local/bin/arm-linux-gcc-4.3.2
Appears that virtualbox usb drive support has a bug. For fix, as suggested on
http://www.virtualbox.org/ticket/5343, 1) First poweroff xubuntu 2) Then start Oracle VM VirtualBox Manager, select Settings, USB 3) Added empty usb device filter.
Inserted usb stick. My USB stick is mounted now as /media/CHUMBY with FAT filesystem.
Reformatted usb stick to ext2:
$ umount CHUMBY
$ sudo mkfs.ext2 -L chumby /dev/sdc1
Removed and inserted the usb stick again.
In Chumby the USB stick is mounted at /mnt/usb. We need to configure Qt and apps with the same path in virtualbox-xubuntu as well.
Let's create a symbolic link in virtualbox-xubuntu:
$ sudo ln -s /media/chumby /mnt/usb
Downloaded touchscreen driver tslib from https://github.com/kergoth/tslib
Unpacked tslib.
Then:
$ ./autogen.sh
$ cd ..
$ mkdir kergoth-tslib-860d69c-build && cd kergoth-tslib-860d69c-build
$ ../kergoth-tslib-860d69c/configure --prefix=/mnt/usb --host=arm-linux
$ make
$ make install
Created /media/chumby/chumby.env with the following:
# environment for qt
# http://www.jespersaur.com/drupal/node/30
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_PLUGINDIR=/mnt/usb/lib/ts
export TSLIB_CONSOLEDEVICE=none
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/event1
export QWS_KEYBOARD=none
#export QWS_KEYBOARD=USB:/dev/input/event1
Edit /media/chumby/etc/ts.conf to enable the row "module_raw input".
#####
Qt 4.6.3
(Note: I also tried Qt 4.7.1, but tested Qt applications crashed in Segmentation fault.
Instead Qt 4.6.3 seems to work fine.)
Downloaded Qt sources http://get.qt.nokia.com/qt/source/qt-ev … 6.3.tar.gz
Compile Qt and qmake:
$ tar xzf qt-everywhere-opensource-src-4.6.3.tar.gz
$ mkdir build-qt-4.6.3
$ cd build-qt-4.6.3/
$ ../qt-everywhere-opensource-src-4.6.3/configure -opensource -embedded arm -xplatform qws/linux-arm-g++ -qt-mouse-tslib -qt-gfx-linuxfb -pch -prefix /mnt/usb -L/mnt/usb/lib/ -I/mnt/usb/include/ -nomake examples -nomake demos && date
$ make && date
---NOTE: At this stage you need to empty the USB stick, if there is a previous Qt version installed (See below.)
$ make install
Compile some test applications:
$ cd ~/dev/qt/qt-everywhere-opensource-src-4.6.3/demos/embedded
$ /media/chumby/bin/qmake
$ make
$ make install_subtargets
Tested all applications in demos/embedded in chumby.
Work fine )))
More apps:
~/dev/qt/qt-everywhere-opensource-src-4.6.3/examples/webkit
domtraversal
fancybrowser - A neat web browser:))
formextractor
framecapture - Fetch a web page and generate a screenshot in file
previewer
simpleselector
NOTE!
If you try compiling different Qt-versions, before doing "make" Qt with a different qt version, you must
1) empty the usb stick
$ cd /media/chumby
$ rm -rf bin demos etc fluidlauncher imports include lib mkspecs pictureflow plugins translations
2) reinstall tslib:
$ cd ~/dev/drivers/kergoth-tslib-860d69c-build$
$ make install
3) Copy environment. tslib-configuration and tslib-calibration in case you had them already laying around:
$ cp ~/dev/env/chumby.env ~/dev/env/etc/pointercal ~/dev/env/etc/ts.conf /media/chumby
#####
Testing in Chumby
Unmount from PC.
$ umount /media/chumby
Take usb stick to chumby. Ssh to chumby.
# /usr/chumby/scripts/stop_control_panel
Set environment for TSLIB.
# cd /mnt/usb
# source chumby.env
Calibrate, if you already did not have the etc/pointercal file:
# /mnt/usb/bin/ts_calibrate
Start your Qt application with -qws:
$ cd /mnt/usb/examples/webkit/fancybrowser
$ ./fancybrowser -qws
Profit!