2010年4月18日 星期日

Using BlackBarry Bold 9000 as 3G modem on Linux

Recently I got the BlackBerry Bold 9000 and it can work as 3G modem by using the BlackBerry Desktop Software. Since I used to work under the environment of Linux, I want to make it work on Linux.

In ubuntu 9.10, I do the following steps
$ sudo apt-get install pkg-config libusb-dev libssl-dev libboost-serialization-dev libtar-dev libgtkmm-2.4-dev libglibmm-2.4-dev libglademm-2.4-dev zlib1g-dev

And then download and install the "libbarry" and "barry-util" from Source Forge: http://sourceforge.net/projects/barry/files/

But it could not work.

After trial for awhile, I finally make it works from the recompiling and debug from the ppp package.

In the debugging, I found that it looks when using the IPCP to get the local IP adderss, BlackBerry cannot provide it immediately and pppd daemon polling for many times, so that ppp get the many NAK's from Barry. Finally it provides but the pppd complains and exit.

The quickfix to it is to increase the max number of IPCP NAK tolerance to reject the NAK's information. From the the ppp source tree:

vi pppd/ipcp.c

and the line:

f->maxnakloops = 100;

and change it to larger number, I use the 2000;

And it works well,

Also, my telecom company is Taiwan Mobile, attach the ppp script and chat for reference:
/etc/ppp/peers/barry-taiwan_mobile:

-------------
pty "/usr/sbin/pppob"
connect "/usr/sbin/chat -f /etc/chatscripts/barry-taiwan_mobile.chat"
#noauth
user ""
password ""

defaultroute
usepeerdns
noipdefault
nodetach
novj
nocrtscts
nomultilink
ipcp-restart 7
ipcp-accept-local
ipcp-accept-remote
lcp-echo-interval 0
lcp-echo-failure 999
mtu 1492
ipcp-max-configure 100
nopcomp
noaccomp
nomagic
--------------
/etc/chatscripts/barry-taiwan_mobile.chat:
------------
ABORT ERROR
OK ATZ
OK ATI
OK AT+CGDCONT=1,"IP","internet"
OK ATD*99#
CONNECT
------------
The workable command is:

pppd call barry-taiwan_mobile


-- Enjoy

佇 Linux 來看GPX 檔案

最近定定有戶外活動。使用𤆬路機 (GPS) 來記錄行過的路線。普通我記錄路線,攏是用手機仔抑是專門个𤆬路機,罕得用電腦來看。 毋過,"仙人拍鼓有時錯,跤步踏差啥人無"。有一擺我無細膩,袂記得共一擺活動的路線收煞起來,閣直接開始記錄下一擺的活動,按呢共幾落...