Monthly Archives: April 2008

Connecting to the Internet using phone’s GPRS modem from a Debian machine

Here in Bhutan, we are at the moment enjoying free GPRS connection ( Free test-trial till 5th May, 2008 ) thanks to B-Mobile. I have a four year old Nokia Ngage-QD and got myself registered for the free GPRS. I installed the 45-days trail version of Netfront as my browser, Slick for IM and Profimail for e-mail. With its small screen and keypad, my phone is not an ideal device to experience the internet. Hence, I made a google search on how to use a GPRS connection as a modem. I have some experience regarding this from my college days where I used the Rs. 99/month GPRS connection from Hutch. But this time I wanted to connect from my laptop running Debian.

My set-up:

  • GPRS from B-mobile

  • Nokia N-Gage QD with, Access point configured to use the GPRS connection

  • My Debian Laptop with Gnome Desktop, inbuilt bluetooth and the ppp package installed

Configuring bluetooth on laptop

  • Install the packages bluetooth, bluez-utils and gnone-bluetooth

  • Run ‘hcitool dev’ to get the address of the bluetooth device on the laptop in the form of ‘xx:xx:xx:xx:xx’. Run ‘hcitool scan’ after turning on the bluetooth on your phone. This will give you the bluetooth address of your phone. Now bond the phone to the computer using the Gnome Bluetooth Manager. I also set my laptop as “Authorised” in my phone’s bluetooth setting.

  • Run ‘sdptool browse <phone-bluetooth-address>’ to see which channel on the phone is being used for Dial-up Networking. The sdptool command will give a long output. We have look out for a block of output beginning with “Service Name: Dial-up Networking” see which channel this service uses. On my phone, it is channel 1.

  • Set up a RFCOMM device. We can use /dev/rfcomm0 as the device to connect the phone as a modem. Edit the /etc/bluetooth/rfcomm.conf as shown below to ensure /dev/rfcomm0 connects to channel 1 (in my case) of the phone.

rfcomm0 {
                bind yes ;
                device <Bluetooth-device-address> ;
                channel 3 ;
                comment "Dial-up Networking Service -- for PPP" ;
            }
  • Run ‘/etc/init.d/bluetooth restart’ to restart the bluetooth sub-system.

  • Set up the PPP (point-to-point) sub-system. Here we have to creat a peer specification file in /etc/ppp/peers. I created the file /etc/ppp/peers/rlw-ngage-qd-bluetooth-modem with the following content:

hide-password
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/rlw-ngage-qd"
debug
/dev/rfcomm0
460800
defaultroute
noipdefault
remotename rlw-ngage-qd
ipparam rlw-ngage-qd
usepeerdns
lcp-echo-interval 0
  • Now create the chat script mentioned in the above peer specification file in line no. 3. Create the file /etc/chatscripts/rlw-ngage-qd with the content below:

# This chatfile was generated by pppconfig 2.3.10.
# Please do not delete any of the comments.  Pppconfig needs them.
#
# ispauth chat
# abortstring
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
# modeminit
'' ATZ
# ispnumber
OK-AT-OK "ATDT*99***1#"
# ispconnect
CONNECT ''
# prelogin

# ispname
#login: xxxxxx
# isppassword
#password: yyyyyy
# postlogin
'' \d\c
# end of pppconfig stuff
  • Since the login details is handled by the setting in the phone, there is no need to specify login name and passord. The most inportant piece of information in the above file is the no. “*99***1#” which is used by the gprs modem to dial for Internet access. On a windows system, to connect to the internet using gprs modem, we create a dial-up connection using the bluetooth Network setting and then use the no “*99***1#” to dial.

  • Now to connect to internet run ‘pon rlw-ngage-qd-bluetooth-modem’ and run ‘poff’ to disconnect.

I have consulted many online docs to get my connection working. This documentation is a collection of settings and configurations that worked for me. With a little or no change, I hope this documentation will be helpful to its readers. Once again, Thanks to all the great docs out there on the Internet.

P.s: Am using my GPRS modem to post this article.