Install Sun Java in Ubuntu 10.04

Ubuntu System:
Ubuntu 10.04 (lucid)

Reason install Sun Java instead using OpenJDK:

Some applications have problems with OpenJDK, ie. Freenet, Wuala, Sparnord, but work fine with Sun JRE. A Google search reveals many applications and issues. So if you want to use one of these applications you would better use Sun Java.


1) Click Applications -> Software Centre -> In the Menubar, choose Edit -> Software Sources. Go to tab Other Software and tick the first entry (" lucid partner"). Close and confirm the "Reload". 

2) In Software Centre, search for "sun java" and install the first package ("Sun Java 6.0 Plugin").



Battery Backup For on Board Overo Board RTC (twl4030)

I have been googled a lot for the external rtc project. Almost people are discussing about how to make the external rtc working. Seldom to see people mention about the on board rtc usage.

Have a look on gumstix website:
7) The Overo series does not support battery charging.

the battery charging was disabled for safety concern.

However, take a look at this new implementation, line 470:;a=blob;f=drivers/rtc/rtc-twl4030.c;h=72f7863376c8eb61ffbe3c5e51bc0e525744aa09;hb=83d22678ac1d8126b41f6880f57e2421d0c11391

470         /* enable backup battery charging */
471         /* use a conservative 25uA @ 3.1V */
472         ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
473                 BIT_PM_RECEIVER_BB_CFG_BBCHEN |
474                 BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 |
475                 BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA,
476                 REG_BB_CFG)

Measure the voltage at pin12 (Vbackup) while the gumstix is on. There is 3.13V on it.

It seems like the battery backup charging truly has been enabled!

try it anyway...

bought a coin cell battery, connect to Vbackup and Gnd,

root@overo:~# hwclock
Thu Oct  7 06:39:02 2010  0.000000 seconds
root@overo:~# date
Thu Oct  7 06:39:17 UTC 2010
root@overo:~# date 12090857
Thu Dec  9 08:57:00 UTC 2010
root@overo:~# hwclock -w
root@overo:~# hwclock
Thu Dec  9 08:57:14 2010  0.000000 seconds

turn off gumstix, wait for10 minutes, start gumstix,

during the boot process:
fbcvt: 1024x768@60: CVT Name - .786M3-R
Console: switching to colour frame buffer device 60x34
regulator_init_complete: incomplete constraints, leaving VDAC on
twl_rtc twl_rtc: setting system clock to 2010-12-09 09:09:40 UTC (1291885780)
Waiting for root device /dev/mmcblk0p2...
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SD card at address b368
mmcblk0: mmc0:b368 UD    1.90 GiB

root@overo:~# date
Thu Dec  9 09:10:25 UTC 2010
root@overo:~# hwclock
Thu Dec  9 09:10:38 2010  0.000000 seconds

Hmm, how convenient! Great, throw my external rtc away ~

Lithium Vanadium Pentoxide battery, Farnell-1514218


TRIAC and Opto TRIAC Driver Curcuit

Triac is designed to be suitable for general purpose AC switching. They can be used as an ON/OFF function in applications such as static relays, heating regulation, induction motor starting circuits... or for phase control operation in light dimmers, motor speed controllers,...

It's quite common to use Opto Triac driver to switch Triac.

In my project, I need to switch two heating elements on and off every half second. Each heating element is 1.5 kw. 

1500/230 = 6.5A

If I switch two heating element in the same time, the current consumption will be 6.5x2=13A.
The normal house power plug only provides 10A. Therefore, I have to swith one element each time.

Here is my parts list:

Triac: LITTELFUSE - Q6008L5,  Element14-1304759
Triac driver: FAIRCHILD SEMICONDUCTOR - MOC3022-M, Element14-1021366

PS: the middle leg of triac should not connec to live.
Here is the reason: the junction, or die, sometime is connected to A2.

In the meantime, need to calculate the area of heat sink which attaches on the triac.

Uninstall Security Tool 2010

One of my colleague installed "Security Tool 2010" on her personal pc (vista) by mistake.
I googled about this virus, found it's a very clever rogue.

During installation, Security Tool configures itself run automatically every time when you start an application. The rogue also uses this method of running to block the ability to run any programs, including security applications.

Immediately after launch, it will start to scan your computer and reports a lot of various infections that will not be fixed unless you first purchase the software. Important to know, all of these infections are a fake and do not actually exist on your computer. What is more, the rogue will also hijack Internet Explorer and Firefox and display fake warnings when you opening a web site.

As you can see, Security Tool is a scam and should be removed from your computer upon detection.
Do not be fooled into buying the program! It will steal your credit card account, and keep on billing you every month!!

Many website mentioned some methods to kill it. For example, delete files, which call "security tool',  from registration.  I have search the whole registration folders. I couldn't find any file called 'security tool'. Take a look the date of these posts. All of them were in 2009. Hmm, this smart rogue has been updated.

What I have done:
- Restarted pc, and went to safe mode (with network);
- Type 'run' in 'Start'. Then type 'msconfig' to open up 'system configuration' window;
- disabled ALL startup items;
- deleted all .exe (eg. 576544.exe )files in 'C:\users\AppData\Local
- download "Malwarebytes" or copy installation file from other pc.
- install it and do full scan.
- kill this bloody Security Tool;
- reboot pc;


To remove System Tool virus:


Eagle PCB 3D Tutorial


Mercedes Benz A-Class DIY Information

A very useful website:

How to reset Mercedes Benz A-Class Service Indicator

Turn the key to position 2 in the ignition lock and immediately press button 000.0 twice within the space of one second.

Turn the key to position 0 in the ignition lock.

Press and hold button 000.0 Turn the key to position 2 in the ignition lock. Keep button 000.0 pressed.

