Archive for the Nokia Category

Bluetooth internet connection using mobile phone under Ubuntu 8.10

Posted in Asus N10Jc, bluetooth, internet, intrepid, linux, Nokia, ubuntu on January 26, 2009 by rvshiro

Hardware use :
1. Asus N10Jc (BT-ready)
2. Nokia E66 (3G mobile phone with BT-ready)
3. A valid 3G-enable GSM simcard (Indonesia Telkomsel Flash)

The idea is not so new as I believe anyone has known about it already ….  So, now I’d like to have an internet connection using Nokia E66 via Bluetooth connection under Ubuntu 8.10 on N10Jc.

Before we do the next step, make sure the following parts are already install / ready i.e.:
1. Bluetooth program ($ sudo apt-get install bluetooth bluez)
2. wvdial ($ sudo apt-get install wvdial)
3. A valid 3G / GPRS connection account from your mobile operator

As you know, BT applet has been installed automatically the 1st time you install Ubuntu on Asus N10Jc. So there’s no need to talk about installing this BT applet and I assume, your Asus BT has been running properly ….
If you’re not sure, you can open the terminal (xterm) and write :

$ lsusb

the result will look like this :

Bus 004 Device 002: ID 0b05:1712 ASUSTek Computer, Inc. BT-183 Bluetooth 2.0+EDR adapter

Meaning you BT is running properly.

Next is to activated the phone’s  bluetooth that will be used, in this case is Nokia E66. Just press / choose the following keys on Nokia E66 :

Menu -> Connectivity -> Bluetooth -> On

After all BT turn on, please do the following :

$ sudo hcitool scan

Note the mac address and device name.

Next is to make a backup copy of your rfcomm.conf, by typing :

$ sudo cp /etc/bluetooth/rfcomm.conf /etc/bluetooth/rfcomm-ori

Then type

$ sudo gedit ./bt-conn.sh

Copy – paste the following script and save it

#!/bin/sh

echo “Setting up Bluetooth Connection ” # Scan MAC Address
mac=`hcitool scan | grep device-name | awk ‘{print $1}’`
echo “Mac Address : $mac ”

# Scan channel DUN
channel=`sdptool search DUN | grep “Channel:” | awk ‘{print $2}’`
echo “Channel : $channel ”

# Edit RFCOMM
echo “Editing /etc/bluetooth/rfcomm.conf ”
rm /etc/bluetooth/rfcomm.conf
echo “rfcomm0 {” >> /etc/bluetooth/rfcomm.conf
echo “bind yes;” >> /etc/bluetooth/rfcomm.conf
echo “device ${mac};” >> /etc/bluetooth/rfcomm.conf
echo “channel ${channel};” >> /etc/bluetooth/rfcomm.conf
echo “}” >> /etc/bluetooth/rfcomm.conf

# Binding rfcomm to device
echo “Bind rfcomm0 to device $mac on channel $channel ”
rfcomm release 0
rfcomm bind 0 $mac $channel

# Dial up using wvdial
echo “Open up ppp for bluetooth ”
wvdial

You should replace the “device name” above with the result from “sudo hcitool scan” (in this case, my device name is E66) .
Make sure it’s executable by changing the permission as follow :

$ sudo chmod +x ./bt-conn.sh

We also need to modified wvdial.conf.

$ sudo gedit /etc/wvdial.conf

Then just copy – paste the below setting :

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,”IP”,”internet
Modem = /dev/rfcomm0
Phone = *99#
Modem Type = Analog Modem
Stupid Mode = 0
Baud = 460800
Auto DNS = 1
Dial Command = ATDT
Ask Password = 0
ISDN = 0
Username = “xxxx
Password = “xxxx

Make sure you input, appropriately, the bold parts above for the wvdial.conf.
1. APN name
2. Phone number
3. Your user name given by your mobile operator
4. Your password given by your mobile operator

Now, it’s finished…

To execute / connect it just type in terminal :

./bt-conn.sh

The Nokia E66 will prompt you, whether to connect or not, answer ‘Yes’. And it will execute the script.

To stop the connection, just press Ctrl-C.

Happy browsing ….

nb. you might try with other notebooks and mobile phones. There’s chance that you can use this script. If not, it’s just unlucky and you’re on your own.

script resource : http://imansyah.wordpress.com/

Advertisements