TracNav
- Home
- Research Overview
- MPhil Information
Research Projects
- Wireless Comms
- Bat System
- Broadband Phone
Visual tags
- Sentient Vehicles
- Task Assignment
- NLMaP
- Computing for the Future of the Planet
- SESAME
- Active Floor
- Open-Source CSK Energy
Development Info
DTG Local Pages
- Cambridge Weather
- Contact Details
Installing Vodafone 3G Datacards under Linux
Author: David Cottingham
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.
For information on how to send SMSs with this card, see the SMS sending Howto.
Drivers for 3G Broadband (HSDPA)
- This is remarkably painless! Just download Paul Hardwick's Nozomi drivers. Then...
tar -xzvf nozomi.tar.gzmakemkdir /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/depmodmodprobe 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.ccalls a function defined inworkqueue.cof 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.cto 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
dmesgyou should find notifications of a USB hub being installed.tail -n 30 /var/log/messageswill 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.
- If you now run
cardctl statusyou 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/devicesto 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/messagesdetailing that OHCI has found a USB hub. - Under Suse: Edit
/etc/modprobe.conf.localand add the lineoptions usbserial vendor=0xaf0 product=0x5000.
Under Gentoo: Make a new file called/etc/modules.d/vodafoneand put the lineoptions usbserial vendor=0xaf0 product=0x5000in 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
dmesgalong the lines ofkobject_register failed for usbserial (-17), make certain that you have not only donemake; make modules_installbut alsomake installfor your kernel (to get it into/bootwhere 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). - 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
wvdialto work, (it complained that it couldn't get modem information from /dev/modem). I therefore fell back topppd. - 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 GCOM useful for performing operations like setting the PIN.
/etc/ppp/peers/vodafone:
/etc/ppp/vodafone-chat########################################### #Suggested Vodafone PPPD configuration file #File /etc/ppp/peers/vodafone ########################################### #Set this to the device allocated to the Datacard /dev/modem #Baudrate 384000 #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 ########################################### ###########################################
########################################### # 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 partcular, 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 Reqwireless's page on APNs
- On some distributions (notably Gentoo) you will need to add the line
nodetachto the file/etc/ppp/optionsif you wish to see the output from the AT commands onstdout. Otherwisepppdwill be very silent, and you will need to look at/var/log/messagesto 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 usingrouteto 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 thereplacedefaultroutecommand above: comment out as necessary (but find another way of getting the correct route into your routing table, otherwise you won't get any connection!).
Note: 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: 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.
