Thursday, May 24, 2007

Ubuntu dialup via bluetooth

After using Feisty Fawn, Ubuntu v7.04 for close to a month now, Im happy to report that things are going extremly well. Latest task was to get my e61 to work with my computer so that I can dial up to the internet whenever I dont have access to a wifi spot or wired connectivity.

I have been using a CNet CBD-021 device for over a year now, and it has some nifty tools for Windows XP, with a nice UI "BlueSoleil" which displays connected and available bluetooth devices around the computer. It also provides point and clicky access to file transfers and dial up networking.

However in the Linux world, no such niceities are provided. We have to do things ourselves, unfortunately. So heres what I had to do to get Laptop -> Bluetooth dongle -> Nokia E61 -> Maxis internet connectivity going.

First step is to get bluetooth working. Plug the Bluetooth dongle into your machine. The dmesg should read something like this:
# dmesg
[ 9383.380000] usb 3-1: new full speed USB device using uhci_hcd and address 2
[ 9383.548000] usb 3-1: configuration #1 chosen from 1 choice
[ 9384.356000] Bluetooth: HCI USB driver ver 2.9


This wiki entry for Ubuntu is extremely useful: "Bluetooth Setup" Basically make sure that bluetooth tools are installed:
# apt-get install bluez-utils ppp
# hcitool scan
[Update: 080211 yky: bluez-pin is not required anymore ]

The output I get from this is: 00:12:D1:6C:8F:10 Yk's phone

I set the computer bluetooth key using the bluez-pin utility

I then paired up my phone with my laptop via the e61 interface. Menu / Connectivity / Bluetooth / Paired Devices, exchanging a numeric key to complete the step.

To make your phone a modem, you will need to define it as a rfcomm device. To do so;

# sdptool browse 00:12:D1:6C:8F:11

of which a whole list of services will be displayed. The one of importance is

Service Name: Dial-Up Networking
Service RecHandle: 0x10013
Service Class ID List:
"Dialup Networking" (0x1103)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100

Highlighted is the Channel number, and for my case, its #2. So edit the /etc/bluetooth/rfcomm.conf file

rfcomm0 {
bind yes;
device 00:12:D1:6C:8F:10;
channel 2;
comment "Yk's phone";
}

This means that everytime bluetooth is enabled and your phone is detected, a modem device will be created and accessible as /dev/rfcomm0

[Update: 080211 yky: You will now need to restart the bluetooth service with a /etc/init.d/bluetooth restart for the rfcomm0 device file to appear]

The next step is to configure wvdial. This blogpost has some information "pairing bluetooth modem di feisty fawn" Fortunately I can read Indonesian. To configure wvdial to dialup to maxis, the configuration for /etc/wvdial.conf is:


[Dialer Defaults]
Phone = *99#

Username = maxis

Password = wap

New PPPD = yes
Dial Command = ATDT
[Dialer E61]
Modem = /dev/rfcomm0
Baud = 460800

Dial Command = ATDT

Init2 = ATZ

Init3 = ATM0

Init4 = AT+CGDCONT=1,"IP","unet"

FlowControl = crtscts
Modem Type = Analog Modem


Note the Init4, username, password and phone number have been modified, as described in "Using a phone as a modem" from maxis themselves.

You should now be able to dial into maxis by typing:

# wvdial E61
--> WvDial: Internet dialer version 1.56
--> Cannot get information for serial port.

--> Initializing modem.

--> Sending: ATZ ATZ OK
--> Sending: ATM0
ATM0 OK
--> Sending: AT+CGDCONT=1,"IP","unet"
AT+CGDCONT=1,"IP","unet" OK
--> Modem initialized.

--> Sending: ATDT*99#

--> Waiting for carrier.
ATDT*99# CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> Carrier detected. Waiting for prompt.

~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> PPP negotiation detected.
--> Starting pppd at Thu May 24 16:37:43 2007

--> Pid of pppd: 30491
--> Using interface ppp0
--> local IP address 58.71.246.115

--> remote IP address 10.6.6.6
--> primary DNS address 10.213.17.1

--> secondary DNS address 10.213.17.2


Unplug your cables, shutdown your Wifi, check your route tables. Confirm to yourself that your internet access is being provided by your phone. Rejoice.


yk.

7 lewsers:

piju said...

are u sure u have the right wvdial.conf ?

Yoon Kit said...

yes its the right wvdial.conf. I just cat >> it into the /etc/wvdial.conf file and it worked without a hitch.

yk.

fenris said...

piju i think it already correct wvdial.conf ? is there anything wrong with the conf piju ?

Silent Thinker said...

hye yoon kit , thanks for posting this important way to connect to maxis 3g over nokia e61i . appreciate it..i'm a noob by the way but tryin to learn as much on how to perfect my linus knowledge day by day :) i'm stuck on how to pair the phone with the laptop . dongle in and i already restart bluetooth. U were saying u used bluez-pin utility ..how u do it ?i found the phone..but the phone didnt found my eepc ...

Webmaster said...

I have created a page givng step by step instructions:

http://www.attari.net/?My_space...:Ubuntu_HowTo:Internet_via_Bluetooth_mobile

I have given acknowledgements to this site. Thankyou.

Webmaster said...

I have created a page giving step by step instructions:

http://www.attari.net/?My_space...:Ubuntu_HowTo:Internet_via_Bluetooth_mobile

I have given acknowledgements to this site. Thankyou.

vishal said...

Easy Earning money in online never been this easy and transparent. You would find great tips on how to make that dream amount every Day. Sitting in the home earn around $100 per day. So go ahead and click here for more details and open floodgates to your online income. All the best.

Thanks.