You can find a lot of umts express cards that could be run under linux. I think most of them are installed in a very similar way[1]. I took the instruction for the well known card "Novatel XU870"[2] as an example. First of all I was a little bit disappointed to have another model than the Novatel, but figured out, that it is nearly the same and an easy going. And you can even find for the Option[3] cards a lot of official[4] and inofficial[5] information as well. It is also posible to use "UMTSmon"[6], but you have to load "pcmcia_core" module before.
update: hint: card was tested on a 2.6 kernel, without a pcmcia adapter; results may differ with a 2.4 kernel or as pcmcia device
To register the card, that is adapted as an USB device you have to identify it by using the "lsusb" call. This will give you an output like this:
Bus 004 Device 001: ID 0000:0000 Bus 005 Device 001: ID 0000:0000 Bus 003 Device 003: ID 0af0:6701 Option Bus 003 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 Bus 001 Device 002: ID 0000:0000 Bus 001 Device 001: ID 0000:0000That is the amount of data you need to get the card as a serial device. Now you have to reload the usbserial module with your card data:
> modprobe -r usbserial > modprobe usbserial vendor=0x0af0 product=0x6701This will create some new devices. Based on supposition there was no card registered by know you got the following devices:
This is a task you have to do once. It's an initial activation as known by your mobile phone. There are a lot of perl scripts[7] out there doing this. They do not check nor test the card for errors, but send the pin and wait for the result. So I wrote an awk script by myself that is does some more testing.
#!/usr/bin/awk -f
# /sbin/setpin.awk
# 20070414 marco (@macarony.de - Matthias Diener)
BEGIN{
# stay quiet if status is OK
QUIET_MODE = 0;
MODEM = "/dev/ttyUSB0";
PIN = "0000";
# check if pin is to set
print("AT+CPIN?") > MODEM;
STATUS_REQ = 1;
SET_PIN = 0;
while((getline < MODEM) > 0) {
if(STATUS_REQ == 1) {
if($0 ~ "SIM PIN") {
# sim is not set - do it
SET_PIN = 1
} else if($0 ~ "OK") {
# got OK for "AT+CPIN?" request
if(SET_PIN = 1) {
print("AT+CPIN=\"" PIN "\"") > MODEM;
STATUS_REQ = 0;
} else {
print("ERROR - unknown status");
exit(1);
}
} else if($0 ~ "ERROR") {
# card does not support this kind of request.. try to set pin
print("ERROR - status request not supported.. try to set pin");
print("AT+CPIN=\"" PIN "\"") > MODEM;
STATUS_REQ = 0;
SET_PIN = 1
} else if($0 ~ "READY") {
# pin was already set
if(!QUIET_MODE) {
print("OK - PIN is set");
}
exit(0);
} else if($0 ~ "FAULT") {
# missing sim card
print("ERROR - SIM is not present");
exit(1);
}
} else if(SET_PIN == 1) {
if($0 ~ "OK") {
# pin setting successful
if(!QUIET_MODE) {
print("OK - PIN accepted");
}
exit(0);
} else if($0 ~ "ERROR") {
# pin rejected - maybe wrong number?
print("ERROR - PIN rejected");
exit(1);
}
} else {
# you should not get here
print("ERROR - unknown failure");
exit(1);
}
}
print("ERROR - Cannot open modem: " MODEM);
# if a file was created by the script - remove it
system("test -f " MODEM " && rm " MODEM);
exit(1);
}
This task is done by using the pppd daemon. I wrote a peer and a chat script with some parameters that works for me. Here are the listings:
# etc/ppp/peers/umts # 20070401 marco (@macarony.de - Matthias Diener) # my device /dev/ttyUSB0 # baud rate (115200 is standard) 460800 # lock the serial device lock # normal handshaking crtscts # use the modem control lines modem # connection can be used by everyone noauth # replace the route replacedefaultroute defaultroute # see at Access Point Name lists[APN.x] for user and password user ppp password ppp # the chat script to use for connect connect "/usr/sbin/chat -V -f /etc/ppp/umts-chat" noipdefault # do not use any compression novj noaccomp nobsdcomp nopcomp novjccomp
# /etc/ppp/umts-chat # 20070401 marco (@macarony.de - Matthias Diener) ABORT BUSY ABORT ERROR ABORT 'NO CARRIER' REPORT CONNECT TIMEOUT 5 # reset to default configuration "" "ATZ" # set the prefered mode to UMTS OK "AT_OPSYS=3,2" # set Access Point Name[APN.x] OK "AT+CGDCONT=1,\042IP\042,\042ACCESS_POINT_NAME\042" TIMEOUT 20 # dial with tone OK "ATDT*99***1#" CONNECT \c\n
[1] http://www.kuix.de/umts/vodafone/
[2] http://www.novatelwireless.com/support/merlin-xu870-linux.html
[3] http://www.option.com/
[4] http://support.option.com/support/faq.php
[5] http://www.pharscape.org/
[6] http://umtsmon.sourceforge.net/
[7] http://wiki.ubuntuusers.de/UMTS
You can find your Access Point Name and other related data in one of the lists below:
[APN.1] http://www.taniwha.org.uk/gprs.html
[APN.2] http://www.quickim.com/support/gprs-settings.html
[APN.3] http://www.formatc.de/roaming/gprs.htm
[APN.4] http://www.reqwireless.com/apns.html
http://macarony.de/option_ge0201_umts.html