Thursday, July 16, 2009

at+CSQ, RSSI value and RSSI bar

at+CSQ



What do the numbers mean?

The number returned by the AT+CSQ command gives you a more accurate measurement of signal strength. The following table lists the dBm equivalent measurements (note that the dBm measurements are negative, so a higher negative number represents a lower signal strength):

0 < -113 dBm (Marginal) 1 -111 dBm (Marginal) 2 -109 dBm (Marginal) 3 -107 dBm (Marginal) 4 -105 dBm (Marginal) 5 -103 dBm (Marginal) 6 -101 dBm (Marginal) 7 -99 dBm (Marginal) 8 -97 dBm (Marginal) 9 -95 dBm (Marginal) 10 -93 dBm (Workable under most conditions) 11 -91 dBm (Workable under most conditions) 12 -89 dBm (Workable under most conditions) 13 -87 dBm (Workable under most conditions) 14 -85 dBm (Workable under most conditions) 15 -83 dBm (Good) 16 -81 dBm (Good) 17 -79 dBm (Good) 18 -77 dBm (Good) 19 -75 dBm (Good) 20 -73 dBm (Excellent) 21 -71 dBm (Excellent) 22 -69 dBm (Excellent) 23 -67 dBm (Excellent) 24 -65 dBm (Excellent) 25 -63 dBm (Excellent) 26 -61 dBm (Excellent) 27 -59 dBm (Excellent) 28 -57 dBm (Excellent) 29 -55 dBm (Excellent) 30 -53 dBm (Excellent) 31 > -51 dBm (Excellent)

So what do these numbers mean?

  • Marginal – Levels of -95dBm or lower. At these sort of levels, it is very likely that you may suffer low throughput and disconnects due to cell loading/breathing even with an outdoor antenna.
  • Workable under most conditions – Levels of -85dBm to -95dBm – Probably worth considering an outdoor gain type antenna. Could suffer poor throughput and disconnects due to cell loading/breathing.
  • Good – Levels between -75dBm and -85dBm – normally no problem holding a connection with this sort of level (even with cell breathing) without the use of an external antenna.
  • Excellent – levels above -75dBm. Should not be affected by cell breathing/loading and should not require an external antenna.

For those who are technically oriented, as most BB Users are, and want MORE, here is an approximate tabulation of the # of Bars vs. signal level in dBM:
1 bar ~ -102 to -120 dBM
2 Bars ~ -93 to -101 dBM
3 Bars ~ -87 to -92 dBM
4 Bars ~ -78 to -86 dBM
5 Bars ~ -40 to -77 dBM

Signal Bar Strength Indicators RSSI Indicators
5 bars (optimal strength) -77 or higher
4 bars -78 to 86
3 bars -87 to -92
2 bars -93 to -101
1 bar -102 or lower

Tuesday, June 9, 2009

how to cross compile lighttpd with pcre support

1. download lighttpd and pcre from
http://www.lighttpd.net/download (the current version is 1.4.22)
http://www.pcre.org/ (the current versioin is 7.9)

2. cross compile pcre at first.

a. setup the environment. I use ELDK as the cross compile tools.
#!/bin/sh

export ROOTFOLDER=/home/hongfeng/PhoenixWebUI/ELDK
export PATH=$ROOTFOLDER/bin:$ROOTFOLDER/usr/bin:$PATH
export CC=arm-linux-gcc
export AR=arm-linux-ar
export LD=arm-linux-ld
export RANLIB=arm-linux-ranlib
export STRIP=arm-linux-strip
export AS=arm-linux-as
export NM=arm-linux-nm
export ARCH=arm
export CROSS_COMPILE=arm-linux-

b. cross compile pcre and install it.
./configure --host=arm --prefix=/home/hongfeng/PhoenixWebUI/usr
make
make install

3. cross compile lighttpd and install it.
./configure --with-pcre --host=arm-linux --without-bzip2 PCRECONFIG=pcre-config PCRE_LIB=/home/hongfeng/PhoenixWebUI/usr/lib/libpcre.a CFLAGS="$CFLAGS -DHAVE_PCRE_H=1 -DHAVE_LIBPCRE=1 -I/home/hongfeng/PhoenixWebUI/usr/include" LDFLAGS="$LDFLA
GS" --without-zlib --prefix=/home/hongfeng/PhoenixWebUI/usr/
make
make install

After that, everything is in /home/hongfeng/PhoenixWebUI/usr

copy them to the device and run it in the device
/usr/sbin/lighttpd -D -f /usr/lighttpd.conf -m /usr/lib &

it works.

Friday, April 17, 2009

Activate the Bluetooth connection after softreset and hardreset in Windows CE 5.0

Add this registry will Activate the bluetooth pan connection after reset.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Bluetooth\pan]
"ActivateOnBoot"=dword:00000001

Tuesday, April 7, 2009

QT4.4.3的lib目录和plugins目录

the default position is
/usr/local/Trolltech/QtEmbedded-4.4.3-arm/lib
/usr/local/Trolltech/QtEmbedded-4.4.3-arm/plugins

put all the cross-compiled libraries and plugins to the above folder. The QT4.4, JPEG, GIF and so on will work.

Monday, March 16, 2009

QT4 environment on Fedora 8

为了避免主用户(经常编译程序的用户)在编译软件时遇到使用的Qt3.x和Qt4学习环境相混淆,最好是新建一个专门的用户来学习Qt4编程。

新建用户并登录,然后需要在我们的shell配置文件里增加几行,bash配置文件为。bash_profile:

执行kwrite ~/.bash_profile

添加如下内容:

PATH=/usr/lib/qt4/bin:$PATH export PATH QTDIR=/usr/lib/qt4/ export QTDIR

执行以下命令:

cd /usr/bin

ln -s /usr/lib/qt4/bin/qmake qmake4

ln -s /usr/lib/qt4/bin/designer designer4

ln -s /usr/lib/qt4/bin/assistant assistant4

当然,以后如果使用了KDE4桌面就不会有这等麻烦事。

可以使用

which qmake 检查设置是否成功

Wednesday, September 10, 2008

WinCE 5.0 bug on persistent storage

The files in the recycle bin can not be restored after a hard reset. It is a Microsoft bug.

交叉编译qt-embedded-free-3.3.8 (转贴)

我是用qt-embedded-free-3.3.4


交叉编译环境:
HOST操作系统:Linux-2.6.15-1.2054_FC5-GCC版本-4.1.0
TARGET:mx31开发板(freescale-ARM11平台)
交叉编译工具链:arm-none-linux-gnueabi(mx31开发板所提供) gcc-4.1.1
Qt/E版本:qt-embedded-free-3.3.8
(ps:HOST上已经编译过qt-embedded-free-3.3.8---gcc 4.1.0)

下面的过程是在HOST-PC上已经正确的安装了qt-embedded-free-3.3.8上进行的:

交叉编译的详细步骤:
第一步:下载qt-embedded-free-3.3.8并解压缩到自定义的目录下。

我的目录是
tar jxvf qt-embedded-free-3.3.8.tar.bz2
自动生成 /root/qt/qt-embedded-free-3.3.8
(注意:记得将你在HOST编译好的QT/E的目录下的bin文件里的moc和uic二进制文件copy到我们交叉编译的目录下的bin文件夹里-就是/root/qt/qt-embedded-free-3.3.8)

注:moc and uic 应该是由qt-x11-free-3.3.8编译生成的。因为我使用 qt-x11-free-3.3.4所以要

./configure -no-xft. 3.3.5 should not have such problem.



第二步:安装交叉编译工具链
这一步取决于你所使用的交叉编译工具链,我的是arm-none-linux-gnueabi(freescale的mx31开发板所提供)

安装完成后bin的目录是:
/opt/freescale/usr/local/gcc-4.1.1-glibc-2.4-nptl-6/arm-none-linux-gnueabi/bin

第三步:配置qmake(即指定交叉编译工具)
在mkspecs/qws/下建立arm-none-linux-gnueabi目录
cd /root/qt/qt-embedded-free-3.3.8
cd mkspecs/qws/
mkdir arm-none-linux-gnueabi

把mkspecs/qws/linux-arm-g++下的qmake.conf和qplatformdefs.h复制到mkspecs/qws/arm-none-linux-gnueabi目录下

然后修改qmake.conf文件,把文件里面的编译器指定为arm-none-linux-gnueabi

用arm-none-linux-gnueabi-gcc和arm-none-linux-gnueabi-g++替代以下的arm-linux-gcc和arm-linux-g++

QMAKE_CC = arm-linux-gcc
QMAKE_CXX = arm-linux-g++
QMAKE_LINK = arm-linux-g++
QMAKE_LINK_SHLIB = arm-linux-g++

