Linux GPRS/EDGE via Bluetooth HOWTO

Want to support HowtoForge? Become a subscriber!
 
Submitted by tdi (Contact Author) (Forums) on Wed, 2006-08-23 13:31. :: Other

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.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Fri, 2009-11-13 16:18.

>echo -n "PIN:" cat /etc/bluetooth/pin

echo -n "PIN: " | cat - /etc/bluetooth/pin

Submitted by Manik (not registered) on Sun, 2008-12-28 11:32.
Though configurations were straightforward, I could not open the modem device rfcomm0. I searched but there were no solutions to be found. Finally I concluded that there is some problem with the bluetooth connection. Restarting bluetooth also did not help. Finally I had to change the name of my bluetooth device, which prompted fresh pairing and then everything were fine and this post is written on Konqueror on SuSe. --manik.
Submitted by Anonymous (not registered) on Wed, 2006-08-30 10:18.

You forgot to write how you discovered proper channel used in rfcomm0 configuration. Use the following command:

sdptool search DUN

 For ex. Nokia 9300 will give you channel 2.

Submitted by christo (registered user) on Sat, 2007-01-20 02:37.

This article on setting up bluetooth and gprs on ubuntu offers a very easy way to get connected through BT mobile with minimal configuration steps required.  I'm sure people will find that useful.

Submitted by Anonymous (not registered) on Wed, 2006-08-23 14:32.

There is another article using KPPP on this address...thanks

http://www.integrasoftware.it/index.php?option=com_content&task=view&id=84&Itemid=28 

Submitted by Anonymous (not registered) on Wed, 2006-08-23 15:56.
yes i could mention kppp too, but i wanted to be system independant as much as it is possible