How-to: Internet connection with cellular phone

Share your own howto's etc. Not for support questions!

How-to: Internet connection with cellular phone

Postby Rodolfo Medina » 2006-05-06 10:46

How-to: Internet connection with cellular phone

The present mini-howto is also reported at:

http://tuxmobil.org/phones_survey_motorola.html
http://tuxmobil.org/phones_survey_nokia.html

. 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 r2, 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 two minutes),
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/peers/phone' and fill it with:

hide-password
noauth
#connect "/usr/sbin/chat -e -f /etc/chatscripts/phone"
connect "/usr/sbin/chat -v -s -f /etc/chatscripts/phone"
debug
-crtscts
/dev/ttyACM0
57600
defaultroute
noipdefault
remotename phone
ipparam phone
usepeerdns
nodetach


. 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/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 -e -f /etc/chatscripts/phone"
connect "/usr/sbin/chat -v -s -f /etc/chatscripts/phone"
disconnect "/etc/chatscripts/phone_disconnect"
debug
-crtscts
/dev/ttyACM0
defaultroute
noipdefault
remotename phone
ipparam phone
usepeerdns
nodetach



. At the end of each file leave a blank line.




*****
3.
*****

The last part of the procedure is the same for the two phones:
if 'paul' is your username, do:

# adduser paul dip

, then reboot. Now you can connect with:

$ pon phone

, and disconnect with 'C-c' on the same terminal
or with `$ poff phone' on another terminal.
If the connection does not start after all, try rebooting.

. If you're not using Debian, the command 'pon' might not work:
in place of 'pon phone' do: 'pppd call phone', although there might be then
problems with the phone to restart connection: you might have to switch it
off and then on again before starting a new connection.

. Happy connection!
Rodolfo Medina
 
Posts: 22
Joined: 2006-05-06 10:39

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: makh and 8 guests

fashionable