Service message with current remaining distance or remaining time appears.

After about 10 seconds, an acoustic signal will sound and the service display with the new starting distance or starting time appears for about 10 seconds.

Release button 000.0
Thats it youve reset your service indicator.


Add RTC DS1037 in to gumstix Kernel

Need to add an external real time clock chip on Gumstix to make the time correct.

Overo (I am using Air) has two i2c devices. First all of, add i2c driver in kernel.

Every time when I try to modify kernel, I need to re-source the kernel profile by using:
overo-oe$ source build/profile

overo-oe$ bitbake -c  menuconfig virtual/kernel


PS: the virtual/kernel means the default build kernel in overo directory. or, I still can use:
overo-oe$ bitbake -c menuconfig overo-omap3

take a look at:


in 'device drivers' --- 'real time clock'
add 'y' in front of 'Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025'

ps: y: build into kernel
     m: add a module

save it.

$ cd /build/czhang/overo-oe/
$ cp deconfig deconfig.old
$ cp /build/czhang/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.34-r90/git/.config /build/czhang/overo-oe/

take a look at the "deconfig"
# I2C Hardware Bus support

# I2C system bus drivers (mostly embedded / system-on-chip)
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_OCORES is not set

# I2C RTC drivers
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set

rebuild kernel:
overo-oe$ bitbake -c clean virtual/kernel
overo-oe$ bitbake virtual/kernel

New kernel image is in /build/czhang/overo-oe/tmp/deploy/glibc/images/overo
copy new kernel (uImage) to SD card FAT partition.
start Gumstix, I can see i2c-1 and i2c-3 in /dev.

I2C-1 is the power chip. If you want to alter power settings use this.
I2C-3 is the external connection port. If you want to communicate to
external circuits use this.

I am using DS1338 rtc chip.
power supply votage Vcc is 1.8V
logic VH = Vcc x 0.7
logic VL = 0.3V
Therefore, I don't need a logic converter.

connect rtc to overo, try command:
$ i2cdetect -y -r 3
      0 1 2 3 4 5 6 7 8 9 a b c d e f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50:50-- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

the address of ds1338 is 0x68, not 0x50.
Googled around, found the 0x50 is address of eeprom on the overo. That means the rtc chip has not been detected in the i2c bus.
Then, I thought I need to change to i2c bus speed to be 100khz. The overo i2c bus' default speed is 400khz. I am sure the ds1338 can run at hight speed mode. But I could not talk to rtc at the mement. So, give it a try.

