Monday, March 30, 2009

Blackberry as a modem with Grameenphone Mobile

To Connect Blackberry USB Modem in your linux machine is now pretty simple with the third party software distribution Barry. Mine is Fedora Core 10 (FC10) but it would work for any Debian System as well. Here's the steps how I did this.

This tutorial is for Grameen Phone Providers, Bangladesh. Other services like rogers, O2 have been automatically configured once you install the software Barry.

Step 1: Initiating Directories as a Preparation
cd /usr/local/src
mkdir blackberry
cd /blackberry
Step 2: Download Barry Distribution by git
If your system is a workstion or desktop configured, then get the following packages
git clone git://repo.or.cz/barry.git barry
git clone git://repo.or.cz/barry.git libbarry0
(above line is required in most configurations)

If your system is a development configured then get this as well along with previous twos.
git clone git://repo.or.cz/barry.git libbarry-devel
Step 3: Configuring and Installing barry/libbarry0
Go inside directory:
cd /barry
Build the source:
./buildgen.sh
Configure:
./configure
Make the install file:
make
Install the make file:
make install

Step 4: Configuring peers script
Go to ppp dir: cd /etc/ppp/peers
Create a file: touch gp
Edit the file: vim gp

Insert following lines and then save:
##################################
debug debug debug
nodetach

pty "/usr/sbin/pppob"
connect "/usr/sbin/chat -f /etc/chatscripts/gp.chat"
user "gp"
password "gp"

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

##################################

Notes:
"pty" command is used to connect pppob tool by barry to connect your Blackberry Modem. Here it will be directed to the location where it has been installed
"Connect" command has been used to run a chatscript, which will be written after a while here. The chatscript file will require to pass parameters to Grameen Phone's PPP server.

Step 5: Configuring chatscripts
Go to the location:
vim /etc/chatscripts/

Create a chatscript File:
touch gp.chat [naming gp.chat is important according to the tutorial]

Insert lines below and then save:
###############
ABORT ERROR
'' AT&F
OK ATZ
OK ATI
OK AT+CGDCONT=1,"IP","gpinternet"
OK ATDT*99***1#
CONNECT
################


Step 6: Before you run the ppp scripts:
This step is to ensure whether these scripts can run smoothly. Here's a TO DO list before run.
TO DO 1: Inactive your current internet
TO DO 2: If you are in a LAN, then disable your LAN Card before you want to run the scripts.

Step 7: Running Scripts
Type this in your Shell Prompt:
pppd call gp
After Running this, you would see something like following:
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 <--> /dev/pts/4
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x19 ]
sent [LCP ConfAck id=0x19 ]
rcvd [LCP ConfRej id=0x1 ]
sent [LCP ConfReq id=0x2 ]
rcvd [LCP ConfAck id=0x2 ]
rcvd [CHAP Challenge id=0x7 <00>, name = ""]
sent [CHAP Response id=0x7 <6cca03043ecea893752b4767db33835f>, name = "gp"]
rcvd [CHAP Success id=0x7 ""]
CHAP authentication succeeded
CHAP authentication succeeded
sent [CCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
rcvd [LCP ProtRej id=0x1a 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [IPCP ConfReq id=0x1b ]
sent [IPCP ConfAck id=0x1b ]
rcvd [IPCP ConfNak id=0x1 ]
sent [IPCP ConfReq id=0x2 ]
rcvd [IPCP ConfAck id=0x2 ]
local IP address 10.65.24.13
remote IP address 169.254.1.1
primary DNS address 202.56.4.120
secondary DNS address 202.56.4.121
Script /etc/ppp/ip-up started (pid 3700)
Script /etc/ppp/ip-up finished (pid 3700), status = 0x0

TO DO: let this shell window alone and be run

Note: See the lines above in bold. Primary DNS and Secondary DNS, keep these two IPs it will require in next to complete the process.

Final Step: Configuring resolve.conf
Edit the file:
vim /etc/resove.conf
Now, comment any lines by using ';' (semicolon)
Set nameservers:
nameserver 202.56.4.120
nameserver 202.56.4.121

Now save and quit

That's All...
Enjoy..

7 comments:

  1. Owao, its a great tutorial, I can connect Internet using my BB. Thanks. But the step 5 does not make sense as I am not a Grameenphone subscriber, I am rogers.

    thanks again.

    ReplyDelete
  2. BlackBerry Connect on my mobile (Sony Ericsson G900) couldn't run :( do you know?

    ReplyDelete
  3. HI I WANT TO OPERATE MY EMAIL ACCOUNT VIA MOBILE PHONE BUT PROBLEM IS ALWAYS IT SHOWS DNS ERROR I HAVE USED 202.56.4.120 AND 202.56.4.120 AS PRIMARY AND SECONDARY DNS BUT SORRY TO SAY IT DOESN'T WORK.

    ReplyDelete
  4. @Mehedi, please tell me your mobile's model and version. However, this is to let you know that this post is for a mobile device (blackberry) to be used on a computer as modem to access internet. Many thanks for visiting this post though I would like to help.

    Thanks

    ReplyDelete
  5. i was able to follow upto step 6. but in step 7, it says "could not determine local ip address". but PAP authentication was successful.. i have a blackberry 9000 and operator is airtel from india.. i used "airtelgprs.com" instead of "gpinternet"

    ReplyDelete
  6. i m in india using airtel with blackberry 9000. i get the error "could not determine local ip address".. could someone please help...

    ReplyDelete