HOWTO: Use your Nokia N95 Cellphone as a Bluetooth modem for Linux

Did you know that you can use your data-enabled N95 to get a thethered Internet connection from Linux? The access mode and speed will depend on your actual coberture, and as usual YMMV, but I’ve been using this setup for a few months and it works fine.

$ sudo -s
# apt-get install bluetooth bluez-pin bluez-utils kdebluetooth wvdial

Now in user mode use KBlueMon to find out the Bluetooth address of your device and write it down.
Then go ahead and initiate an OBEX file transfer to make sure that you can actually link to your phone and to establish a trust relationship. In your phone add the Laptop to your trusted device list, so it won’t nag you whenever you establish a link.
Now edit /etc/bluetooth/rfcomm.conf :

rfcomm0 {
bind yes;
device 00:21:09:XX:XX:XX;
channel 2;
}

Replace your own device address after “device”.
Now edit /etc/wvdial to add these two entries:

[Dialer pin-vodafone]
Modem = /dev/rfcomm0
Baud = 460800
Init1 =AT+Cpin=XXXX

[Dialer vodafone]
Phone = *99***1#
Username = vodafone
Password = vodafone
Stupid Mode = 1
Dial Command = ATDT
Check Def Route = on
Dial Attempts = 3
Modem = /dev/rfcomm0
Baud = 460800
Init2 = ATZ
Init3 = ATQ0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
Init4 = AT+CGDCONT=1,"IP","ac.vodafone.es"
ISDN = 0
Modem Type = Analog Modem

You can give them any name you want. I have defined several providers, to avoid confusions and to use the provider at hand. Replace the “XXXX” in Init1 with your SIM’s PIN.
Now to use them restart the Bluetooth subsystem:

# /etc/init.d/bluetooth restart

And use wvdial to dial out:

# wvdial vodafone-pin
# wvdial vodafone

You should get an Internet link, complete with an IP, a default route and a couple of DNS servers. If it doesn’t, reboot your phone liberally.
Please note that this might get expensive quite quickly unless you get a data plan from your provider. Go ahead and make their day.
Enjoy!

6 thoughts on “HOWTO: Use your Nokia N95 Cellphone as a Bluetooth modem for Linux”

  1. You have made a little typo; the first init string must be ATZ+CPIN=”xxxx” where xxxx is the PIN code.

    Regards, Miguel Angel.

    Bonus: If you want to use this configuration with Vodafone in Spain, you must change “ac.vodafone.es” for “airtelnet.es”

  2. I’ve got a –> Bad init string error message:

    wsjunior@wsjunior-laptop:~$ sudo wvdial vivo
    –> WvDial: Internet dialer version 1.60
    –> Cannot get information for serial port.
    –> Initializing modem.
    –> Sending: ATZ
    ATZ
    OK
    –> Sending: ATZ
    ATZ
    OK
    –> Sending: ATQ0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
    ATQ0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
    OK
    –> Sending: AT+CGDCONT=1,??IP??,??zap.vivo.com.br??
    ERROR
    –> Bad init string.

    What could be wrong here?

  3. I cannot get wvdial to see my modem. I get the following.

    [root@localhost andrew]# wvdial vodafone
    –> WvDial: Internet dialer version 1.60
    –> Warning: section [Dialer vodafone] does not exist in wvdial.conf.
    –> Cannot open /dev/modem: No such file or directory
    –> Cannot open /dev/modem: No such file or directory
    –> Cannot open /dev/modem: No such file or directory

    I edited the files as stated and although I am with O2 in Germany I thought I would leave your text as is to see what happened before trying to make changes.

    It seems that the modem file is missing and having searched my system I find a file called modem.conf but looking through it I cannot see anything relevant.

    What file should I be looking for in /dev/modem?

    I can browse my phone via bluetooth and have done hciscan to determine the mac address and rfcomm channel..

    I am working on Mandriva 2009.

  4. Hello, thanks for the howto. I have a Nokia E51 and Debian Lenny. I am trying to configre it but I have a error.

    These are my steps:

    1. Configure bluetooth:

    # rfcomm
    rfcomm0: 00:1D:6E:xx:xx:xx channel 4 clean

    (on E51 the “Dial-Up Networking” service comes in channel 4)

    2. I write to my 3G service provider and they send connections information:

    – No need user or pass.
    – APN: internetmas
    – Telephone number: *99#
    – initial command: +CGDCONT=1,?IP??,?internetmas??

    3. So I configure /etc/wvdial.conf this way:

    [Dialer Defaults]
    Phone = *99#
    Password =
    Username =
    Stupid Mode = 1
    Dial Command = ATDT
    New PPPD = yes
    Remote Name = “*”

    [Dialer Nokia]
    Modem = /dev/rfcomm0
    Baud = 460800
    Init1 = ATZ
    Init2 = ATQ0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
    Init3 = +CGDCONT=1;??IP??;??internetmas??;
    ISDN = 0
    Modem Type = Analog Modem

    4. This is my modem permisions:

    # ls -l /dev/ | grep rfcomm0
    crw-rw—- 1 root dialout 216, 0 2009-08-08 15:14 rfcomm0

    And this my connection error:

    # wvdial Nokia
    –> WvDial: Internet dialer version 1.60
    –> Cannot get information for serial port.
    –> Initializing modem.
    –> Sending: ATZ
    ATZ
    OK
    –> Sending: ATQ0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
    ATQ0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
    OK
    –> Sending: +CGDCONT=1;??IP??;??internetmas??;
    –> Sending: ATQ0
    OK
    –> Re-Sending: +CGDCONT=1;??IP??;??internetmas??;
    –> Modem not responding.

    I don’t know which is the problem. Can someone help?

    Thanks for all and best regards.

Comments are closed.