How-to: Internet connection with cellular phone
In the present mini how-to I'm reporting how I connected my laptop to
internet using first a Motorola c350 mobile phone (gprs)
and a then a Nokia 6630 (gprs, edge and umts).
In both cases, the phone is connected to the PC with a usb cable,
that comes with the Nokia, whereas for the Motorola you have to buy
it aside.
The operating system is GNU/Linux Debian Sarge 3.1, but the procedure
should work also with all other Linux distributions.
The report might contain errors and unexactnesses.
The connection starts from Italy, with the server Vodafone or TIM.
With slight modifications the procedure should work also with different
servers and from countries different from Italy.
The present mini howto was made possible thank to the help of
many people over the net: I'll avoid reporting web sites and
people's names.
*****
1.
*****
The first part of the procedure is the same for both the phones.
Switch on the phone, wait for a while (say one minute),
connect it to the PC with its proper usb cable and do:
$ dmesg | fgrep acm
. With the kernel 2.4 the output should be the following:
usb.c: registered new driver acm
acm.c: v0.21:USB Abstract Control Model driver for USB modems and ISDN adapters
, and with the kernel 2.6 the following:
drivers/usb/class/cdc-acm.c: Ignoring extra header
cdc_acm 1-2:1.8: ttyACM0: USB ACM device
usbcore: registered new driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters
drivers/usb/class/cdc-acm.c: Ignoring extra header
cdc_acm 1-2:1.8: ttyACM0: USB ACM device
drivers/usb/class/cdc-acm.c: Ignoring extra header
cdc_acm 1-2:1.8: ttyACM0: USB ACM device
. If you get no output, do:
# modprobe acm
with the kernel 2.4, and:
# modprobe cdc-acm
with the kernel 2.6, and then try again with '$ dmesg | fgrep acm'.
Now do:
$ ls -l /dev/ttyACM0
. The output should be something like:
crw-rw---- 1 root dialout 166, 0 2005-02-26 07:43 ttyACM0
. The important things are: the 'c' of 'crw-rw-r--'
and the numbers '166, 0'.
If the file exists, but one of those conditions is not satisfied,
remove it and recreate it with:
# mknod /dev/ttyACM0 c 166 0
. If the file doesn't exist, simply create it as above.
*****
2.
*****
The second part of the procedure is slightly different
from phone to phone.
Make sure the package 'ppp' is installed on your machine; then,
-------------
Motorola c350
-------------
Create the file '/etc/chatscripts/phone' and,
if your server is Vodafone, fill it with:
ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
ABORT DELAYED
'' ATZ
OK-AT-OK AT+CGDCONT=1,"IP","web.omnitel.it"
OK-AT-OK AT+CGQREQ=1,2,4,3,6,31
OK-AT-OK AT+CGQMIN=1,2,4,3,6,31
OK-AT-OK AT+CGATT=1 OK-AT-OK ATD*99#
CONNECT ''
; instead, if your server is TIM
replace "web.omnitel.it" with "ibox.tim.it".
Create the file '/etc/ppp/resolv/phone' and fill it with:
nameserver 194.185.97.134
. Create the file '/etc/ppp/peers/phone' and fill it with:
hide-password
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/phone"
debug
-crtscts
/dev/ttyACM0
57600
defaultroute
noipdefault
remotename phone
ipparam phone
usepeerdns
. At the end of each file leave a blank line.
----------
Nokia 6630
----------
First of all, configure the phone:
Tools > Settings > Connection > Packet data
Packet data conn.: 'When needed' with Vodafone,
'When available' with TIM.
Access point: 'web.omnitel.it' with Vodafone,
'ibox.tim.it' with TIM.
Create the file '/etc/chatscripts/phone' and,
if your server is Vodafone, fill it with:
# various failure codes
ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
ABORT DELAYED
# Attempt to interrupt a left-over call and get the modem's attention.
"" '\d\d+++\d\dATH'
# We may now have zero or more "OKs" waiting for us. Send the factory
# reset command, then send an additional dummy command, and assume
# that the factory defaults include echo-on.
"" AT&F
OK ATS0=0
S0=0-ATS0=0-S0=0 '\c'
# Now we are back in sync and can send our commands. Note that the
# last expect string INTENTIONALLY has "\c" as the send string, so
# that we won't send a stray CR at the end of chat.
OK AT+CGDCONT=1,"IP","web.omnitel.it"
OK AT+CGATT=1
OK ATD*99#
CONNECT '\c'
; instead, if your server is TIM
replace in the above file "web.omnitel.it" with "ibox.tim.it".
Create the file '/etc/ppp/resolv/phone' and fill it with:
nameserver 194.185.97.134
. Create the file '/etc/chatscripts/phone_disconnect'
and fill it with:
#!/bin/sh
exec /usr/sbin/chat -V -s -S \
ABORT "BUSY" \
ABORT "ERROR" \
ABORT "NO DIALTONE" \
SAY "\nSending break to the modem\n" \
"" "\K" \
"" "\K" \
"" "\K" \
"" '\d\d+++\d\dATH' \
"" '\d\d+++\d\dATH' \
"" '\d\d+++\d\dATH' \
SAY "\nPDP context detached\n"
. Those be tabs not spaces between the two parts on each line.
Create the file '/etc/ppp/peers/phone' and fill it with:
hide-password
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/phone"
disconnect "/etc/chatscripts/phone_disconnect"
debug
-crtscts
/dev/ttyACM0
defaultroute
noipdefault
remotename phone
ipparam phone
usepeerdns
. At the end of each file leave a blank line.
*****
3.
*****
The last part of the procedure is the same for the two phones:
do:
# cp /etc/syslog.conf /etc/syslog.conf-original
. At the end of '/etc/syslog.conf' add the following lines:
local2.* /var/log/ppp
daemon.* /var/log/ppp
. Those be tabs not spaces between the two parts on each line.
Do:
# killall -1 syslogd
. Now start the connection: on a console do:
$ tail -f /var/log/ppp
and on another console do:
# pon phone
. On the first console you will read how the connection is proceeding.
To close the connection, on the seond console do:
# poff phone
. If you're not using Debian, the commands 'pon' and 'poff' might not work:
in place of 'pon' you can then use 'pppd call', whereas in place of 'poff'
I don't know,sorry! You can close the connection from the phone:
with the Nokia 6630, do:
Menu > Connectivity > Conn. manager > Disconnect.
. Happy connection!
Reply to: