Sunday, July 27, 2008

Internet in linux via mobile - Bluetooth

**********
EDIT: For 10.04 onwards, the procedure is simple.

open Bluetooth preference from panel or System>Preference>Bluetooth
Setup new device (follow the instructions).

at the end of setup, check the box "Use phone as Bluetooth DUN modem"
to connect use network manager in notification area of panel (connection name used during Bluetooth DUN modem setup would be there, click on it to connect).
**********
Old procedure:
Details: https://help.ubuntu.com/community/BluetoothDialup

here is the steps which actually worked on aitel gprs:-

1.Make your phone Bluetooth discoverable.
Run the following at a shell prompt:

Code:
$ hcitool scan
Copy the MAC address (the text with the capital letters, numbers, and ':'s) somewhere convenient. You'll need it many times. in my case it was 00:1B:AF:F7:8A:74

2.Pairing : Pairing would be done later, when try to dial the connection

3.Get the channel number for your phone's dialup service by running the following, replacing your-phone-mac-address with the proper data

Code:
$ sdptool browse 00:1B:AF:F7:8A:74
* Look under "Service Name: Dial-up Networking"
* Under "Protocol Descriptor List:" and "RFCOMM", there should be a number after "Channel:"
* Remember that number; you'll need it for the rfcomm configuration, in my case it was 1

4.Edit file /etc/bluetooth/rfcomm.conf

Code:
$ gksudo gedit /etc/bluetooth/rfcomm.conf
* Paste the following into the file, replacing your-phone-mac-address and your-phone-rfcomm-channel with appropriate values
Code:
rfcomm0 {
bind yes;
device 00:1B:AF:F7:8A:74;
channel 1;
comment "Bluetooth PPP connection";
}
* Save and close the rfcomm.conf file

5. Restart bluetooth services. This will create the rfcomm0 device (and rfcomm1, rfcomm2 if configured)

Code:
$ sudo /etc/init.d/bluez-utils restart
Edit: if it gives error, use following command
Code:
$ sudo rfcomm bind 0 00:1B:AF:F7:8A:74 1

6. Create a peers file for the connection

Code:
$ gksudo gedit /etc/ppp/peers/BluetoothDialup
* Paste the following into the file (the file should start out blank)
Code:
debug
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/BluetoothDialup"
usepeerdns
/dev/rfcomm0 115200
defaultroute
crtscts
lcp-echo-failure 0
* Save and close the BluetoothDialup file

7. Create a chatscript for the connection

Code:
$ gksudo gedit /etc/chatscripts/BluetoothDialup
* Paste the following into the file (the file should start out blank).
Code:
TIMEOUT 35
ECHO ON
ABORT '\nBUSY\r'
ABORT '\nERROR\r'
ABORT '\nNO ANSWER\r'
ABORT '\nNO CARRIER\r'
ABORT '\nNO DIALTONE\r'
ABORT '\nRINGING\r\n\r\nRINGING\r'
'' \rAT
OK 'AT+CGDCONT=1,"IP","airtelgprs.com"'
OK ATD*99***1#
CONNECT ""
The above shown access point is for airtel, for other operators use access point as provided by your operator. like for BSNL north the chatscript sholud be

TIMEOUT 35
ECHO ON
ABORT '\nBUSY\r'
ABORT '\nERROR\r'
ABORT '\nNO ANSWER\r'
ABORT '\nNO CARRIER\r'
ABORT '\nNO DIALTONE\r'
ABORT '\nRINGING\r\n\r\nRINGING\r'
'' \rAT
OK 'AT+CGDCONT=1,"IP","gprsnorth.cellone.in"'
OK ATD*99***1#
CONNECT ""

* Save and close the BluetoothDialup file

8. Dialing permission

* Add the user who wants dialing permission to the 'dialout' group

Code:
$ sudo adduser your-username-here dialout
Edit: if above does not work use follwing command
$ sudo adduser your-username-here dip

You can also do this from GUI, System->Administration->Users & Groups. Check for user permissions and make sure that Allow to use modem checkbox is checked.

9. Logout and relogin to your account or restart computer

10. using the connection in subsequent connections

* Start the connection using pon command

Code:
$ pon BluetoothDialup
PIN would be asked by phone, enter any PIN say 1234. Now, computer will ask for PIN, Enter the same PIN in computer.

* End the connection using poff command

Code:
$ poff BluetoothDialup
* After pon you can verify if the connection has started using plog command
Code:
$ plog BluetoothDialup

No comments: