Vodafone 3G PCMCIA card under GNU/Linux      2005.09.27 @ 2:08:35 PM
I've been using Vodafone's 3G service for a few weeks and I thought I'd drop a line here. It's a great service, not only for the download speed (about 45kbps) but also for the low latency. I can work on an SSH session without noticing it's not a wired connection.

The installation is fairly easy on most distributions, as the card is automatically recognized and no additional software is required. However, I faced a bit of a hazzle since I didn't have USB OHCI support enabled in my kernel.

Note also that USB to Serial must be enabled as well. In my particular case, I seem to have a newer version of the card and therefore it isn't automatically recognized. However, I can specify the vendor information when loading the module manually:

modprobe usbserial vendor=0xaf0 product=0x6300


When I plug the card in, this is what I get in my /var/log/messages:

Sep 26 23:14:29 localhost kernel: drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic
Sep 26 23:14:29 localhost kernel: usbserial_generic 7-1:1.0: Generic converter detected
Sep 26 23:14:29 localhost kernel: usb 7-1: Generic converter now attached to ttyUSB0
Sep 26 23:14:29 localhost kernel: usbserial_generic 7-1:1.1: Generic converter detected
Sep 26 23:14:29 localhost kernel: usb 7-1: Generic converter now attached to ttyUSB1
Sep 26 23:14:29 localhost kernel: usbserial_generic 7-1:1.2: Generic converter detected
Sep 26 23:14:29 localhost kernel: usb 7-1: Generic converter now attached to ttyUSB2
Sep 26 23:14:29 localhost kernel: usbcore: registered new driver usbserial_generic
Sep 26 23:14:29 localhost kernel: usbcore: registered new driver usbserial
Sep 26 23:14:29 localhost kernel: drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0


This means the modem is available at /dev/ttyUSB0. At this point you should be able to issue AT commands to the modem with a terminal application, such as minicom.

Next, we need to configure the ppp dialer. PPP support comes pre-installed in most distributions, but in case it isn't it can be installed (in Debian systems) with:

apt-get install pppconfig, ppp, wvdial


You can configure ppp using the pppconfig script, or you can place these three files under /etc/ppp/peers:

v3g
lcp-echo-failure 0
lcp-echo-interval 0
nodetach
debug
show-password
connect "/usr/bin/wvdial --chat --config /etc/ppp/peers/v3g-wvdial.conf vodafone"
disconnect /etc/ppp/peers/v3g-disconnect-chat
/dev/ttyUSB0 # USB serial device, for example Orange SPV
115200 # fast enough
crtscts
local
:212.73.32.10
noipdefault
ipcp-accept-local
defaultroute
usepeerdns
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
noauth
user "user"


v3g-wvdial.conf
[Dialer vodafone]
Init1 = ATZ
Init2 = AT+CGDCONT=1,"IP","airtelnet.es","",0,0
Dial Command = ATD
Phone = *99#
Username = vodafone
Password = vodafone


You are supposed to enter your PIN during the initialization string, but I'm too lazy. I simply started the SIM card in my regular phone and disabled the PIN request : ) 

v3g-connect-chat
exec chat \
TIMEOUT 5 \
ECHO ON \
ABORT '\nBUSY\r' \
OK '\nERROR\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nNO CARRIER\r' \
ABORT '\nNO DIALTONE\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' \rAT \
TIMEOUT 12 \
SAY "Press CTRL-C to close the connection at any stage!" \
SAY "\ndefining PDP context...\n" \
OK ATH \
OK ATE1 \
OK 'AT+CGDCONT=1,"IP","internet","",0,0' \
OK ATD*99# \
TIMEOUT 5 \
SAY "\nwaiting for connect...\n" \
CONNECT "" \
SAY "\nConnected." \
SAY "\nIf the following ppp negotiations fail,\n" \
SAY "try restarting the phone.\n"


v3g-disconnect-chat
#!/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" \
"" "+++ATH" \
"" "+++ATH" \
"" "+++ATH" \
SAY "\nPDP context detached\n"


The connection then can be established by issuing the following command:
pppd call v3g


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