Bluetooth internet connection using mobile phone under Ubuntu 8.10

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/

One Response to “Bluetooth internet connection using mobile phone under Ubuntu 8.10”

  1. hi……….i’m follow this process but no success………..please see this &help me

    pratap@pratap-laptop:~$ sudo apt-get install bluetooth bluez
    [sudo] password for pratap:
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    bluetooth is already the newest version.
    bluez is already the newest version.
    The following packages were automatically installed and are no longer required:
    libloudmouth1-0
    Use ‘apt-get autoremove’ to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 273 not upgraded.
    pratap@pratap-laptop:~$ sudo apt-get install wvdial
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    The following packages were automatically installed and are no longer required:
    libloudmouth1-0
    Use ‘apt-get autoremove’ to remove them.
    The following extra packages will be installed:
    libuniconf4.4 libwvstreams4.4-base libwvstreams4.4-extras libxplc0.3.13
    The following NEW packages will be installed:
    libuniconf4.4 libwvstreams4.4-base libwvstreams4.4-extras libxplc0.3.13
    wvdial
    0 upgraded, 5 newly installed, 0 to remove and 273 not upgraded.
    Need to get 1099kB of archives.
    After this operation, 2814kB of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    Get:1 http://in.archive.ubuntu.com jaunty/main libxplc0.3.13 0.3.13-1build1 [39.0kB]
    Get:2 http://in.archive.ubuntu.com jaunty/main libwvstreams4.4-base 4.4.1-0.2ubuntu2 [412kB]
    Get:3 http://in.archive.ubuntu.com jaunty/main libwvstreams4.4-extras 4.4.1-0.2ubuntu2 [406kB]
    Get:4 http://in.archive.ubuntu.com jaunty/main libuniconf4.4 4.4.1-0.2ubuntu2 [137kB]
    Get:5 http://in.archive.ubuntu.com jaunty/main wvdial 1.60.1+nmu2 [106kB]
    Fetched 1099kB in 1min 12s (15.2kB/s)
    Preconfiguring packages …
    Selecting previously deselected package libxplc0.3.13.
    (Reading database …
    dpkg: serious warning: files list file for package `oss-linux’ missing, assuming package has no files currently installed.
    419377 files and directories currently installed.)
    Unpacking libxplc0.3.13 (from …/libxplc0.3.13_0.3.13-1build1_i386.deb) …
    Selecting previously deselected package libwvstreams4.4-base.
    Unpacking libwvstreams4.4-base (from …/libwvstreams4.4-base_4.4.1-0.2ubuntu2_i386.deb) …
    Selecting previously deselected package libwvstreams4.4-extras.
    Unpacking libwvstreams4.4-extras (from …/libwvstreams4.4-extras_4.4.1-0.2ubuntu2_i386.deb) …
    Selecting previously deselected package libuniconf4.4.
    Unpacking libuniconf4.4 (from …/libuniconf4.4_4.4.1-0.2ubuntu2_i386.deb) …
    Selecting previously deselected package wvdial.
    Unpacking wvdial (from …/wvdial_1.60.1+nmu2_i386.deb) …
    Processing triggers for man-db …
    Setting up libxplc0.3.13 (0.3.13-1build1) …

    Setting up libwvstreams4.4-base (4.4.1-0.2ubuntu2) …

    Setting up libwvstreams4.4-extras (4.4.1-0.2ubuntu2) …

    Setting up libuniconf4.4 (4.4.1-0.2ubuntu2) …

    Setting up wvdial (1.60.1+nmu2) …

    Sorry. You can retry the autodetection at any time by running “wvdialconf”.
    (Or you can create /etc/wvdial.conf yourself.)

    Processing triggers for libc6 …
    ldconfig deferred processing now taking place
    pratap@pratap-laptop:~$ $ lsusb
    bash: $: command not found
    pratap@pratap-laptop:~$ lsusb
    Bus 002 Device 013: ID 0421:0154 Nokia Mobile Phones
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 003: ID 0c45:6407 Microdia
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 005: ID 413c:8160 Dell Computer Corp.
    Bus 004 Device 004: ID 413c:8162 Dell Computer Corp.
    Bus 004 Device 003: ID 413c:8161 Dell Computer Corp.
    Bus 004 Device 002: ID 0a5c:4500 Broadcom Corp.
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    pratap@pratap-laptop:~$ sudo hcitool scan
    Scanning …
    EC:9B:5B:AF:13:26 Nokia 5800 XpressMusic
    pratap@pratap-laptop:~$ udo cp /etc/bluetooth/rfcomm.conf /etc/bluetooth/rfcomm-ori
    The program ‘udo’ is currently not installed. You can install it by typing:
    sudo apt-get install udo
    bash: udo: command not found
    pratap@pratap-laptop:~$ sudo cp /etc/bluetooth/rfcomm.conf /etc/bluetooth/rfcomm-ori
    pratap@pratap-laptop:~$ sudo gedit ./bt-conn.sh
    pratap@pratap-laptop:~$ sudo chmod +x ./bt-conn.sh
    pratap@pratap-laptop:~$ sudo gedit /etc/wvdial.conf
    pratap@pratap-laptop:~$ ./bt-conn.sh
    “Setting up Bluetooth Connection ”
    grep: 5800: No such file or directory
    grep: XpressMusic: No such file or directory
    awk: ‘{print
    awk: ^ invalid char ‘�’ in expression
    “Mac Address : “
    awk: ‘{print
    awk: ^ invalid char ‘�’ in expression
    “Channel : “
    “Editing /etc/bluetooth/rfcomm.conf “
    rm: remove write-protected regular file `/etc/bluetooth/rfcomm.conf’? N
    ./bt-conn.sh: line 14: /etc/bluetooth/rfcomm.conf: Permission denied
    “bind yes
    ./bt-conn.sh: line 15: /etc/bluetooth/rfcomm.conf: Permission denied
    “device
    ./bt-conn.sh: line 16: /etc/bluetooth/rfcomm.conf: Permission denied
    “channel
    ./bt-conn.sh: line 17: /etc/bluetooth/rfcomm.conf: Permission denied
    ./bt-conn.sh: line 18: /etc/bluetooth/rfcomm.conf: Permission denied
    “Bind rfcomm0 to device on channel “
    Can’t release device: No such device
    Can’t find a config entry for rfcomm0
    “Open up ppp for bluetooth “
    –> WvDial: Internet dialer version 1.60
    –> Cannot open /dev/rfcomm0: No such file or directory
    –> Cannot open /dev/rfcomm0: No such file or directory
    –> Cannot open /dev/rfcomm0: No such file or directory
    pratap@pratap-laptop:~$ ./bt-conn.sh
    “Setting up Bluetooth Connection ”
    grep: 5800: No such file or directory
    grep: XpressMusic: No such file or directory
    awk: ‘{print
    awk: ^ invalid char ‘�’ in expression
    “Mac Address : “
    awk: ‘{print
    awk: ^ invalid char ‘�’ in expression
    “Channel : “
    “Editing /etc/bluetooth/rfcomm.conf “
    rm: remove write-protected regular file `/etc/bluetooth/rfcomm.conf’? Y
    rm: cannot remove `/etc/bluetooth/rfcomm.conf’: Permission denied
    ./bt-conn.sh: line 14: /etc/bluetooth/rfcomm.conf: Permission denied
    “bind yes
    ./bt-conn.sh: line 15: /etc/bluetooth/rfcomm.conf: Permission denied
    “device
    ./bt-conn.sh: line 16: /etc/bluetooth/rfcomm.conf: Permission denied
    “channel
    ./bt-conn.sh: line 17: /etc/bluetooth/rfcomm.conf: Permission denied
    ./bt-conn.sh: line 18: /etc/bluetooth/rfcomm.conf: Permission denied
    “Bind rfcomm0 to device on channel “
    Can’t release device: No such device
    Can’t find a config entry for rfcomm0
    “Open up ppp for bluetooth “
    –> WvDial: Internet dialer version 1.60
    –> Cannot open /dev/rfcomm0: No such file or directory
    –> Cannot open /dev/rfcomm0: No such file or directory
    –> Cannot open /dev/rfcomm0: No such file or directory
    pratap@pratap-laptop:~$
    pratap@pratap-laptop:~$ ./bt-conn.sh
    “Setting up Bluetooth Connection ”
    grep: 5800: No such file or directory
    grep: XpressMusic: No such file or directory
    awk: ‘{print
    awk: ^ invalid char ‘�’ in expression
    “Mac Address : “
    awk: ‘{print
    awk: ^ invalid char ‘�’ in expression
    “Channel : “
    “Editing /etc/bluetooth/rfcomm.conf “
    rm: remove write-protected regular file `/etc/bluetooth/rfcomm.conf’? Y
    rm: cannot remove `/etc/bluetooth/rfcomm.conf’: Permission denied
    ./bt-conn.sh: line 14: /etc/bluetooth/rfcomm.conf: Permission denied
    “bind yes
    ./bt-conn.sh: line 15: /etc/bluetooth/rfcomm.conf: Permission denied
    “device
    ./bt-conn.sh: line 16: /etc/bluetooth/rfcomm.conf: Permission denied
    “channel
    ./bt-conn.sh: line 17: /etc/bluetooth/rfcomm.conf: Permission denied
    ./bt-conn.sh: line 18: /etc/bluetooth/rfcomm.conf: Permission denied
    “Bind rfcomm0 to device on channel “
    Can’t release device: No such device
    Can’t find a config entry for rfcomm0
    “Open up ppp for bluetooth “
    –> WvDial: Internet dialer version 1.60
    –> Cannot open /dev/rfcomm0: No such file or directory
    –> Cannot open /dev/rfcomm0: No such file or directory
    –> Cannot open /dev/rfcomm0: No such file or directory

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: