Vodafone 3G Datacard & SUSE 9.3 or Gentoo Linux
The following is a terse description of how to install a Vodafone
3G (UMTS and GPRS) or 3G Broadband (HSDPA) datacard on Suse 9.3 or Gentoo Linux.
This article has been re-published
at Wikinerds under the GFDL.
For information on how to send SMSs with this card, see Tom
Craig's Howto on sending SMSs.
Vodafone Supports Linux!
Incredibly, Vodafone are now linking to Linux drivers for their mobile broadband offerings! See Betavine (Vodafone R&D). This page may still be of use, but the most up-to-date information is likely to be on Betavine.
Drivers for 3G Broadband (HSDPA)
- This is remarkably painless! Just download Paul Hardwick's Nozomi drivers. Then...
tar -xzvf nozomi.tar.gz
make
mkdir /lib/modules/`uname -r`/kernel/drivers/pci/
(if it does not already exist)mkdir /lib/modules/`uname -r`/kernel/drivers/pci/hotplug/
(if it does not already exist)cp nozomi.ko /lib/modules/`uname -r`/kernel/drivers/pci/hotplug/
depmod
modprobe nozomi
- The only problem I had was that the drivers did not compile for the Gentoo 2.6.12-suspend-r6 (?) kernel. This appears to be because
nozomi.c
calls a function defined inworkqueue.c
of the kernel calledcreate_singlethread_workqueue()
. In the suspend-2 kernel it requires two arguments, whereas in the other Gentoo kernel we used, it does not. The solution is to edit the call innozomi.c
to becreate_singlethread_workqueue(NOZOMI_NAME,0)
(line 1576), which supplies zero flags to the function.
Drivers for 3G (UMTS/GPRS)
- Ensure that you have the Linux PCMCIA drivers installed, and that
they appear to be working (try
cardctl status
). - Plug in the 3G datacard. If you run
dmesg
you should find notifications of a USB hub being installed.tail -n 30 /var/log/messages
will also tell you similar helpful things, including what ports the hub has been assigned to. - The card has two lights, one blue light for UMTS (3G) connectivity, and a green one for GPRS connectivity. On insertion the lights both blink for a while, showing that the card is scanning for a network), and then they settle down to blinking about twice a second. Each indicates whether there is coverage of its respective network type. See Vodafone's 3G Card FAQ for details.
- If you now run
cardctl status
you should find that one of the sockets shows that has a card inserted. If it doesn't there is something wrong with your PCMCIA setup. - Execute
cat /proc/bus/usb/devices
to see what devices you have that are USB. One of them should be the Vodafone card. The first time I did this my machine locked up, but after restarting it was fine. - If the Vodafone card does not appear, check that you have USB OHCI
support compiled into your kernel. If you do, you should see lines in
/var/log/messages
detailing that OHCI has found a USB hub. - Under Suse: Edit
/etc/modprobe.conf.local
and add the lineoptions usbserial vendor=0xaf0 product=0x5000
.
Under Gentoo: Make a new file called/etc/modules.d/vodafone
and put the lineoptions usbserial vendor=0xaf0 product=0x5000
in it. Then runmodules-update
. Check that the insertion has been successful by usinggrep -i usbserial /etc/modprobe.conf
.
After a reboot (?) /var/log/messages should now inform you which USB ports the card is on. - If (by the end of this guide) pppd complains (in
/var/log/messages
- it's silent on the command line), that/dev/ttyUSB0
(or/dev/modem
) is not a valid serial device, you need to make sure that you have USB serial support compiled into the kernel. Trymodprobe usbserial
. If this fails, you need to compile that in (as a module is fine). If on insertion it complains that "vendor" is an unrecognised option to the module, you haven't compiled the module with the optional support for Generic serial devices. When I reached this point I also compiled in a load of other USB EHCI/OHCI related stuff, so if all else fails try compiling that in too, however, I suspect that the Generic serial device is the key here. - If you get an error in
dmesg
along the lines ofkobject_register failed for usbserial (-17)
, make certain that you have not only donemake; make modules_install
but alsomake install
for your kernel (to get it into/boot
where your bootloader expects it), as otherwise you will be attempting to insert modules that your kernel has not got support for, because the kernel you are booting is still the old one! - Check that the ports exist using
ls /dev/ttyUSB*
. Add them if they do not (see Paul Hardwick's page). - The card is likely to be on USB ports /dev/ttyUSB0, /dev/ttyUSB1,
and /dev/ttyUSB2. USB0 is used for actual data transfers, and USB2 for
things like network queries or SMS while a connection on USB0 can be
maintained. You may therefore want to alias /dev/modem to /dev/ttyUSB0
so that the standard dialup programmes work (
ln -sf /dev/ttyUSB0 /dev/modem
). Note that the script below assumes you are using/dev/modem
and you should modify it as appropriate. - At this point some other guides tell you to restart: I don't see why, but do so if things don't work!
Using the modem with pppd
- I couldn't get
wvdial
to work, (it complained that it couldn't get modem information from /dev/modem). I therefore fell back topppd
. See Carsten Clasohm's page for details ofwvdial
configuration under Fedora Core 3. - I set up the following files (the first is entirely from Paul
Hardwick's page). Bear in mind that the second file could be cut down significantly, and simply illustrates the available commands. We use the card for some research that involves measuring signal strengths, as well as occasionally obtaining network lists. You are unlikely to want this if you just want an Internet connection! You may find comgt useful for performing operations like setting the PIN.
/etc/ppp/peers/vodafone:
########################################### #Suggested Vodafone PPPD configuration file #File /etc/ppp/peers/vodafone ########################################### #Set this to the device allocated to the Datacard /dev/modem #Baudrate -- Note that setting this to 384000 yields an error message # about this speed not being supported! 460800 #Idle time for closing connection idle 7200 #Lock the device for this PPPD process use only lock #Use normal handshaking crtscts #Assume it is a modem device and force modem control methods modem #Any user can start the connection noauth #If a default route exists replace it with the ppp link #You get an error if this command is not supported #by your version of PPPD replacedefaultroute #Make the ppp link the default root defaultroute #Username and Password for computer/GlobeTrotter ppp link #Normally ignored. Change if GSM Operator requires it user Anyname password Anypassword #Change the path to chat if required for your version of Linux connect "/usr/sbin/chat -V -f /etc/ppp/vodafone-chat" #Accept IP address provided by network noipdefault #Detach PPPD from console used to run the program {optional} #updetach #Get DNS addresses from operator usepeerdns #Don't use VJ compression for ppp link novj ########################################### ###########################################
Note: A good explanation of ETSI AT commands may be useful.
########################################### # Suggested chat script called by PPPD # File: /etc/ppp/vodafone-chat # Heavily edited by David Cottingham # Many of these commands you will not need: they are for illustration # Comment them out as necessary. # david [=at=] cottinghams.com 21/06/2005 # See http://www.pharscape.org/index.php?option=content&task=view&id=29 ########################################### ABORT BUSY ABORT 'NO CARRIER' ABORT ERROR REPORT CONNECT TIMEOUT 120 "" "AT&F" OK "ATE1" # Is there a PIN set on the SIM? #OK "AT+CPIN?" # What network are we connected to? OK "AT+COPS?" # Next line can be used to get a full list of available # networks, but it takes a long time! #OK "AT+COPS=?" # List what AT commands we can issue to this card. #OK "AT&V" # Prefer UMTS networks over GPRS networks # (but connect to GPRS if UMTS unavailable) OK "AT_OPSYS=3" # Current network signal strength OK "AT+CSQ" # Note the single quotes at the beginning and end, # reversing the quoting (double at ends, single # inside) does NOT work! OK 'AT+CGDCONT=1,"IP","internet"' SAY "Calling Vodafone GPRSn" TIMEOUT 60 OK "ATD*99***1#" CONNECT c ########################################### ###########################################
- In particular, note the AT command that specified the APN to dial ("internet"). This is crucial. AT commands (in my experience; I haven't read anything about them!) need to be quote delimited, but the arguments to them are also quote delimited. The arguments need to be double quoted, while the entire expression is therefore single quote delimited. If you need the APN for a network other than Vodafone UK, see the FileSaveAs GPRS APN page.
- On some distributions (notably Gentoo) you will need to add the line
nodetach
to the file/etc/ppp/options
if you wish to see the output from the AT commands onstdout
. Otherwisepppd
will be very silent, and you will need to look at/var/log/messages
to see whether you have been successful. - Having created these files you can then run
pppd dump call vodafone
, which will give you debug output of all the things that have been set by your chat script, before executing your AT commands. If all is well you will get a connection! One thing to bear in mind is that you should check that a default route has been placed in your routing table by usingroute
to inspect it. If you have another network interface you may find that unplugging it will leave that default route in the table, in which case you will not get any connection on the datacard! Also note that Vodafone appears to block pings, so try awget http://www.google.com/
instead. Finally, bear in mind that pppd may die if does not recognise thereplacedefaultroute
command above: comment out as necessary, and instead use the option topppd
on the command line:pppd defaultroute call vodafone
.
Notes
Note 1: Network scans (i.e., to see what networks are available, not just Vodafone ones) take quite a long time, during which you will not be able to connect. The AT command for scanning may time out, and pppd will come back with a connection failed message, but the card will continue to be blocked on scanning. Increasing the timeout in your chat file is useful here (I set mine to 120).
Note 2: If you are trying to log signal strength or networks you are connected
to at regular intervals, rather than actually connect to them, you are likely
to want to kill the pppd
process using a script. If this is done
using kill -9
, pppd
will leave a stale lock on the
modem device, and the AT+CSQ
command will not give a response. If instead
kill -3
is used, this problem does not occur.
Sources
- I made heavy use of Paul Hardwick's page on the Vodafone 3G card to find out some of the above.
- Kai Engert's page on Linux and the Vodafone 3G datacard was also very useful.
- Various users in Germany have reported problems with the card under Linux, with connections dropping out very quickly. Hans Gräbe has written a page (in German) on his experiences.
- A Spanish page describing the setup of the 3G card is also worth looking at.
- A Ubuntu forums article on getting the card working in South Africa and the UK may also be of use.