GPRS connection with a Nokia 7610 phone      2005.01.04 @ 12:19:02 AM

I was sitting at some airport a few months ago (I can't remember which one) waiting for my next flight. I had some time to kill and decided to boot up my laptop and look for a hotspot (or something like that). It turns out there was no wi-fi devices whatsoever within reach, so I grabbed my shiny Nokia 7610 phone and went online via GPRS.

While staring at the tiny screen I remembered that a few days earlier, when I opened the nokia box I found a white USB cable along with the phone and manuals. I tossed the cable in my backpack and thought "This will keep me busy in the next rainy day or airport wait". Indeed I was right.
Nokia 7610

I plugged in the cable and realized my kernel didn't know what to do with it. Immediately I recompiled it adding support for all "USB to Serial" adapters and USB Modem support, hoping Nokia would use a standard interface rather than reinventing the wheel like most people tend to do lately. Well, fortunately they didn't this time as it is a regular CDCACM interface (Communication Device Class Abstract Control Model interface).

I would guess USB Modem support is precompiled with most linux distros, but in case it isn't, it is called "USB Modem (CDC ACM) support" and is located under "Device Drivers ---> USB support" in your kernel tree. If you are compiling your kernel, make sure "PPP (point-to-point protocol) support" is enabled under "Device Drivers ---> Networking support"

In case you are not familiar with your Kernel, there are step-by-step instructions on downloading and installing it in this article:

http://julian.coccia.com/article-68.html

With the USB Modem support enabled, this is what the kernel says when plugging the phone in:

Jan 3 23:08:47 localhost kernel: usb 3-1: new full speed USB device using address 3
Jan 3 23:08:47 localhost kernel: cdc_acm 3-1:1.5: ttyACM0: USB ACM device


Which means the phone is treated as a regular asynchronous serial modem, located in /dev/ttyACM0

All I needed to get online was to configure my pppd daemon. I tried with wvdial, as it was installed on my machine. Of course pppd is also needed. Both packages can be easily installed on any Debian-based distro with:

apt-get install wvdial ppp


Now, a couple of files must be created in /etc/ppp/peers:

gprs-wvdial.conf
[Dialer movistar]
Init1 = ATH
Init2 = ATE1
Init3 = AT+CGDCONT=1,"IP","movistar.es","",0,0
#Init3 = AT+CGDCONT=1,"IP","internet","0.0.0.0",0,0
Dial Command = ATD
Phone = *99#
Username = movistar
Password = movistar


gprs
lcp-echo-failure 0
lcp-echo-interval 0
nodetach
debug
show-password
connect "/usr/bin/wvdial --chat --config /etc/ppp/peers/gprs-wvdial.conf movistar"
disconnect /etc/ppp/peers/gprs-disconnect-chat
/dev/ttyACM0 # USB serial device, for example Orange SPV
115200 # fast enough
crtscts # serial cable, Bluetooth and USB, on some occations with IrDA too
local
:10.0.0.1
noipdefault
ipcp-accept-local
defaultroute
usepeerdns
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
noauth
user "user"


I'm showing the configuration required for Telefonica Movistar. You can get the required GPRS parameters from your provider, or by simply asking Google.

Now you can connect by issuing the following command:

pppd call gprs


To which it replies:

--> WvDial: Internet dialer version 1.54.0
--> Initializing modem.
--> Sending: ATH
ATH
OK
--> Sending: ATE1
ATE1
OK
--> Sending: AT+CGDCONT=1,"IP","movistar.es","",0,0
AT+CGDCONT=1,"IP","movistar.es","",0,0
OK
--> Modem initialized.
--> Sending: ATD*99#
--> Waiting for carrier.
ATD*99#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> Carrier detected. Waiting for prompt.
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> PPP negotiation detected.
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 < --> /dev/ttyACM0


If you want to do it right, you can create a nice icon that would do this for you with a simple click. To disconnect, simply unplug the cable.

Connecting to the internet via GPRS really sucks, but it is much much better than nothing. The best downstream you will ever see is 7Kb/sec. I have tried with a 3G phone and I managed to download data at 35Kb/s which is much better, but there are still two main problems:

1- Latency sucks.
2- GPRS pricing sucks even more.

I hope this helps someone.
Julian


All knowledge and software published in this website is released under the GNU General Public License (GPL)