Labels

31/05/2011

Disable gumstix overo console login message on ttyS2

In my design, I need to use second serial port (ttyS2) on overo.
I connected SDA3 (pin 24 on chestnut43 board) to WinXP hyperterminal, and booted up Overo.
I saw all booting messages are showing in hyperterminal.

----------------------------------------------------------- 
Login timed out after 60 seconds.                                               
                                                                                
.-------.                                                                       
|       |                  .-.                                                   
|   |   |-----.-----.-----.| |   .----..-----.-----.                             
|       |     | __  |  ---'| '--.|  .-'|     |     |                             
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |                             
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'                             
                -'  |                                                           
                '---'                                                           
                                                                                
The Angstrom Distribution overo ttyS2                                           
                                                                                
Angstrom 2010.7-test-20101005 overo ttyS2                                       
                                                                                
overo login: root                                                               
 |  '  | | | |                                                                   
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'                             
                -'  |                                                           
                '---'                                                           
                                                                                
The Angstrom Distribution overo ttyS2                                           
                                                                                
Angstrom 2010.7-test-20101005 overo ttyS2                                       
... 
... 

-------------------------------------------------------------------- 

Then, I run my program (written by Qt), the hyperterminal shows as follow: 

-------------------------------------------------------------------------- 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
... 
... 
------------------------------------------------------------------------- 

in the meantime, the string which sent from Qt program also shows in the screen. 
I only want ttyS2 send the information from my program, not other messages.

With help from Nabble forum, the following is my solution:

Those messages are from the kernel.  U need to change the "console" uboot environment variable, otherwise the kernel will print messages on that serial port.

Take a look at uboot environment variable. to do this ,  boot gumsix, pushed any key to stop it booting from MMC. Then use "printenv" list all u-boot variables. 
------------------------------------------ 
Overo # printenv 
bootcmd=if mmc init; then if run loadbootscript; then run bootscript; else if run loaduimagei 
baudrate=115200 
loadaddr=0x82000000 
console=ttyS2,115200n8 
vram=12M 
dvimode=1024x768MR-16@60 
nandargs=setenv bootargs console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.d2 
loadbootscript=fatload mmc 0 ${loadaddr} boot.scr 
bootscript=echo Running bootscript from mmc ...; source ${loadaddr} 
loaduimage=fatload mmc 0 ${loadaddr} uImage 
mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr} 
nandboot=echo Booting from nand ...; run nandargs; nand read ${loadaddr} 280000 400000; boot} 
dieid#=0ef000040000000004035c140d002011 
ethact=smc911x-0 
bootdelay=2 
defaultdisplay=lcd43 
i2cspeed=3,100 
bootargs=console=ttyS2,115200n8 i2c_bus=${i2cspeed} vram=12M omapfb.mode=dvi:1024x768MR-16@6t 
mmcargs=setenv bootargs console=${console} i2c_bus=${i2cspeed} vram=12M omapfb.mode=dvi:1024t 
stdin=serial 
stdout=serial 
stderr=serial 

Environment size: 1279/131068 bytes 
--------------------------------------------- 

the "console=ttyS2,115200n8" means send console login messages to ttyS2.

After that, take a look at /etc/inittab in mmc system on 2G SD card.
-------------------------------------------------
# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:5:initdefault:

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin
S:2345:respawn:/sbin/getty 115200 ttyS2
# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
#  :::
#

1:2345:respawn:/sbin/getty 38400 tty1
-------------------------------------------------------

The last line sets up a login on tty1.  If you have a keyboard (eg. USB keyboard via a powered HUB)  and display connected, then you'd be able to login using those.  I am using a chestnut43 board with LCD, and i can use tty1 on a couple of occasions when I messed up the networking.

the command to change console environment variable are follows:

# setenv console tty1 
# saveenv 
The console setting is passed to the kernel at boot time.  It Only tells the kernel where to send messages;  It does not have anything to do with login terminals as that is handled by inittab and getty.  I can use tty1 because it allows me to see the kernel messages on the LCD during boot. 

20/05/2011

Linux hints

After reinstalled Ubuntu in my laptop, I tried to ssh laptop from Fedora computer. I got following error message:

[czhang@F13-64-VM projects]$ ssh czhang@10.0.0.124

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Someone could be eavesdropping on you right now (man-in-the-middle attack)!

It is also possible that the RSA host key has just been changed.

The fingerprint for the RSA key sent by the remote host is

4e:b4:d9:05:e3:b3:81:3c:1a:f6:79:64:c1:23:b7:83.

Please contact your system administrator.

Add correct host key in /home/czhang/.ssh/known_hosts to get rid of this message.

Offending key in /home/czhang/.ssh/known_hosts:3

RSA host key for 10.0.0.124 has changed and you have requested strict checking.

Host key verification failed.

This is because the RSA host key has changed since reinstalled the system.
Just remove the RSA key will solve the problem.

$ rm /home/czhang/.ssh/known_hosts

17/05/2011

Ubuntu 10.04 Install No Machine NX

Download DEB package from here:
http://www.nomachine.com/download-package.php?Prod_Id=2573

$ sudo chmod 755 /usr/lib/cups/backend/ipp
$ sudo dpkg -i nxclient_3.4.0-7_x86_64.deb

11/05/2011

Install QWT in Fedora 14

yum install libQtGTL
yum install libQtGTL-devel
yum install gcc-c++
yum install qt-devel

1. Install Qt programm (Will be installed in /home/czhang/QtDSK)
2. Download qwt-6.0.0.tar.bz2
3. cp qwt-6.0.0.tar.bz2 /home/czhang/
4. tar -xjvf qwt-6.0.0.tar.bz2
5. qmake-qt4
6. make
7. sudo make install
8. sudo cp /home/czhang/qwt-6.0.0/designer/plugins/designer/libqwt_designer_plugin.so /home/czhang/QtSDK/QtCreator/lib/qtcreator/plugins/designer
9 cp -a /home/czhang/qwt-6.0.0/lib/* /usr/lib64  // copy all libqwt.so libqwt.so.6 etc.
10 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/include
LIBS += -L/usr/local/qwt-6.0.0-rc5/lib -lqwt