Here is a quick guide on how to get a GPRS connection using bluetooth. In my case I'm using a Sharp 902 provided by Vodafone, but this guide would work with any other phone / carrier. If you are looking to use a USB cable instead of bluetooth, check out my other guide here:

First of all, we have to compile Bluetooth support in the kernel (in case it is not already done). In case you are not familiar with your Kernel, there are step-by-step instructions on downloading and installing it in this article:

Do a make menuconfig and select under Device Drivers ---> Networking support --->

<M> Bluetooth subsystem support --->

then enter and select:

<M> L2CAP protocol support
<M> SCO links support
<M> RFCOMM protocol support
[*] RFCOMM TTY support
<M> BNEP protocol support
[ ] Multicast filter support
[*] Protocol filter support
<M> HIDP protocol support

Then enter Bluetooth device drivers --->

<M> HCI USB driver
[ ] SCO (voice) support
< > HCI UART driver
<M> HCI BCM203x USB driver
<M> HCI BlueFRITZ! USB driver
< > HCI DTL1 (PC Card) driver
< > HCI BT3C (PC Card) driver
< > HCI BlueCard (PC Card) driver
< > HCI UART (PC Card) device driver
< > HCI VHCI (Virtual HCI device) driver

That is what I need in my case. It won't hurt to select them all in case you are not sure what kind of Bluetooth adapter do you have.

Last, make sure "PPP (point-to-point protocol) support" is enabled under Device Drivers ---> Networking support

Compile and install your kernel and restart your PC. After plugging in your bluetooth adapter, this is what the kernel says (look at /var/log/messages or /var/log/syslog):

Mar 16 00:23:34 localhost kernel: usb 2-1: new full speed USB device using address 4
Mar 16 00:23:34 localhost hcid[1624]: HCI dev 0 registered
Mar 16 00:23:34 localhost hcid[1624]: HCI dev 0 up
Mar 16 00:23:34 localhost hcid[1624]: Starting security manager 0

If you have the usbutils package installed (and Device Drivers / USB Support / USB device filesystem enabled in your kernel), you can also use the command lsusb, which shows in my case:

Bus 002 Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle

That would take care of getting the Bluetooth adapter working. Now comes the other part, which is getting the Bluetooth adapter to connect to your cellphone.

All you need is the bluez-utils, which can be installed (in any Debian distro) with:

apt-get install bluez-utils

Now you need to find your phone's bluetooth address. Make sure bluetooth is enabled in your phone (look up in your phone settings) and then, look it up with hcitool as follows:

# hcitool scan
Scanning ...
08:00:11:23:45:67 Julian

In this case, lets say, my address is 08:00:11:23:45:67. With this information you can now establish a serial connection with your phone by issuing the following command:

rfcomm bind Julian 08:00:11:23:45:67

Of course you have to replace your device name and address with the right information. If no errors were given, your serial connection to the phone is established. Your phone will be reachable at /dev/rfcomm0

Now the last step is to establish a PPP connection over that serial link. In order to do that, you need to get some software in place:

apt-get install wvdial ppp

Now, a couple of files must be created in /etc/ppp/peers. This information is only valid for Vodaphone users. Your carrier will be happy to provide you with all the info you need. Just don't tell them you are using linux ; ) 

[Dialer vodafone]
Init1 = ATH
Init2 = ATE1
Init3 = AT+CGDCONT=1,"IP","","",0,0
Dial Command = ATD
Phone = *99***1#
Username = vodafone
Password = vodafone

lcp-echo-failure 0
lcp-echo-interval 0
connect "/usr/bin/wvdial --chat --config /etc/ppp/peers/gprs-wvdial.conf vodafone"
disconnect /etc/ppp/peers/gprs-disconnect-chat
115200 # fast enough
crtscts # serial cable, Bluetooth and USB, on some occations with IrDA too
user "user"

Now you can connect by issuing the following command:

pppd call gprs

To which it replies:

--> WvDial: Internet dialer version 1.54.0
--> Initializing modem.
--> Sending: ATH
--> Sending: ATE1
--> Sending: AT+CGDCONT=1,"IP","","",0,0
--> Modem initialized.
--> Sending: ATD*99***1#
--> Waiting for carrier.
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> Carrier detected. Waiting for prompt.
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> PPP negotiation detected.
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 < --> /dev/rfcomm0

If you want to do it right, you can create a nice icon that would do this for you with a simple click. To disconnect, simply unplug the bluetooth adapter.

Feel free to email me if you have any questions.

Update: Make sure you have your /etc/ppp/peers/gprs-disconnect-chat and /etc/ppp/peers/gprs-connect-chat scripts in place (you should already have a couple sample scripts there)

All knowledge and software published in this website is released under the GNU General Public License (GPL)