GPRS over a Bluetooth connected phone with Debian 3.1 (Sarge)

 My system is a Dell inspiron portable running Debian Sarge. It has a USB Bluetooth Dongle. This text describes how to connect to the internet using a Nokia 6310 using Proximus GPRS:

Installed Debian packages:

Install some packages needed for bleutooth (I donot know if this list is complete:
ii  bluez-firmware 1.0-2          Firmware for Bluetooth devices
ii bluez-pin 0.25-1 Bluetooth PIN helper with D-BUS support
ii bluez-utils 2.15-1.1 Bluetooth tools and daemons
...
ii libiw27 27-2 Wireless tools - library
...

Proximus GPRS

Check out the proximus website to active GPRS for your number.

Insert USB dongle

I am using Debian Kernel 2.6.8-686-smp-03102004. Inserting the dongle will load a number of kernel modules:
Module                  Size  Used by
hci_usb 15200 2
nvidia 3924828 10
rfcomm 41240 3
l2cap 28032 5 rfcomm
bluetooth 52420 7 hci_usb,rfcomm,l2cap
...
ehci_hcd 33156 0
usbhid 32736 0
uhci_hcd 34096 0
usbcore 122148 6 hci_usb,ehci_hcd,usbhid,uhci_hcd

Scan for bluetooth devices

Scan for local devices:
flater:/home/jean# hcitool dev
Devices:
hci0 00:30:C2:08:1C:D2
flater:/home/jean#
This is only a test, you should see tour computers id.
Now scan for external devices:
later:/home/jean# hcitool scan
Scanning ...
00:60:57:E4:D7:28 Jean's 6310
flater:/home/jean#
You should now see external bleutooth devices (in my case my nokia phone). You will need its Hex address later on.

Connect to GPRS

Set up bluetooth connection

later:/home/jean# rfcomm  connect 0 00:60:57:E4:D7:28
Can't connect RFCOMM socket: Host is down
flater:/home/jean# rfcomm connect 1 00:60:57:E4:D7:28
Connected /dev/rfcomm1 to 00:60:57:E4:D7:28 on channel 1
Press CTRL-C for hangup

I do not know why sometines the connections over channel 0 succeeds and sometimes you need to try following channels...

Setting up the connections may take some time, be patient.
Depending on the settings of your phone you may need to accept the connection on the phone or not.

After the "connected" message you  have to switch to another shell and setup ppp over the just created bluetooth connection, identified by /dev/rfcomm1 (in this example):


Set up ppp connection over /dev/rfcomm1

PPP file setup

My ppp setup contains following files :

/etc/ppp/peers/proximus-gprs1

/dev/rfcomm1 115200
115200
local
nocrtscts
connect "/usr/sbin/chat -v -f /etc/chatscripts/proximus-gprs"
noauth
defaultroute
usepeerdns
novj
remotename proximus
debug
#user
lcp-restart 5

/etc/chatscripts/proximus-gprs

ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
"" ATZ
OK AT+CGDCONT=1,"IP","internet.proximus.be"
OK ATDT*99#
CONNECT ""

I also have a /etc/ppp/peers/proximus-gprs0 file which uses /dev/rfcomm0, and so on...

Start ppp

Unless your  ppp scripts take care of existing default routes, you should make sure to clear default routes before calling pon
flater:/etc/ppp/peers# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.113.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
flater:/etc/ppp/peers# pon proximus-gprs1

Network configuration

flater:/etc/ppp/peers# ifconfig -a

....
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:29 errors:0 dropped:0 overruns:0 frame:0
TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1710 (1.6 KiB) TX bytes:1710 (1.6 KiB)

ppp0 Link encap:Point-to-Point Protocol
inet addr:81.169.70.195 P-t-P:10.6.6.6 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:181 (181.0 b) TX bytes:121 (121.0 b)

...
flater:/etc/ppp/peers# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.6.6.6 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.113.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 10.6.6.6 0.0.0.0 UG 0 0 0 ppp0
flater:/etc/ppp/peers# ping www.belnet.be
PING loba.belnet.be (193.190.198.53) 56(84) bytes of data.
64 bytes from loba.belnet.be (193.190.198.53): icmp_seq=1 ttl=55 time=793 ms
64 bytes from loba.belnet.be (193.190.198.53): icmp_seq=2 ttl=55 time=603 ms
64 bytes from loba.belnet.be (193.190.198.53): icmp_seq=3 ttl=55 time=634 ms
...


Ending the connection

First stop the ppp connection:
flater:/etc/ppp/peers# ping www.belnet.be
PING loba.belnet.be (193.190.198.53) 56(84) bytes of data.
64 bytes from loba.belnet.be (193.190.198.53): icmp_seq=1 ttl=55 time=793 ms
64 bytes from loba.belnet.be (193.190.198.53): icmp_seq=2 ttl=55 time=603 ms
64 bytes from loba.belnet.be (193.190.198.53): icmp_seq=3 ttl=55 time=634 ms

--- loba.belnet.be ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2922ms
rtt min/avg/max/mdev = 603.804/677.285/793.836/83.348 ms
flater:/etc/ppp/peers# poff
flater:/etc/ppp/peers#

Then stop the bluetooth connection:
Connected /dev/rfcomm1 to 00:60:57:E4:D7:28 on channel 1
Press CTRL-C for hangup
Disconnected
flater:/home/jean#

Conclusion

It  works , although not every step in the setup is 100 % clear to me.

Jean Huens