Nokia E71 modem on CentOS Linux

Submitted by dag on Tue, 2009/07/07 - 18:54

I often use my cellphone to connect my laptop to the Internet on the train or when I am in the car, not driving. Fabian was interested in the details and since I promised him this almost a year ago, without further ado...

So here is an overview of how I configure my Nokia E71 to be used as a modem (over bluetooth) with my laptop. First make sure you have bluez-utils installed by running either apt-get install bluez-utils or yum install bluez-install

Then check if you can find your cellphone by doing:
[root@moria ~]# hcitool scan
Scanning ...
00:21:CA:FE:BA:BE Dag

Then create the following file using the above address.

rfcomm0 {
bind yes;
device 00:21:ca:fe:ba:be;
channel 2;
comment "Nokia E71 Dag";

Then restart your bluetooth service by doing: service bluetooth restart

To configure wvdial to set up the PPP connection, I created two entries, one for bluetooth (nokia-bt) and one for my USB cable (nokia-usb).

Baud = 3600000
Dial Command = ATDT
Init2 = AT &F E0 V1 &D2 &S0 &C1 S0=0 +CGDCONT=1,"IP","","",0,0
Phone = *99***1#
Username = proximus
Password = proximus
Stupid Mode = 1
Auto DNS = 1
New PPPD = yes

[Dialer nokia-usb]
Inherits = nokia
Modem = /dev/ttyACM0
Modem Type = USB Modem

[Dialer nokia-bt]
Inherits = nokia
Modem = /dev/rfcomm0
Modem Type = Analog Modem

Then, to get the PPP infrastructure to automatically modify your /etc/resolv.conf so that DNS is properly working, you may want to add this file manually too:


if [ "$DNS1" -o "$DNS2" ]; then
echo "### File created by /etc/ppp/ip-up.local on $(date)" >/etc/resolv.conf

for NAMESERVER in $DNS1 $DNS2; do
logger -t gprs "Configuring nameserver $NAMESERVER in /etc/resolv.conf"
echo "nameserver $NAMESERVER" >>/etc/resolv.conf

Then if you want to set up the connection, all you have to do is call the correct profile from the commandline:

[root@moria ~]# wvdial nokia-bt
--> WvDial: Internet dialer version 1.54.0
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
--> Sending: AT &F E0 V1 &D2 &S0 &C1 S0=0 +CGDCONT=1,"IP","","",0,0
AT &F E0 V1 &D2 &S0 &C1 S0=0 +CGDCONT=1,"IP","","",0,0
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Tue Jul 7 19:33:21 2009
--> pid of pppd: 9231
--> pppd: 1
--> Using interface ppp0
--> pppd: 1
--> pppd: 1
--> pppd: 1
--> local IP address
--> pppd: 1
--> remote IP address
--> pppd: 1
--> primary DNS address
--> pppd: 1
--> secondary DNS address
--> pppd: 1

Now, if you have a bad connection (like when on a train) and you want to monitor your connection, you might want to do like I do, by running mtr and then pressing d once. (I use my nameserver for testing)

This allows you to see what ICMP packets you are lacking and how fast they do come through. It's a life-saver when your connection goes bad and you simply want to see how long it's been gone to determine if it is officially dead or it deserves some more time.

PS: With the recent backport of NetworkManager 0.7 to CentOS 5.3, NetworkManager lost the functionality to call PPP/wvdial connection scripts. That is really unfortunate because starting/stopping your connection from NetworkManager has some additional benefits as it broadcasts events using dbus, which wvdial does not do.

PS2: Fabian noticed that his DNS was not automatically updated, which reminded me I fixed that too. So I updated my original article, sorry for that.

Better use joikuspot

You should think about using JoikuSpot. This eliminates the 2MBit bluetooth bootleneck and you can use full HSDPA speed on your notebook. And also it's much easier to configure.



And flattens your battery 3

And flattens your battery 3 times faster? No thank you.

Besides, we don't have HSDPA coverage anywhere except in the center of major cities. So I'll stick with bluetooth. I would be very happy if I even get 2Mbit from inside a train or car.

good point

That's a good point :)

HSDPA coverage is very good here in germany since the football world championship. A few weeks ago I had a downstream bandwith of 12MBit over it. It's realy fantastic ...


Can't you just use pand with your phone?

pand --connect CELLPHONE -E

Then use the bnep0 device like you would use your ethernet device.