Change i2c bus speed:
(followed steps from

i2c bus speed can be changed by passing a kernel boot argument to the driver in the u-boot startup script.

To modify u-boot, start your system, stop the u-boot process by hitting a key, and make the following change to either nandargs or mmcargs depending how you boot. The nandargs/mmcargs variables are just gumstix conventions for initializing bootargs which is the value u-boot cares about.

Using mmc booting as the example, the old value should look SOMETHING like this:

Overo # printenv
mmcargs=setenv bootargs console=${console} ...

So a add new variable so you can easily change the speed again and then modify mmcargs and save your changes.
Overo # setenv i2cspeed 3,100
Overo # setenv mmcargs setenv bootargs console=\${console} i2c_bus=\${i2cspeed} ...
Overo # saveenv
After reboot gumstix, i got errors:

Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "(null)" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00             512 mtdblock0 (driver?)
1f01            1792 mtdblock1 (driver?)
1f02             256 mtdblock2 (driver?)
1f03            4096 mtdblock3 (driver?)
1f04          255488 mtdblock4 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

Where did I do wrong?!!
Read the instruction again...
Pay attention to these RED words. I was using exact command (copy and paste), even includes the "..." .
How stupid I am : (

I can not remember my mmcargs argument. So, I went to internet, search a printevn to find a similar print out. here is what i found quit similar:

mmcargs=setenv bootargs console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=${defaultdisplay} root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
nandargs=setenv bootargs console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=${defaultdisplay} root=/dev/mtdblock4 rw rootfstype=jffs2
Re-do the 'setenv', reboot, all good. It can boot from mmc again. Thank goodness.
The speed has been changed. But the rtc still can not been found.
Do I need two pull up resisters for SDA and SCL? No, the overo already has them on board. 
I had a close look the chip... It is ds133833!!  this is running at 3.3v! Wrong chip!

*waiting for new chip*

Got a correct rtc ds1338c-18
$ i2cdetect -y -r 3
root@overo:~# i2cdetect -y -r 3
     0 1 2 3 4 5 6 7 8 9 a b c d e f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50:50-- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- --68-- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- 

0x68, yeah, found it.

Here are two command to read and write time from/to rtc:
root@ i2cget -y 3 0x68 0x01              // read from address 0x01 from rtc
root@ i2cset -y 3 0x68 0x02 0x11      // set rtc address 0x02 to be 0x11

after used i2cset command to set time and date correctly, then used command 'hwclock -w' to write clock to system from rtc.
Check system clock:
root@ date

the data and time are different from what i just set in rtc.

then do:
root@ hwclock
this clock time is as same as the system clcok, but different from rtc.


the 'hwclock' is supposed to read hardware clock (rtc). Does that mean the overo has on board rtc?

Google around, yes, it has a 'twl4030' on board rtc.
when i do:
root@ ls /dev
i can see rtc and rtc0
the rtc0 is on board twl4030.

on the internet, most people recommended to get the external rtc clock time from their program code. that's hard~~

use on board rtc and get battery charged.


Install Qwt for Gumstix

(Install Qwt in Ubuntu)

After I finished program in Ubuntu, I want to compile the program for gunstix.
In the beginning, I copied the qwt-5.2.1 folder to my build machine (fc13). When I do
$ make distcleam
cd src/ && make -f Makefile distclean
make[1]: Entering directory `/build/czhang/qt-everywhere-opensource-src-4.7.0/projects/qwt-5.2.1/src'
make[1]: *** No rule to make target `/usr/share/qt4/mkspecs/linux-g++/qmake.conf', needed by `Makefile'.  Stop.
make[1]: Leaving directory `/build/czhang/qt-everywhere-opensource-src-4.7.0/projects/qwt-5.2.1/src'
make: *** [sub-src-distclean-ordered] Error 2

I tried many time. It looks like the "distcleam" command is not working very well. The qwt-5.2.1 folder is copied from Ubuntu machine. That means it has already been build for i386 system. The "distcleam" command supposes to clean all make files, and return to original file.

The easiest way to fix is download qwt source file to FC13, copy folder to:
$ qmake
$ make

error occur:

compiling resources-release-shared/qrc_qwt_designer_plugin.cpp
rm -f
linking plugins/designer/
/build/czhang/overo-oe/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -lQtDesigner
collect2: ld returned 1 exit status
make[1]: *** [plugins/designer/] Error 1
make[1]: Leaving directory `/build/czhang/qt-everywhere-opensource-src-4.7.0/projects/qwt-5.2.1/designer'
make: *** [sub-designer-make_default-ordered] Error 2

It tried to install qwt plugin for qt-designer.
We can disable it by comment out make option in 'qwtconfig.pri'

$ make

Do not need "make install". This command install qwt library to current machine. I am not going to run the program in my FC13.


Next, compile and copy m4 and qwt library to gumstix.

$ rsync -av czhang@
ce-src-4.7.0/projects/qwt-5.2.1/lib/* /usr/lib


Install Qwt in Ubuntu

(link to Install Qwt in Gumstix)

System info:
Ubuntu 10.04 (lucid)
Kernel 2.6.32-26-generic
Qwt: 5.21

Qwt library contains lots of GUI components, such as 2D plot widget.

Download .tar.gz file, extract it. go to that folder:
(PS: qwt-6.0.0-rc3 is quite buggy, use qwt-5.2.1)

$ cd qwt-6.0.0-rc3
$ qmake
$ make

Then, error occurs:

cd src/ && /usr/bin/qmake /home/czhang/qtsdk-2010.04/qwt-6.0.0-rc3/src/ -unix -o Makefile
cd src/ && make -f Makefile 
make[1]: Entering directory `/home/czhang/qtsdk-2010.04/qwt-6.0.0-rc3/src'
compiling qwt_abstract_scale_draw.cpp
In file included from qwt_abstract_scale_draw.h:13,
                 from qwt_abstract_scale_draw.cpp:10:
qwt_global.h:13:21: error: qglobal.h: No such file or directory
In file included from qwt_scale_div.h:14,
                 from qwt_abstract_scale_draw.h:14,
                 from qwt_abstract_scale_draw.cpp:10:
qwt_interval.h:15:20: error: qdebug.h: No such file or directory
In file included from qwt_abstract_scale_draw.h:14,
                 from qwt_abstract_scale_draw.cpp:10:
qwt_scale_div.h:15:19: error: qlist.h: No such file or directory
In file included from qwt_abstract_scale_draw.h:15,
                 from qwt_abstract_scale_draw.cpp:10:
qwt_text.h:14:21: error: qstring.h: No such file or directory
qwt_text.h:15:19: error: qsize.h: No such file or directory
qwt_text.h:16:19: error: qfont.h: No such file or directory
In file included from qwt_abstract_scale_draw.cpp:11:
qwt_math.h:26:20: error: qpoint.h: No such file or directory
qwt_math.h:27:19: error: qmath.h: No such file or directory


When I installed Qt4 creator, it didn't install qt library and source files into the Ubuntu library system. When I use qt creator to compile a program, it uses it's own library files, not the system library files. When I "make" qwt, it is looking for the system library files (and head files .h)

Search the qt4 development installation files, which will install all qt4 library file and source file into system library.

$ apt-cache search qt4-dev

libqwt5-qt4-dev - Qt4 widgets library for technical applications (development)
libsmokeqt4-dev - development files for Qt 4 Smoke library
pyqt4-dev-tools - Development tools for PyQt4
python-qt4-dev - Development files for PyQt4
freecad-doc - FreeCAD documentation
libntrack-qt4-dev - Development package for libntrack-qt4
libqglviewer-qt4-dev - an OpenGL 3D viewer library based on Qt4 - development files
libqwtplot3d-qt4-dev - 3D plotting library based on Qt4/OpenGL (development)
libsoqt4-dev - Qt4 GUI component toolkit for Inventor - development
libsource-highlight-qt4-dev - Syntax highlighting library for Qt (development files)
libtelepathy-qt4-dev - Qt 4 Telepathy library (headers and static library)
libtulip-qt4-dev - Tulip graph library - Qt/OpenGL GUI development files
libvtk5-qt4-dev - Visualization Toolkit - A high level 3D visualization library
libavahi-qt4-dev - Development headers for the Avahi Qt 4 integration library
libpoppler-qt4-dev - PDF rendering library -- development files (Qt 4 interface)
libqt4-dev - Qt 4 development files
libqt4-qt3support - Qt 3 compatibility library for Qt 4
libqt4-sql - Qt 4 SQL module
qt4-dev-tools - Qt 4 development tools
qt4-doc - Qt 4 API documentation
qt4-doc-html - Qt 4 API documentation (HTML format)

$ sudo apt-get install libqt4-dev

then try install again:

$ qmake
$ make
$ sudo make install


run Qt4 creator, no qwt widget!
google a round, need to copy libqwt lib file to Qt plugin folder:
$ cp /home/czhang/qtsdk-2010.04/qwt-6.0.0-rc3/designer/plugins/designer/ /home/czhang/qtsdk-2010.04/bin/designer

run Qt4 creator, still no new widget!

$ cd /home/czhang/qtsdk-2010.04/qwt-6.0.0-rc3/designer/plugins/designer
$ ldd =>  (0x00007fff92bff000) => not found => /home/czhang/qtsdk-2010.04/lib/ (0x00007f4205968000) => /home/czhang/qtsdk-2010.04/lib/ (0x00007f420571b000) => /home/czhang/qtsdk-2010.04/lib/ (0x00007f42049a1000) => /home/czhang/qtsdk-2010.04/lib/ (0x00007f42044cb000) => /home/czhang/qtsdk-2010.04/lib/ (0x00007f4203c76000) => /lib/ (0x00007f4203a59000) => /usr/lib/ (0x00007f4203745000) => /lib/ (0x00007f42034c1000) => /lib/ (0x00007f42032aa000) => /lib/ (0x00007f4202f27000) => /usr/lib/ (0x00007f4202d21000) => /lib/ (0x00007f4202b19000) => /lib/ (0x00007f420283b000) => /usr/lib/ (0x00007f42025b4000) => /usr/lib/ (0x00007f420236c000) => /usr/lib/ (0x00007f4202163000) => /usr/lib/ (0x00007f4201f47000) => /usr/lib/ (0x00007f4201d3d000) => /usr/lib/ (0x00007f4201b08000) => /lib/ (0x00007f42018f0000) => /usr/lib/ (0x00007f42016de000) => /usr/lib/ (0x00007f42013a8000) => /lib/ (0x00007f42011a3000)
/lib64/ (0x00007f4206076000) => /lib/ (0x00007f4200f75000) => /lib/ (0x00007f4200d6f000) => /lib/ (0x00007f4200b46000) => /usr/lib/ (0x00007f420092a000) => /usr/lib/ (0x00007f4200725000) => /usr/lib/ (0x00007f420051f000)

this means the libqwt lib files ( etc) has not been installed in system library, which is in /usr/lib64 (I am using 64bit Ubuntu)
$ sudo cp -a /home/czhang/qtsdk-2010.04/qwt-6.0.0-rc3/lib/* /usr/lib64
$ ldd /home/czhang/qtsdk-2010.04/bin/designer/ =>  (0x00007fff823ff000) => /usr/lib/ (0x00007f38ab037000) => /home/czhang/qtsdk-2010.04/lib/ (0x00007f38aab6e000) => /home/czhang/qtsdk-2010.04/lib/ (0x00007f38aa921000) => /home/czhang/qtsdk-2010.04/lib/ (0x00007f38a9ba7000) => /home/czhang/qtsdk-2010.04/lib/ (0x00007f38a96d1000) => /home/czhang/qtsdk-2010.04/lib/ (0x00007f38a8e7c000) => /lib/ (0x00007f38a8c5f000) => /usr/lib/ (0x00007f38a894b000) => /lib/ (0x00007f38a86c7000) => /lib/ (0x00007f38a84b0000) => /lib/ (0x00007f38a812d000) => /home/czhang/qtsdk-2010.04/lib/ (0x00007f38a7ecd000) => /usr/lib/ (0x00007f38a7cc8000) => /lib/ (0x00007f38a7abf000) => /lib/ (0x00007f38a77e1000) => /usr/lib/ (0x00007f38a755b000) => /usr/lib/ (0x00007f38a7312000) => /usr/lib/ (0x00007f38a7109000) => /usr/lib/ (0x00007f38a6eee000) => /usr/lib/ (0x00007f38a6ce3000) => /usr/lib/ (0x00007f38a6aae000) => /lib/ (0x00007f38a6897000) => /usr/lib/ (0x00007f38a6684000) => /usr/lib/ (0x00007f38a634e000) => /lib/ (0x00007f38a614a000)
/lib64/ (0x00007f38ab569000) => /lib/ (0x00007f38a5f1b000) => /lib/ (0x00007f38a5d16000) => /lib/ (0x00007f38a5aec000) => /usr/lib/ (0x00007f38a58d0000) => /usr/lib/ (0x00007f38a56cc000) => /usr/lib/ (0x00007f38a54c5000)

run Qt4 creator, sweat, see them!

After add a Qwt widget, built project, get some error messages:

error: undefined reference to 'QGraphicsItemPrivate::height() const'  
error: undefined reference to 'QListData::detach(int)'                          
error: undefined reference to 'QGraphicsItemPrivate::setWidth(double)'
error: undefined reference to 'QGraphicsItemPrivate::width() const'    
error: undefined reference to 'QGraphicsItemPrivate::setHeight(double)'
error: undefined reference to 'QGraphicsItemPrivate::resetHeight()'    
error: undefined reference to 'QGraphicsItemPrivate::resetWidth()'     
error: undefined reference to 'QListData::detach_grow(int*, int)'        
error: collect2: ld returned 1 exit status

google around, found i need to add link to QtSvg in .pro file

LIBS += -L/usr/local/lib -lQtSvg

build program, good.

The following QWT installation guide is contributed by Tulga. After a long struggle on fighting with QWT, Tulga installed QWT successfully on Ubuntu :) good job!

"anyone needs fully operational qwt install guide on qwt?? I made one! I'm ready to share with all of you my 2 day nervebraking job. In the end: this whole thing is so easy, when you have right information! The only thing, that above tutorial is missing is the "sudo apt-get install libqt4-dev" command. We need to make sure that this package is installed, otherwise the MAKE command was failing for me, and i think for some other people. This package is not installed automatically with QT4, so we need to finish it manually."

QWT installation on QT steps (in 7 minutes!):

sudo apt-get install libqt4-core libqt4-dev libqt4-gui
sudo apt-get install build-essential libqt4-dev zlib1g zlib1g-dev qt4-dev-tools

By Tulga:
1. Install QT programm (and make sure that all dependencies are installed --> will ask during setup) (Will be installed in /home/tulga/)
2. Download qwt-6.0.0-rc5.tar.bz2
3. cp qwt-6.0.0-rc5.tar.bz2 /home/tulga/
4. tar -xjvf qwt-6.0.0-rc5.tar.bz2
5. apt-cache search qt4-dev //Unnecessary, just to see
6. sudo apt-get install libqt4-dev //This is vital part of successful MAKE
7. qmake
8. make
9. sudo make install
10. sudo cp /home/tulga/qwt-6.0.0-rc5/designer/plugins/designer/ /home/tulga/qtsdk-2010.05/bin/designer/
11. ldd //Unnecessary, just to see
12. cd /etc/
13. sudo gedit qwt.conf //After opening GEdit write following, in the end save the file and close:
14. sudo ldconfig
15. ldconfig -p | grep qwt
16. sudo cp /home/tulga/qwt-6.0.0-rc5/designer/plugins/designer/ /home/tulga/qtsdk-2010.05/bin/designer/
17. Add following codes in the end of .pro file in Qt, before build
LIBS += -L/usr/local/lib -lQtSvg
INCLUDEPATH += /usr/local/qwt-6.0.0-rc5/include
LIBS += -L/usr/local/qwt-6.0.0-rc5/lib -lqwt
18. EnjoY! QWT Designer plugin is in QT Designer. 

Post your opinions on above steps. I would like to hear them!


After tried Tulga's method, some steps need to be correct. Meanwhile, I am still using qwt.5.2.1, because qwt.6.0.0 has made some changes. For example, qwt_data.h is changed to be QwtSeriesData.h. I don't want to change my code which based on qwt-5.2.1.
Here is Tulga's method version 2:

sudo apt-get install libqt4-core libqt4-dev libqt4-gui
sudo apt-get install build-essential libqt4-dev zlib1g zlib1g-dev qt4-dev-tools

1. Install QT programm (and make sure that all dependencies are installed --> will ask during setup) (Will be installed in /home/tulga/)
2. Download qwt-5.2.1.tar.bz2
3. cp qwt-5.2.1.tar.bz2 /home/tulga/
4. tar -xjvf qwt-5.2.1.tar.bz2
5. apt-cache search qt4-dev //Unnecessary, just to see
6. sudo apt-get install libqt4-dev //This is vital part of successful MAKE
7. qmake
8. make
9. sudo make install
10. sudo cp /home/tulga/qwt-5.2.1/designer/plugins/designer/ /home/tulga/qtsdk-2010.05/bin/designer/
11. ldd //Unnecessary, just to see
12. cd /etc/
13. sudo gedit qwt.conf //After opening GEdit write following, in the end save the file and close:
14. sudo ldconfig
15. ldconfig -p | grep qwt
16. sudo cp /home/tulga/qwt-6.0.0-rc5/designer/plugins/designer/ /home/tulga/qtsdk-2010.05/bin/designer/
$ sudo cp -a /home/czhang/qwt-5.2.1/lib/* /usr/lib64
$ ldd /home/czhang/qwt-5.2.1/designer/plugins/designer/
17. Add following codes in the end of .pro file in Qt, before build
LIBS += -L/usr/local/lib -lQtSvg
INCLUDEPATH += /usr/local/qwt-5.2.1/include
LIBS += -L/usr/local/qwt-5.2.1/lib -lqwt
18. EnjoY! QWT Designer plugin is in QT Designer.

The following installation guide from Uwe.

1) Download qwt-5.2.1.tar.bz2
2) tar xfj qwt-5.2.1.tar.bz2
3) cd qwt-5.2.1
4) qmake
5) make
6) su -c "make install" ( Boys, what's so hard about doing this ? )

Now the designer plugin should be copied into the plugins/designer directory of your Qt install directory. All other files can be found in /usr/local/qwt-5.2.1.

The following steps are Linux or Qt basics:

7) The Qwt designer plugin ( or any application using Qwt ) needs to see the Qwt library. Read about ldconfig or LD_LIBRARY_PATH how to do so. Don't continue before "ldd /plugins/designer/" shows a valid path for

When using LD_LIBRARY_PATH note, that an environment variable is only valid for the process itsself and its child processes. Until you have understood what this means better start the designer/creator manually from the shell, where you have set LD_LIBRARY_PATH.

8) Add the following to your application project file

INCLUDEPATH += /usr/local/qwt-5.2.1/include
LIB += -L/usr/local/qwt-5.2.1/lib -lqwt


Touch Screen (Gumstix)

Calibrate the screen:
$ cd /usr/bin
$ ts_calibrate

when I run my Qt project, the mouse curse is still incorrect. That's because the Qt does know which touch screen library can be used.
//$ export QWS_DISPLAY="VNC:LinuxFB"
$ export QWS_MOUSE_PROTO="tslib:/dev/input/touchscreen0"

Hint 1: in /~ directory, ".profile" contains commands to be executed after log on.
Therefore, I can add these two export files in ".profile" to load these two command lines automatically when I log in. Alternative, ".bashrc" file does the same job as ".profile" does.

Hint 2: In almost Linux system (except Ubuntu), system checks /etc/inittab file first when start pc. You can tell which run level is the default from it. Normally rc5 is the default run level. You can add you own applications in rc5.d/S99xxx. The system will run these applications automatically (before log in step).
system will run rcS.d first, then rc5.d

a) applications should be added after "rm nologin"

#! /bin/sh
# rmnologin     This script removes the /etc/nologin file as the last
#               step in the boot process.
# Version:    @(#)rmnologin  1.00  22-Jun-1998

if test -f /etc/nologin.boot
        rm -f /etc/nologin /etc/nologin.boot

# add from here
export QWS_DISPLAY="VNC:LinuxFB"
export QWS_MOUSE_PROTO="tslib:/dev/input/touchscreen0"
/home/czhang/m4 -qws &

: exit 0

b) applications should followed by '&' to make sure they all run on the background, and not affect the login step.

/home/czhang/m4 -qws &

Note: Qt has a build in vnc. we can remotely view the program running on gumstix screen.
I installed vncviewer on my ubuntu machine, and run as:
$ vncviewer 10.0.0.xx      (gumstix IP address)

To use standard USB mouse in gumstix, use following command:
$ export QWS_MOUSE_PROTO= Auto

Remove Title Bar from Qt Application

in each window program, add

    // remove window frame
    Qt::WindowFlags flags = windowFlags();
    if (flags.testFlag(Qt::FramelessWindowHint))
    flags |= Qt::FramelessWindowHint;

This code need to add each window which need to remove title bar.


Running Qt in Gumstix

first of all, make sure your can create a bootable microSD card. Follow the instruction:

Overo and verdex pro COMs will boot directly from a properly prepared microSD card. This section will outline how to partition and format a bootable microSD card.

To create a bootable microSD, compatible with the·OMAP3 boot ROM, set a special geometry using the·fdisk "Expert mode".  These steps also work for verdex pro COMs.
Important Notes:

- When creating a bootable microSD card for an·Overo COM,·you MUST use expert mode. This sets the correct cylinders, heads and sectors for the microSD card before you partition it.
- Gumstix recommends using a microSDHC card for Overo COMs. Only use microSD cards for verdex pro COMs.

The example below shows the steps required to set up a new microSD card of any size.  The numbers shown are given for a particular 2GB microSD card.  You will be directed to make a simple calculation to determine the correct values for your microSD card.
First, insert your card into the development machine's flash card slot. You may need to use a microSD to SD card adaptor to fit your slot. example the device name will be /dev/sde.  Please substitute the proper device name for your machine. You can use 'mount' or 'df' to see where the card mounts on your machine. Let's unmount the device's existing file system before we get started with fdisk:

$ sudo umount /dev/sde1

Partitioning the Card
Now, launch fdisk and create an empty partition table. Note that the argument for fdisk is the entire device (/dev/sde) not just a single partition (i.e. /dev/sde1):

# sudo fdisk /dev/sde

Command (m for help): o
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Let's first look at the current card information:

Command (m for help): p
Disk /dev/sde: 2032 MB, 2032664576 bytes
64 heads, 63 sectors/track, 984 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes
Disk identifier: 0x00aa8e5c
Device Boot      Start         End      Blocks   Id  System
Note the card size in bytes. We will need it later in the process.
Now go into "Expert" mode:
Command (m for help): x

Next, set the geometry to 255 heads, 63 sectors and a calculated value for the number of cylinders required for the particular microSD card. To calculate the number of cylinders, take the 2032664576 bytes reported above by fdisk, divide by 255 heads, 63 sectors and 512 bytes per sector: 2032664576 / 255 / 63 / 512 = 247.12 which we round·down to 247 cylinders.

Expert command (m for help): h
Number of heads (1-256, default 4): 255
Expert command (m for help): s
Number of sectors (1-63, default 62): 63
Warning: setting sector offset for DOS compatiblity
Expert command (m for help): c
Number of cylinders (1-1048576, default 984): 247

Return to fdisk's main mode and create a new partition 32 MB FAT partition:
Expert command (m for help): r
Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
Partition number (1-4): 1
First cylinder (1-247, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-247, default 15): +32M

Change the partition type to FAT32:
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))

Mark it bootable:
Command (m for help): a
Partition number (1-4): 1

Now, create an ext3 partition for the rootfs:
Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
Partition number (1-4): 2
First cylinder (6-247, default 6): 6
Last cylinder or +size or +sizeM or +sizeK (6-247, default 247): 247

To verify your work, print the partition info:
Command (m for help): p
Disk /dev/sde: 2032 MB, 2032664576 bytes
255 heads, 63 sectors/track, 247 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00aa8e5c
Device Boot      Start         End      Blocks   Id  System
/dev/sde1   *           1           5       40131    c  W95 FAT32 (LBA)
/dev/sde2               6         247     1943865   83  Linux

Finally, write the new partition table to the card and then exit:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
Syncing disks

Formatting the New Partitions
Format the first partition as an FAT file system (the -n parameter gives it a label of FAT).  You can change or omit this if you like.
$ sudo mkfs.vfat -F 32 /dev/sde1 -n FAT
mkfs.vfat 2.11 (12 Mar 2005)

Format the second partition as an ext3 file system:
$ sudo mkfs.ext3 /dev/sde2
mke2fs 1.40.8 (13-Mar-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
121920 inodes, 485966 blocks
24298 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=499122176
15 block groups
32768 blocks per group, 32768 fragments per group
8128 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done                          
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: ^[done
This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Installing the Boot Files
There are three files required on the first (FAT) partition to boot your Overo.
1) MLO: the boot-loader loader - this small program is loaded into the OMAP3 processor's static RAM. It does some minimal configuration of system memory and I/O pins and then loads the second file.
2) u-boot.bin: the boot loader
3) uImage: the Linux kernel

Note: For verdex pro, MLO is not required.
You can build these yourself or download pre-built images. but these three files must be named as stated above.

After building or downloading these files, mount the FAT partition of your microSD card. The following example assumes you mount it at /media/card.
$ sudo mount /dev/sde1 /media/card

Due to constraints of the mask boot ROM in the OMAP processor, MLO MUST be written first.
$ sudo cp MLO-overo /media/card/MLO

Copy u-boot and the Linux kernel to the card:
$ sudo cp u-boot.bin /media/card/u-boot.bin
$ sudo cp uImage.bin /media/card/uImage

Now you can unmount the FAT partition.
$ sudo umount /dev/sde1

At this point you have a bootable FAT partition. Lastly, untar your desired root filesystem on the ext3 partition that you created above.  Do not untar your COM rootfs onto your development machine!  This example assumes that you have mounted it at /media/card:
$ sudo mount /dev/sde2 /media/card

Untar your desired rootfs.
$ cd /media/card
$ sudo tar xvaf /path/to/console-image.tar.bz2

Unmount the ext3 partition.
$ sudo umount /dev/sde2

U-boot Environment Refresh
U-boot comes with a default set of environment variables that can change as new versions are released.  If you are updating u-boot, clear your current set of u-boot environment variables the first time you boot with the new version.  Do this by breaking into u-boot and typing the following commands. (Overo ONLY).
$ nand erase 240000 20000
$ reset
To make additional changes to the environment, break into u-boot again, make the changes and type 'saveenv' to save.  This also eliminates the "*** Warning - bad CRC or NAND, using default environment".


PS! The order you copy MLO, u-boot and uImage to microSD FAT partition is very important. Otherwise, you may not boot from microSD card successfully.

Then, copy two files from your build directory to microSD card:
 directory: /build/czhang/overo-oe/tmp/deploy/glibc/images/overo
 files:  uImage-2.6.34-r90-overo.bin
             Angstrom-omap3-console-image-glibc-ipk-2010.7-test-20101005-overo.rootfs.tar.bz2 (extract to sd card)


Problem occur:

after boot from microSD card (which contain pre-make overo image from internet), Ethernet does not work, because i cannot see the light turns on after i plugged Ethernet cable.

in Overo kernel, check the loaded module
$ lsmod
Module Size Used by
libertas_sdio 13860 0
libertas 168952 1 libertas_sdio
lib80211 6848 1 libertas
ipv6 238492 16
ads7846 10328 0

Hmm, eth0 module hasn't been loaded.

$ modprobe smsc911x
smsc911x: Driver version 2008-10-21.
smsc911x-mdio: probed
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:01, irq=-1)
net eth0: MAC Address: 00:15:c9:28:c3:60
net eth0: SMSC911x/921x identified at 0xd0c3a000, IRQ: 336

great, loaded. right, i need to add eth0 module while the overo booting.

$ cd /etc
$ cat modules
### This file is automatically generated by update-modules"
# Please do not edit this file directly. If you want to change or add
# anything please take a look at the files in /etc/modutils and read
# the manpage for update-modules.
### update-modules: start processing /etc/modutils/ipv6

### update-modules: end processing /etc/modutils/ipv6

$ cd /etc/modutils
$ cat > smsc911x ; create a eth0 module file
$ cat smsc911x ; add command in this file
(Ctrl+D to save it)

$ update-modules

reboot gumstix, done!

copy my own build overo image to microSD card, boot gumstix, the eth0 still not work!!
the reason is that the latest version of bb recipes includes the smsc911x in kernal, not a module. take a look in:
$ cd /etc/network
$ cat interfaces
#auto eth0
#iface eth0 inet dhcp
#iface eth1 inet dhcp
(eth0 has been disabled)

$ vi interfaces ; learn how to drive vi, un-comment eth0
auto eth0
iface eth0 inet dhcp
#iface eth1 inet dhcp ; gumstix does not have eth1

reboot gumstix, done.

Note: sometimes, the eth0 will down after I stopped program. To enable the eth0 manually, try:
$ ifconfig eth0 up
$ ifconfig eth0 netmask


$ udhcpc

sometimes "udhcpc" does not work.
I am using
$ifdown eth0
$ifup eth0

to enable the Ethernet.

take a look if the kernel has "rsync", because i need use it to copy Qt arm-lib files from my build machine.
try if you can install "rsync" with opkg command, which is similar to yum or apt-get
$ opkg install rsync
can't install rsync
$ opkg update
$ opkg install rsync
still can't install.

go back to build machine, build rsync package myself.
$ cd /build/czhang/overo-oe
$ source build/profile
$ bitbake rsync

after that, i should be able to see a rsync.ipk file in:

Go to Gumstix, copy this package to /~

$ cd ~
$ opkg install rsync_3.0.6-r0.6_armv7a.ipk

Then copy all Qt ARM-lib file to gumstix lib folder
$ rsync -av czhang@* /usr/lib

copy my Qt executable file to gumstix
$ cd ~
$ scp czhang@ .
$ pwd
$ /home/root/m4
error while loading shared libraries: cannoy

ok, need to copy serial port arm-lib to gumstix
$ rsync -av czhang@* /usr/lib

run again
$ /home/root/m4

great, see my program on the touch screen.

next step is to calibrate the touch screen and import some pictures.


Subversion Control - svn

subversion stores all versioned data in a central repository.

assume I got a Qt project in /home/czhang/project1

firstly, create a repository:
$ mkdir /home/czhang/svn
$ svnadmin create /home/czhang/svn/repos
$ ls /home/czhang/svn/repos
conf/ dav/ db/ format hooks/ locks/ README.txt

import project folder into repository:
$ svn import ~/project1 file:///home/czhang/svn/repos/project1 -m "initial import"

now the repository contains all 'project1' files. I won't see these files in /home/czhang/svn/repos, they are all stored within a database.
Note that the original /home/czhang/project1 directory is unchanged. Subversion is unaware of it. (in fact, i can even delete that directory if i wish.) To start manipulating repository data, I need to create a new "working copy" of the data, a sort of private workspace.

$ svn checkout file:///home/czhang/svn/repos/project1 ~/svn_project

now I have a personal copy of part of the repository in a new directory name "svn_project".
I can edit Qt project from this folder and then commit those changes back to the repository.

!!! in Qt, make sure in "Projects" tag --- "Build Settings" --- "General": un-tick "Shadow build". 
otherwise, project will be built in wrong directory.

To reverse back to older version project, close this project, and go to the personal project folder which I am working in. Use command:
$ svn info                ; check version information
$ svn co up -r 1       ; reverse back to version 1
$ svn up -r 1            ; if it has already been checked out

Then use svn over ssh to checkout all program files to another pc (eg. server)

$  svn co svn+ssh://czhang@ /build/czhang/qt-everywhere-opensource-src-4.7.0/projects/m4_arm

!!! remember, all resource files only can be put into
    otherwise, it won't compile for arm processor
    if there isn't a "projects" folder, create one.

go to folder "m4"
$ qmake
$ make
arm-linux-g++ -c -pipe -fno-exceptions -O2 -Wall -W -D_REENTRANT -D_TTY_POSIX_ -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../mkspecs/qws/linux-arm-g++ -I. -I../../../include/QtCore -I../../../include/QtNetwork -I../../../include/QtGui -I../../../include -I/home/czhang/Downloads/qextserialport -I.moc/release-shared-emb-arm -I.uic/release-shared-emb-arm -o .obj/release-shared-emb-arm/mainscr.o mainscr.cpp
In file included from mainscr.cpp:7:
globleVar.h:6:28: error: qextserialport.h: No such file or directory
In file included from mainscr.cpp:7:
globleVar.h:49: error: expected initializer before ‘*’ token
mainscr.cpp: In member function ‘void MainScr::on_pushButton_clicked()’:
mainscr.cpp:108: error: ‘serialPort’ was not declared in this scope
mainscr.cpp: In member function ‘void MainScr::openSerialPort()’:
mainscr.cpp:136: error: ‘serialPort’ was not declared in this scope
mainscr.cpp:136: error: expected type-specifier before ‘QextSerialPort’
mainscr.cpp:136: error: expected `;' before ‘QextSerialPort’
mainscr.cpp:144: error: ‘BAUD115200’ was not declared in this scope
mainscr.cpp:145: error: ‘PAR_NONE’ was not declared in this scope
mainscr.cpp:146: error: ‘FLOW_OFF’ was not declared in this scope
mainscr.cpp:147: error: ‘DATA_8’ was not declared in this scope
mainscr.cpp:148: error: ‘STOP_1’ was not declared in this scope
mainscr.cpp: In member function ‘void MainScr::strSend(QString)’:
mainscr.cpp:156: error: ‘serialPort’ was not declared in this scope
mainscr.cpp: In member function ‘QString MainScr::strReceive()’:
mainscr.cpp:162: error: ‘serialPort’ was not declared in this scope
make: *** [.obj/release-shared-emb-arm/mainscr.o] Error

take a look
$ gedit

# Project created by QtCreator 2010-08-04T16:44:30

QT       += core gui


    mainscr.cpp \
    main.cpp \
    cyclescrdialog.cpp \
    engscrdialog.cpp \
    manopdialog.cpp \
    globleVar.cpp \

    mainscr.h \
    cyclescrdialog.h \
    engscrdialog.h \
    manopdialog.h \
    globleVar.h \

FORMS    += \
    mainscr.ui \
    cyclescrdialog.ui \
    engscrdialog.ui \
    manopdialog.ui \

LIBS += -lqextserialport
INCLUDEPATH += /home/czhang/Downloads/qextserialport

at the last line, the path of qextserialport is still in old directory. change it to be:

INCLUDEPATH += /build/czhang/qt-everywhere-opensource-src-4.7.0/projects/qextserialport

$ make clean
$ make
arm-linux-g++ -Wl,-rpath-link,/build/czhang/qt-everywhere-opensource-src-4.7.0/lib -fno-exceptions -Wl,-O1 -Wl,-rpath,/usr/lib -Wl,-rpath,/usr/lib -o m4 .obj/release-shared-emb-arm/mainscr.o .obj/release-shared-emb-arm/main.o .obj/release-shared-emb-arm/cyclescrdialog.o .obj/release-shared-emb-arm/engscrdialog.o .obj/release-shared-emb-arm/manopdialog.o .obj/release-shared-emb-arm/globleVar.o .obj/release-shared-emb-arm/pwdialog.o .obj/release-shared-emb-arm/moc_mainscr.o .obj/release-shared-emb-arm/moc_cyclescrdialog.o .obj/release-shared-emb-arm/moc_engscrdialog.o .obj/release-shared-emb-arm/moc_manopdialog.o .obj/release-shared-emb-arm/moc_pwdialog.o    -L/build/czhang/qt-everywhere-opensource-src-4.7.0/lib -lqextserialport -lQtGui -L/build/czhang/qt-everywhere-opensource-src-4.7.0/lib -lQtNetwork -lQtCore -lpthread
/build/czhang/overo-oe/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -lqextserialport
collect2: ld returned 1 exit status
make: *** [m4] Error 1

add lib path:
$ gedit

LIBPATH += /build/czhang/qt-everywhere-opensource-src-4.7.0/projects/qextserialport/build

after that, use following command to check your program:
$ readelf -a m4 | less

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1

program m4 is in ARM format.

Next time, after I commit a new version of program, I just need to use 'svn up' to checkout.
$ cd /build/czhang/qt-everywhere-opensource-src-4.7.0/projects/m4_arm
$ svn up