第四步:环境变量的设置
export QTEDIR=/root/qt/qt-embedded-free-3.3.8
export QTDIR=$QTEDIR
export PATH=/opt/freescale/usr/local/gcc-4.1.1-glibc-2.4-nptl-6/arm-none-linux-gnueabi/bin:$PATH
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

第五步:config
./configure -xplatform qws/arm-none-linux-gnueabi -no-cups -no-stl -no-qvfb -depths 4,8,16,32 -qt-gif -embedded arm -disable-sql

注意:在configure的时候会出现一个警告
WARNING: Failure to find: .moc/release-static-mt-emb-x86/allmoc.cpp

关于这个问题官方已经给出答案,引用如下
This is not a problem. It happens everytime Qt/embedded is configured.
所以,这个警告可以不预理会。

第六步:make 或者是 make sub-src
make/make sub-src

注意:make的时候由于对于qt3的交叉编译工具的gcc版本问题而导致提示如下错误:

../include/qstring.h: In member function 'ushort& QChar::unicode()':
../include/qstring.h:199: error: cannot bind packed field
'((QChar*)this)->QChar::ucs' to 'ushort&'

解决办法:
打开src/tools/qglobal.h查看318-326行:
# if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)
# define Q_PACKED __attribute__ ((packed))
# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4
# define Q_NO_PACKED_REFERENCE
# endif
# endif
# if !defined(__EXCEPTIONS)
# define Q_NO_EXCEPTIONS
# endif

修改如下:
# if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)
# define Q_PACKED __attribute__ ((packed))
# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4
# define Q_NO_PACKED_REFERENCE
# endif
+# if __GNUC__ == 4 && __GNUC_MINOR__ >= 0
+# define Q_NO_PACKED_POINTERS
+# endif
# endif
# if !defined(__EXCEPTIONS)
# define Q_NO_EXCEPTIONS
# endif

打开src/include/qstring.h查看195-199行
ushort unicode() const { return ucs; }
#ifdef Q_NO_PACKED_REFERENCE
ushort &unicode() { return *(&ucs); }
#else
ushort &unicode() { return ucs; }
#endif

修改如下:
ushort unicode() const { return ucs; }
#ifdef Q_NO_PACKED_REFERENCE
ushort &unicode() { return *(&ucs); }
+#elif defined Q_NO_PACKED_POINTERS
+ ushort &unicode() { ushort& tmp = ucs; return tmp; }
#else
ushort &unicode() { return ucs; }
#endif

ps:+号表示修改的地方

接下来就是make clean
make

第七步 strip
交叉编译成功后在/lib文件夹下生成以下文件:
libqte-mt.so
libqte-mt.so.3
libqte-mt.so.3.3
libqte-mt.so.3.3.8

[root@localhost lib]# ls -l
lrwxrwxrwx 1 root root 18 09-05 17:25 libqte-mt.so -> libqte-mt.so.3.3.8
lrwxrwxrwx 1 root root 18 09-05 17:25 libqte-mt.so.3 -> libqte-mt.so.3.3.8
lrwxrwxrwx 1 root root 18 09-05 17:25 libqte-mt.so.3.3 -> libqte-mt.so.3.3.8
-rwxr-xr-x 1 root root 7091636 09-07 08:51 libqte-mt.so.3.3.8

我们先来查看文件信息:
[root@localhost lib]# file libqte-mt.so.3.3.8
libqte-mt.so.3.3.8: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), not stripped

此时显示的是not stripped,即没有经过strip。

[root@localhost lib]# arm-none-linux-gnueabi-strip libqte-mt.so.3.3.8

执行strip命令之后我们再次查看文件信息:
[root@localhost lib]# file libqte-mt.so.3.3.8
libqte-mt.so.3.3.8: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), stripped

此 时显示的是stripped,即已经strip。你会发现,strip之后libqte-mt.so.3.3.8发生明显变化的,不过在实际的开发过程 中,我们是不提倡这样做的,因为使用strip后,使用gdb时就无法获得调试信息了。故,在开发过程,我们为了方便以后的调试最好不要strip。

后 记:因为是初步交叉编译,所以触摸屏支持和字体库的添加,中文支持,如何添加wenquanyi字体等等,还有库的裁减都没有具体实现,不过完成后我会继 续写出来,与大家分享!另外,很多地方我懒得注释,因为很多知识都是交叉编译的基础只是,请读者自己理解!这也是一个学习的过程。