 |



|
 |
This is a short description on how to use UMTS on a Linux Laptop.
I am using the Swisscom Mobile UMTS card. Internaly, it is an OPTION Wireless Technology GT Fusion card that is able to do UMTS/GPRS/WLAN 802.11b/g. On the back of the card, it is printed that the card is a Qualcomm 3G CDMA model.
The Laptop is an IBM Thinkpad 41p with SuSE Linux 9.1 on 2.6.5-7.75.
The first try was to enter the card as-is. Immediately. the hardware detection tool of SuSE started up Yast2 and allowed me to configure the WLAN card. When later I added the card to the other PCMCIA slot, I was asked again to configure the WLAN module. As I do not want to use WLAN from the card but rather use the built-in centrino module, I just added the card but did not configure it.
The Modem part of the UMTS module apparently did not come up. I then browsed the web and got some help, particularly from www.kuix.de/umts/vodafone/.
The first thing I did was to compare /proc/bus/usb/devices before and after I entered the card:
mnott@linux:/proc/bus/usb> cat devices >/tmp/1.txt
mnott@linux:/proc/bus/usb> cat devices >/tmp/2.txt
mnott@linux:/proc/bus/usb> diff /tmp/1.txt /tmp/2.txt
...
> T: Bus=05 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
> D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
> P: Vendor=0af0 ProdID=6000 Rev= 0.00
> S: Manufacturer=Option N.V.
> S: Product=Fusion UMTS GPRS WLAN
...
What is important, is the Vendor=0af0 and the ProdID=6000 part. I then did
mnott@linux:/proc/bus/usb> rmmod usbserial
mnott@linux:/proc/bus/usb> modprobe usbserial vendor=0xaf0 product=0x6000
I later added the option to /etc/modprobe.conf:
# was there:
alias char-major-188 usbserial
# added:
options usbserial vendor=0xaf0 product=0x6000
When I now plug in the card, I see the following output in /var/log/messages:
Dec 6 09:27:17 linux kernel: PCI: Enabling device 0000:07:00.1 (0000 -> 0002)
Dec 6 09:27:17 linux kernel: ohci_hcd 0000:07:00.1: OHCI Host Controller
Dec 6 09:27:17 linux kernel: PCI: Setting latency timer of device 0000:07:00.1 to 64
Dec 6 09:27:17 linux kernel: ohci_hcd 0000:07:00.1: irq 11, pci mem fa968000
Dec 6 09:27:17 linux kernel: ohci_hcd 0000:07:00.1: new USB bus registered, assigned bus number 5
Dec 6 09:27:17 linux kernel: usb usb5: Product: OHCI Host Controller
Dec 6 09:27:17 linux kernel: usb usb5: Manufacturer: Linux 2.6.5-7.75-default ohci_hcd
Dec 6 09:27:17 linux kernel: usb usb5: SerialNumber: 0000:07:00.1
Dec 6 09:27:18 linux /etc/hotplug/usb.agent[20248]: need a device for this command
Dec 6 09:27:18 linux kernel: hub 5-0:1.0: USB hub found
Dec 6 09:27:18 linux kernel: hub 5-0:1.0: 1 port detected
Dec 6 09:27:21 linux kernel: usb 5-1: new full speed USB device using address 2
Dec 6 09:27:21 linux kernel: usb 5-1: Product: Fusion UMTS GPRS WLAN
Dec 6 09:27:21 linux kernel: usb 5-1: Manufacturer: Option N.V.
Dec 6 09:27:21 linux kernel: usbserial 5-1:1.0: Generic converter detected
Dec 6 09:27:21 linux kernel: usb 5-1: Generic converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
Dec 6 09:27:21 linux kernel: usbserial 5-1:1.1: Generic converter detected
Dec 6 09:27:21 linux kernel: usb 5-1: Generic converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
Dec 6 09:27:21 linux kernel: usbserial 5-1:1.2: Generic converter detected
Dec 6 09:27:21 linux kernel: usb 5-1: Generic converter now attached to ttyUSB2 (or usb/tts/2 for devfs)
Dec 6 09:27:21 linux kernel: usbserial 5-1:1.3: Generic converter detected
Dec 6 09:27:21 linux kernel: usb 5-1: Generic converter now attached to ttyUSB3 (or usb/tts/3 for devfs)
Dec 6 09:27:21 linux /etc/hotplug/usb.agent[20339]: need a device for this command
Dec 6 09:27:22 linux /etc/hotplug/usb.agent[20396]: need a device for this command
Dec 6 09:27:22 linux /etc/hotplug/usb.agent[20393]: need a device for this command
Dec 6 09:27:21 linux /etc/hotplug/usb.agent[20336]: need a device for this command
Dec 6 09:27:22 linux /etc/hotplug/tty.agent[20338]: add tty device /class/tty/ttyUSB0
Dec 6 09:27:22 linux /etc/hotplug/tty.agent[20395]: add tty device /class/tty/ttyUSB2
Dec 6 09:27:22 linux /etc/hotplug/tty.agent[20341]: add tty device /class/tty/ttyUSB1
Dec 6 09:27:22 linux /etc/hotplug/tty.agent[20398]: add tty device /class/tty/ttyUSB3
I am now able to use the modem. I create a script /pgm/scripts/umts as follows:
#!/usr/bin/perl -w
#
# This is a script that connects to the gprs network.
#
# (c) 2004, Matthias Nott, MN Soft Branchensoftware
use strict;
use warnings;
# We enter the PIN
# umts card pin info:
#
# PIN 4711
# PUK 00634711
# PIN2 4712
# PUK2 43584712
system("chat -e -f /pgm/scripts/umts-pin-chat >/dev/ttyUSB0 </dev/ttyUSB0");
# We have to wait for the PIN to become active...
print "Enter the next time in seconds to wait for the card: [60]: ";
chop (my $time = <STDIN>);
if("" eq $time) {
$time = 60;
}
# Finally, we open the connection.
print "Opening the connection. Press Ctrl+C to hangup.\n";
The chat command is used to set the PIN of the card and to configure that we have a priority of "try UMTS first, then fall back to GPRS". It refers to the file /pgm/scripts/umts-pin-chat:
ABORT BUSY ABORT 'NO CARRIER' ABORT ERROR
"" ATZ OK AT+CPIN="4711" OK AT_OPSYS=3,2
The Perl script calls pppd call umts to open the connection. This refers to the files umts, umts-connect-chat, umts-disconnect-chat and umts-wvdial.conf in /etc/ppp/peers.
/etc/ppp/peers/umts:
# Most GPRS phones don't reply to LCP echo's
lcp-echo-failure 0
lcp-echo-interval 0
# Keep pppd attached to the terminal:
# Comment this to get daemon mode pppd
nodetach
# Debug info from pppd:
# Comment this off, if you don't need more info
debug
# Show password in debug messages
show-password
# Connect script:
# scripts to initialize the GPRS modem and start the connection,
# wvdial command is for Orange SPV while other phones should work with chat
#connect /etc/ppp/peers/gprs-connect-chat
connect "/usr/bin/wvdial --chat --config /etc/ppp/peers/umts-wvdial.conf radiolinja_usb_orange_spv"
# Disconnect script:
# AT commands used to 'hangup' the GPRS connection.
disconnect /etc/ppp/peers/gprs-disconnect-chat
# Serial device to which the GPRS phone is connected:
/dev/ttyUSB0 # USB serial device, for example Orange SPV
# Serial port line speed
115200 # fast enough
# Hardware flow control:
# Use hardware flow control with cable, Bluetooth and USB but not with IrDA.
crtscts # serial cable, Bluetooth and USB, on some occations with IrDA too
#nocrtscts # IrDA
# Ignore carrier detect signal from the modem:
local
# IP addresses:
# - accept peers idea of our local address and set address peer as 10.0.0.1
# (any address would do, since IPCP gives 0.0.0.0 to it)
# - if you use the 10. network at home or something and pppd rejects it,
# change the address to something else
:10.0.0.1
# pppd must not propose any IP address to the peer!
noipdefault
# Accept peers idea of our local address
ipcp-accept-local
# Add the ppp interface as default route to the IP routing table
defaultroute
# Newer pppd's also support replacing the default route, if one is
# already present, when the GPRS connetion should be set as the default route
# to the network
replacedefaultroute
# DNS servers from the phone:
# some phones support this, some don't.
# usepeerdns
# ppp compression:
# ppp compression may be used between the phone and the pppd, but the
# serial connection is usually not the bottleneck in GPRS, so the
# compression is useless (and with some phones need to disabled before
# the LCP negotiations succeed).
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
# The phone is not required to authenticate:
noauth
# Username and password:
# If username and password are required by the APN, put here the username
# and put the username-password combination to the secrets file:
# /etc/ppp/pap-secrets for PAP and /etc/ppp/chap-secrets for CHAP
# authentication. See pppd man pages for details.
# Example, Radiolinja operator pap-secrets:
# "rlnet" * "internet" *
user "rlnet"
# The persist tries to reopen the connection if it is dropped. This
# is usefull for example with a Nokia 7650 which only manages to
# 'dial' with every second attempt or when the network likes to drop the
# connection every now and then. It's not fun when the over-night
# 'apt-get dist-upgrade -d -y' fails constantly...
#persist
#maxfail 99
# Asyncmap:
# some phones may require this option.
#asyncmap 0xa0000
# No magic:
# some phones may require this option.
#nomagic
# Require PAP authentication:
# some phones may require this option.
#require-pap
/etc/ppp/peers/umts-connect-chat:
exec chat \
TIMEOUT 5 \
ECHO ON \
ABORT '\nBUSY\r' \
ABORT '\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 ATD*99# \
TIMEOUT 22 \
SAY "\nwaiting for connect...\n" \
CONNECT "" \
SAY "\nConnected." \
SAY "\nIf the following ppp negotiations fail,\n" \
SAY
/etc/ppp/peers/umts-disconnect-chat:
exec /usr/sbin/chat -V -s -S \
ABORT "BUSY" \
ABORT "ERROR" \
ABORT "NO DIALTONE" \
SAY "\nSending break to the modem\n" \
"" "\K" \
"" "+++ATH" \
SAY "\nPDP context detached\n"
/etc/ppp/umts-wvdial.conf:
[Dialer radiolinja_usb_orange_spv]
Modem = /dev/ttyUSB0
Baud = 460800
Init1 = ATH
Init2 = ATE1
#Init3 = AT+CGDCONT=1,"IP","internet.t-d1.de","0.0.0.0",0,0
Init3 = AT+CGDCONT=1,"IP","gprs.swisscom.ch","0.0.0.0",0,0
Dial Command =
Phone = ATD*99***1#
Username = gprs
Password = gprs
When I execute /pgm/scripts/umts, I see:
Entering PIN.
ATZ
OK
AT+CPIN="4711"
OK
Enter the next time in seconds to wait for the card: [60]:
Opening the connection. Press Ctrl+C to hangup.
--> WvDial: Internet dialer version 1.54.0
--> Initializing modem.
--> Sending: ATH
ATH
OK
--> Sending: ATE1
ATE1
OK
--> Sending: AT+CGDCONT=1,"IP","gprs.swisscom.ch","0.0.0.0",0,0
AT+CGDCONT=1,"IP","gprs.swisscom.ch","0.0.0.0",0,0
OK
--> Modem initialized.
--> Sending: ATD*99***1#
--> Waiting for carrier.
ATD*99***1#
CONNECT 57600
--> Carrier detected. Waiting for prompt.
--> Dont know what to do! Starting pppd and hoping for the best.
Serial connection established.
using channel 26
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3d12d1fc>]
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x8116f5d> <pcomp> <accomp>]
No auth is possible
sent [LCP ConfRej id=0x0 <auth chap MD5> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x3d12d1fc>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x8116f5d>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x8116f5d>]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0>]
rcvd [LCP DiscReq id=0x2 magic=0x8116f5d]
rcvd [LCP ProtRej id=0x3 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
rcvd [IPCP ConfReq id=0x0]
sent [IPCP ConfNak id=0x0 <addr 10.0.0.1>]
rcvd [IPCP ConfNak id=0x1 <addr 10.122.16.89>]
sent [IPCP ConfReq id=0x2 <addr 10.122.16.89>]
rcvd [IPCP ConfAck id=0x2 <addr 10.122.16.89>]
rcvd [IPCP ConfReq id=0x1]
sent [IPCP ConfAck id=0x1]
replacing old default route to wlan0 [192.168.1.1]
local IP address 10.122.16.89
remote IP address 10.0.0.1
Script /etc/ppp/ip-up started (pid 21170)
Script /etc/ppp/ip-up finished (pid 21170), status = 0x0
The wait is there because if I have just plugged in the card, it takes a while after entering the PIN and the card logging on to the network. Later, if you just reconnect, you can use 0 seconds; actually, entering the PIN will then return ERROR, which is just fine, as the PIN had been entered previously.
When I press Ctrl+C in the window, I get:
Terminating on signal 2.
restoring old default route to wlan0 [192.168.1.1]
Script /etc/ppp/ip-down started (pid 21229)
sent [LCP TermReq id=0x2 "User request"]
rcvd [LCP TermAck id=0x2]
Connection terminated.
Connect time 1.0 minutes.
Sent 18925 bytes, received 38068 bytes.
Sending break to the modem
PDP context detached
Serial link disconnected.
Waiting for 1 child processes...
script /etc/ppp/ip-down, pid 21229
Script /etc/ppp/ip-down finished (pid 21229), status = 0x0
Connect time 1.0 minutes.
Sent 18925 bytes, received 38068 bytes.
That's all! If you've additional insight or experiences, please let me know.
|
 |
 |