Linux GPRS/EDGE via Bluetooth HOWTO

In this guide I will show you howto configure internet access through GPRS/EDGE, using bluetooth connection with your GSM phone.

I am using gentoo and Nokia 6310i phone, but this will work with any distribution and any bluetooth capable phone.

Requirements

The software needed for this to work :

The hardware I am using is IBM ThinkPad T43 with Broadcom BT and Nokia 6310i.

Kernel configuration

The most important thing is to have your hardware recognized, so let's step to kernel configuration. For proper bt/gprs you should have followig options compiled in:

CONFIG_BT=y 
CONFIG_BT_L2CAP=m 
CONFIG_BT_SCO=m
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=m
## Bluetooth device drivers
CONFIG_BT_HCIUSB=m
CONFIG_BT_HCIUSB_SCO=y
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIBCM203X=m
CONFIG_BT_HCIBPA10X=m
CONFIG_BT_HCIBFUSB=m
CONFIG_BT_HCIDTL1=m
CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
## PPP
CONFIG_PPP=y
CONFIG_PPP_ASYNC=y
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPP_MPPE=m

Bluez utils configuration

On gentoo all bluetooth configuration files are placed in /etc/bluetooth/, on your system it can be elsewhere

The most important file is rfcomm.conf and hcid.conf. We will edit them in a moment, because first we have to know the bluetooth address of the phone/pda we will be using

Start the blutooth system:

/etc/init.d/hcid start or /etc/init.d/bluetooth start

Issue scan command (rememeber to start bluetooth on your device too):

hcitool scan

this gives something similar to that on my machine:

Scanning ... 00:15:2A:2E:E1:97       Nokia 6230i 

Now, when we know the bluetooth address of the phone, we can start editing the config files.

hcid.conf

options  options {
autoinit yes;
security auto;
pairing multi;
pin_helper /etc/bluetooth/pin-helper;
}
laptop device {
name "t43 (%d)";
class 0x3e0100;
iscan enable;
pscan enable;
lm accept;
lp rswitch,hold,sniff,park;
}

Remember to check if the /etc/bluetooth/pin-helper exists and put there PIN which you want. On my system - pin-helper is a bash script:

#!/bin/sh
echo -n "PIN:" cat /etc/bluetooth/pin

.. and the /etc/bluetooth/pin has just 1234 example pin inside.

The rfcomm.conf is as follows

  
rfcomm0 {
         bind yes;
device 00:15:2a:2e:e1:97;
channel 1;
comment "Nokia";
}

PPP ocnfiguration

After having your bluetooth system configured, it is about time to configure the PPP to connect to internet through the phone, using bluetooth as a carrier

The configuration I use is suitable for my provider, which is Plus GSM. In your case, the files will be the same, only the details may change.

First we have to create a file, which we will use for the connection. I created a file called "plus":

vim /etc/ppp/peers/plus

The file is as follows:

/dev/rfcomm0 115200
connect '/usr/sbin/chat -v -f /etc/ppp/chat-gprs'
crtscts
modem -detach
noccp
defaultroute
usepeerdns
noauth
ipcp-accept-remote
ipcp-accept-local
noipdefault

As you can see, there is a second file, called chat-gprs, which needs to be created. It controls the way we communicate with the modem

/etc/ppp/chat-gprs

'' ATZ OK 
AT+CGDCONT=1,"IP","www.plusgsm.pl"
OK "ATD*99***1#"
CONNECT ''

The contents of this file is what you need to change if you do not have Plus GSM provider. Additionally if your provider uses login/password authentication, you should place proper data to /etc/ppp/chap-secrets or /etc/ppp/pap-secrets

Connecting to the internet

Now, as we have everything configured, we can at last connect to the internet. All we need to issue is:

pppd call plus

... and have fun while open-air browsing

Remember to check if you have your bluetooth switched on in the phone and laptop.

Additional software

Besides raw internet access, I am also using kbluetoothd daemon to browse my phone resources with konqueror. If you are a KDE user, I recommend this way to be very comfortable.

Share this page:

6 Comment(s)