HOWTO: Connecting to Internet thru GPRS using bluetooth connection to mobile phone (on Slackware 9.1)
* Linux (Slackware 9.1) on IBM X31 (2672-CEG) * Dependencies * Connecting to phone and entering pin * Configuring WVdial and connecting to Internet I read a lot of docus in Internet before finding the best way to connect to Internet over GPRS thru my Bluetooth adapter. I saw a lot of ppp configurations, "games" with options and chat file etc. I tried all these solutions and all worked for me. But I think, that the best way is to use WVdial for establishing connection, because it is easy to use and configure and you don't have to care about ppp options. You can find all the usefull links at the end of this article. *** DEPENDENCIES *** ^ - Bluetooth adapter for your computer (built in IBM X31) - Mobile phone with bluetooth support (I have Siemens S55) - Bluez (Bluetooth tools - many distros has it out of the box) - WVdial (I use it because it is simpler for use than pppd) - Hotplug daemon ((almost) all distros has it out of the box) - Kernel support for Bluetooth 1. My laptop IBM X31 (see the link above) has built-in bluetooth adapter. If you don't have it, you can buy some of the USB-Bluetooth sticks. Check for Linux support before buying it. 2. I have Siemens S55 mobile phone with built in bluetooth support. Great phone. 3. Download all Bluetooth tools (BLUEZ) from http://bluez.sourceforge.net/. Install all the tools with ./configure (--prefix=/usr for Slackware), make && make install. 4. Download WVdial from target="_blank" href="http://open.nit.ca/wiki/index.php?page=WvDial">http://open.nit.ca/wiki/index.php?page=WvDial. Install it with ./configure (--prefix=/usr for Slackware), make && make install and you will find wvdial.conf in /etc. 5. hotplug daemon (for Slackware find it in /etc/rc.d/rc.hotplug) 6. Compile your kernel with Bluetooth support. I use hci_usb module for my bluetooth adapter. *** CONNECTING TO PHONE AND ENTERING PIN *** ^ Now you have to configure BLUEZ to be able to find your phone. Load all modules like: - usbcore, uhci_hcd, ehci_hcd, ohci_hcd - bluetooth, rfcomm, hci_usb, bnep, l2cap Most of these modules should be automaticaly loaded (if you have autoload support) if you have hotplugging daemon running. Turn on bluetooth on your mobile phone and computer and run "hcitool scan" to find all available gprs devices. This looks like this:root@bombona:/# hcitool scan Scanning ... 00:01:E3:00:00:00 BabyBonbon ## MAC changed root@bombona:/#As you can see, I have found my mobile phone. This MAC will be used for connecting. With "hciconfig" you can see you bluetooth device (on computer):root@bombona:/# hciconfig hci0: Type: USB BD Address: 00:20:E0:00:00:00 ACL MTU: 192:8 SCO MTU: 64:8 ## MAC changed UP RUNNING PSCAN ISCAN RX bytes:49184 acl:2267 sco:0 events:674 errors:0 TX bytes:29628 acl:574 sco:0 commands:85 errors:0 root@bombona:/#If it is "DOWN", you can turn it on by using "hciconfig hci0 up". Before two bluetooth devices can communicate with each other, you need to pair them. That means that you have to type in "PIN" conde to let them communicate later without problems. Bind your mobile phone bluetooth device:rfcomm bind 0 00:01:E3:00:00:00 1If you don't have /dev/rfcomm0, make it with:mknod /dev/rfcomm0 c 216 0After that, you can pair the devicese. Just run "cat /dev/rfcomm0". After that you your phone will aks you to enter pin. Type in whatever you like. Now modify your bluetooth configuration: 1. Modify your/etc/bluetooth/rfcomm.conf to look like this:rfcomm0 { bind no; device 00:01:E3:00:00:00; ## mobile phone mac channel 1; comment "BabyBonbon"; }You can find in /etc/bluetooth/hcid.conf a path to pin_helper:# HCId options options { ... # PIN helper pin_helper /etc/bluetooth/bluepin; }/etc/bluetooth/bluepin:#!/bin/bash echo "PIN:00" ## 00 is the PIN you typed in*** CONFIGURING WVDIAL AND CONNECTING TO INTERNET*** ^ As I said before, after a lot of testing, I decided to use WVdial instead fo configuring ppp. I let wvdial do it for me. Open /etc/wvdial.conf and modify it. I made a new connection called GPRS. Enter username and password you got from you provider. My provider is tele.ring.at from Austria. Init1 contains the string specific for tele.ring. I found it somewhere on Siemens page. "^sgauth=1;+CGQREQ=1,3,4,3,1,31". Your provider my also has something similar.## BT->S55 GPRS Connection [Dialer GPRS] Modem=/dev/rfcomm0 Init1 = AT+CGDCONT=1,"IP","web";^sgauth=1;+CGQREQ=1,3,4,3,1,31 Phone = *99***1# Dial command = ATD #Stupid mode = 0 Auto Reconnect = off Username = web@telering.at Password = webAfter that, I made a small perl script which will do all of this automaticaly.#!/usr/bin/perl -w use strict; ## your mobile phone MAC my $MAC = '00:01:E3:00:00:00'; ############################## my $check; my $rmmod = '/sbin/rmmod'; my $hciconfig = '/usr/sbin/hciconfig'; my $rfcomm = '/usr/bin/rfcomm'; my $hcid = '/usr/sbin/hcid -f /etc/bluetooth/hcid.conf'; my $pppd = '/usr/sbin/pppd'; my $killall = '/bin/killall'; print "Starting hotplug serveice: /etc/rc.d/rc.hotplug start\n"; $check = `/etc/rc.d/rc.hotplug start &`; print "Turn on your bluetooth device and press Enter\n"; <>; print "Starting hci0: $hciconfig hci0 up\n"; $check = `$hciconfig hci0 up`; print $check; print "Releasing device hci0 ($MAC): $rfcomm release $MAC\n"; $check = `$rfcomm release $MAC`; print $check; print "Binding device hci0 ($MAC): $rfcomm bind 0 $MAC 1\n"; $check = `$rfcomm bind 0 $MAC 1`; print $check; print "Starting HCI daemon: $hcid\n"; $check = `$killall hcid; $hcid`; print $check; print "Running wvdial: /usr/bin/wvdial GPRS\n"; $check = `/usr/bin/wvdial GPRS`;That's it. When you run this script you should connect to your GPRS provider and if you run "ifconfig -a", you should see your ppp0 connection.
Copyright 2003-2004, Mirza Muharemagic