Nachdem der kabellose Zugang ins Netz per WLAN noch ;) nicht überall gegeben ist, habe ich mich heute daran gemacht, meinem neuen Notebook die Möglichkeit zu geben, per Mobiltelephon und GPRS ins Netz zu kommen.
Hardware:
- Asus S5600N Notebook
- (da das Notebook ohne IrDA daher kommt) ednet USB to IrDA dongle (ca. EUR 20)
- Nokia 8310 Mobiltelephon (österr. Netzbetreiber ONE)
Software:
- Debian GNU/Linux Unstable (Kernel 2.6.8-2-686)
- irda-utils
- pppd
- wvdial
Nach Einstecken des (ohne zuvor seine Linux-Tauglichkeit zu recherchieren gekauften) USB to IrDA Adapters lässt mich ein Blick in /var/log/syslog aufatmen:
Feb 13 02:55:12 r5d5 kernel: usb 2-1: new full speed USB device using address 3
Feb 13 02:55:13 r5d5 kernel: SigmaTel STIr4200 IRDA/USB found at address 3, Vendor: 66f, Product: 4200
Feb 13 02:55:13 r5d5 kernel: IrDA: Registered SigmaTel device irda0
Feb 13 02:55:13 r5d5 usb.agent[3475]: stir4200: already loaded
Unter der Haube dieses Adapters steckt also von Linux unterstützte SigmaTel Hardware.
Nun kommen zum ersten Mal die irda-utils zum Einsatz. Mit
markus@r5d5:~ $ sudo irattach irda0 -s
bringt man den IrDA-Adapter nun dazu, nach Remote-Geräten ausschau zu halten. Ob dies funktioniert hat, können wir folgendermaßen überprüfen:
markus@r5d5:~ $ sudo irdadump
02:13:45.381616 xid:cmd acff0841 > ffffffff S=6 s=3 (14)
02:13:45.481599 xid:cmd acff0841 > ffffffff S=6 s=4 (14)
02:13:45.581585 xid:cmd acff0841 > ffffffff S=6 s=5 (14)
02:13:45.681570 xid:cmd acff0841 > ffffffff S=6 s=* r5d5 hint=0400 [ Computer ] (20)
02:13:48.081206 xid:cmd acff0841 > ffffffff S=6 s=0 (14)
02:13:48.181191 xid:cmd acff0841 > ffffffff S=6 s=1 (14)
02:13:48.281176 xid:cmd acff0841 > ffffffff S=6 s=2 (14)
02:13:48.381162 xid:cmd acff0841 > ffffffff S=6 s=3 (14)
02:13:48.481143 xid:cmd acff0841 > ffffffff S=6 s=4 (14)
02:13:48.581129 xid:cmd acff0841 > ffffffff S=6 s=5 (14)
02:13:48.681114 xid:cmd acff0841 > ffffffff S=6 s=* r5d5 hint=0400 [ Computer ] (20)
02:13:51.080752 xid:cmd acff0841 > ffffffff S=6 s=0 (14)
02:13:51.180734 xid:cmd acff0841 > ffffffff S=6 s=1 (14)
02:13:51.280718 xid:cmd acff0841 > ffffffff S=6 s=2 (14)
02:13:51.380703 xid:cmd acff0841 > ffffffff S=6 s=3 (14)
02:13:51.480687 xid:cmd acff0841 > ffffffff S=6 s=4 (14)
02:13:51.580673 xid:cmd acff0841 > ffffffff S=6 s=5 (14)
02:13:51.680657 xid:cmd acff0841 > ffffffff S=6 s=* r5d5 hint=0400 [ Computer ] (20)
02:13:54.080300 xid:cmd acff0841 > ffffffff S=6 s=0 (14)
02:13:54.180278 xid:cmd acff0841 > ffffffff S=6 s=1 (14)
02:13:54.280262 xid:cmd acff0841 > ffffffff S=6 s=2 (14)
Kurzerhand am Handy Infrarot aktiviert und es in Reichweite des Dongles gelegt ändert sich die Ausgabe von irdadump folgendermaßen:
02:13:54.580216 xid:cmd acff0841 > ffffffff S=6 s=5 (14)
02:13:54.680202 xid:cmd acff0841 > ffffffff S=6 s=* r5d5 hint=0400 [ Computer ] (20)
02:13:57.079837 xid:cmd acff0841 > ffffffff S=6 s=0 (14)
02:13:57.179821 xid:cmd acff0841 > ffffffff S=6 s=1 (14)
02:13:57.279806 xid:cmd acff0841 > ffffffff S=6 s=2 (14)
02:13:57.379792 xid:cmd acff0841 > ffffffff S=6 s=3 (14)
02:13:57.458963 xid:rsp acff0841 < f29d0000 S=6 s=3 Nokia 8310 hint=b125 [ PnP Modem Fax Telephony IrCOMM IrOBEX ] (27)
02:13:57.479776 xid:cmd acff0841 > ffffffff S=6 s=4 (14)
02:13:57.579761 xid:cmd acff0841 > ffffffff S=6 s=5 (14)
02:13:57.679746 xid:cmd acff0841 > ffffffff S=6 s=* r5d5 hint=0400 [ Computer ] (20)
02:14:00.079388 xid:cmd acff0841 > ffffffff S=6 s=0 (14)
02:14:00.160512 xid:rsp acff0841 < f29d0000 S=6 s=0 Nokia 8310 hint=b125 [ PnP Modem Fax Telephony IrCOMM IrOBEX ] (27)
02:14:00.179366 xid:cmd acff0841 > ffffffff S=6 s=1 (14)
02:14:00.279351 xid:cmd acff0841 > ffffffff S=6 s=2 (14)
02:14:00.379335 xid:cmd acff0841 > ffffffff S=6 s=3 (14)
Soweit sogut! Nun geht’s daran, über’s Modem des Mobiltelephons mit ppp eine Verbindung ins Netz aufzubauen.
Hier die Konfigurationsskripts:
markus@r5d5:~ $ cat /etc/ppp/peers/gprs
# Most GPRS phones don't reply to LCP echo's
lcp-echo-failure 0
lcp-echo-internal 0
# Keep pppd attached to the terminal
nodetach
# Debug info
debug
show-password
# (Dis-)Connect scripts
connect "/usr/bin/wvdial --chat --config /etc/ppp/peers/gprs-wvdial.conf one"
disconnect /etc/ppp/peers/gprs-disconnect-chat
# IrDA serial device and speed
/dev/ircomm0
115200
# Disable hardware flow control
nocrtscts
# IP configuration
local
:10.0.0.1
noipdefault
ipcp-accept-local
usepeerdns
# ppp compression (disabled because the serial connection isn't the bottleneck in GPRS)
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
# The phone is not required to authenticate:
noauth
# Username and password
# add your information to /etc/ppp/pap-secrets
# e.g. "web" * "web" *
user "web"
markus@r5d5:~ $ cat /etc/ppp/peers/gprs-wvdial.conf
[Dialer one]
Init1 = ATH
Init2 = ATE1
Init3 = AT+CGDCONT=1,"IP","web.one.at"
Dial Command = ATD
Phone = *99#
Username = web
Password = web
markus@r5d5:~ $ cat /etc/ppp/peers/gprs-disconnect-chat
#!/bin/sh
exec /usr/sbin/chat -V -s -S
ABORT "BUSY"
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "nSending break to the modemn"
"" "K"
"" "K"
"" "K"
"" "+++ATH"
"" "+++ATH"
"" "+++ATH"
SAY "nPDP context detachedn"
Fertig! Ein kurzer Test zeigt, dass alles funktioniert:
markus@r5d5:~ $ sudo pppd call gprs
--> WvDial: Internet dialer version 1.54.0
--> Initializing modem.
--> Sending: ATH
ATH
OK
--> Sending: ATE1
ATE1
OK
--> Sending: AT+CGDCONT=1,"IP","web.one.at"
AT+CGDCONT=1,"IP","web.one.at"
OK
--> Modem initialized.
--> Sending: ATD*99#
--> Waiting for carrier.
ATD*99#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%}"}&} }*} } g}%~
--> Carrier detected. Waiting for prompt.
~[7f]}#@!}!} } }2}#}$@#}!}$}%}"}&} }*} } g}%~
--> PPP negotiation detected.
Serial connection established.
using channel 3
Using interface ppp0
Connect: ppp0 < --> /dev/ircomm0
sent [LCP ConfReq id=0x1
rcvd [LCP ConfRej id=0x1
sent [LCP ConfReq id=0x2
rcvd [LCP ConfAck id=0x2
sent [LCP ConfReq id=0x2
rcvd [LCP ConfReq id=0x0
sent [LCP ConfAck id=0x0
rcvd [LCP ConfAck id=0x2
sent [PAP AuthReq id=0x1 user="web" password="web"]
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
sent [CCP ConfReq id=0x1
sent [IPCP ConfReq id=0x1
rcvd [IPCP ConfReq id=0x0
sent [IPCP ConfNak id=0x0
rcvd [LCP ProtRej id=0x0 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
rcvd [IPCP ConfNak id=0x1
sent [IPCP ConfReq id=0x2
rcvd [IPCP ConfReq id=0x1
sent [IPCP ConfAck id=0x1
rcvd [IPCP ConfAck id=0x2
not replacing default route to eth0 [192.168.0.1]
Cannot determine ethernet address for proxy ARP
local IP address 10.100.186.77
remote IP address 10.0.0.1
primary DNS address 194.24.128.100
secondary DNS address 194.24.128.102
Script /etc/ppp/ip-up started (pid 17444)
Script /etc/ppp/ip-up finished (pid 17444), status = 0x0
Nachdem auf meinem Rechner eine default Route auf eth0 eingestellt war, musste ich diese nur noch löschen und eine Neue setzten, um meinen Browser nun endlich per Handy ins Netz zu bringen.
markus@r5d5:~ $ sudo route del default
markus@r5d5:~ $ sudo route add default ppp0
Das Ganze ist mit Sicherheit noch nicht perfekt. Für Verbesserungsvorschläge bin ich also sehr dankbar!