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 smile)))

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!

Re: Qt 4.6.3 Chumby One - a complete quide to helloworld

Wow.... incredible work.
This post go straight to my bookmarks.

I'm going to try this right away.

Re: Qt 4.6.3 Chumby One - a complete quide to helloworld

Thanks for a great tutorial.

Has anyone had any joy adding Phonon support?

I've tried:
- using apt-get to install to install the gstreamer libraries (libgstreamer0.10-0, libgstreamer0.10-dev, libgstreamer-plugins-base0.10-0, libgstreamer-plugins-base0.10-dev)
- adding -phonon -phonon-backend -glib to the ./configure command

But I always get the response "Glib support cannot be enabled due to functionality tests!"

Using -v (verbose output) it appears that it is trying to run the ARM qmake on the host and failing. I must be missing a config option, but I can't work out what.

Any ideas?

Many thanks,
Pete

Re: Qt 4.6.3 Chumby One - a complete quide to helloworld

Is this build similar to the one used to build the qt based browser? http://forum.chumby.com/viewtopic.php?id=5413

Re: Qt 4.6.3 Chumby One - a complete quide to helloworld

clay_shooter wrote:

Is this build similar to the one used to build the qt based browser? http://forum.chumby.com/viewtopic.php?id=5413

Yes it is.

6 (edited by jskeletti 2011-02-05 15:00:46)

Re: Qt 4.6.3 Chumby One - a complete quide to helloworld

Is it possible to develop the application on windows plattforms with the qt desinger and run them on chumby? Is it possible to use an other language as c++? c# or java maybe?

7 (edited by jaik 2011-02-06 07:17:16)

Re: Qt 4.6.3 Chumby One - a complete quide to helloworld

jskeletti wrote:

1) Is it possible to develop the application on windows plattforms with the qt desinger and run them on chumby? 2) Is it possible to use an other language as c++? c# or java maybe?

1)
Unfortunately as far as I have understood the compiling of Qt embedded linux applications is for linux only. For Windows, you would need to build yourself a qmake for cross-compiling embedded linux Qt applications for Chumby ARM processor. If you feel lucky, you could try downloading and installing the complete Qt development environment Qt SDK for Windows, and then separately downloading the source package of Qt libraries for Windows. Then would come the hard part -- using the source package of Qt libraries for Windows you would need to build yourself the cross-compiler. Please let us know if you succeed smile

On the other hand, if you just would like to use Qt Designer, you may do that in Linux virtual machine as well. Just download and install Qt SDK for Linux/X11 in the virtual machine. (You still need to separately build the embedded cross-compiler as per my first post above, and then assign Qt Designer to use the cross-compiler.)

2)
I have not tried, but most likely it is possible. For java you would first need java binaries built for embedded linux ARM processor. For C# i have no clue. Just maybe if you first could get Windows CE running for Chumby?

Re: Qt 4.6.3 Chumby One - a complete quide to helloworld

jaik, do you have any problem while installing tslib & qt libraries on to thumbdrive?

I have problems because I'm using a FAT32 thumbdrive, and FAT32 does not support symbolic links on it.
I manually copy those libraries on to thumbdrive and rename them appropriately.

Also, before calibrating the touchscreen. You must make sure /mnt/usb/etc is writable, although you are already 'root'.