UMTS
Verwendung von Lenovo Notebook oder Qualcom
Devices
Lenovo=/dev/ttyACM0/1
Qualcom=/dev/noz0
Da die Lenovokate ungleich schwieriger zu erkenne ist als die Qualcom – Karte gehen wir hier kurz auf die einzelnen “Suchen und finden Schritte” ein.
Zunächst sollten wir prüfen ob die Umtskarte vom System erkannt wird
lsusb
Bus 003 Device 002: ID 0bdb:1900 Ericsson Business Mobile Networks BV
ll /dev/ttyACM*
crw-rw---- 1 root dialout 166, 0 Mar 18 08:57 /dev/ttyACM0 crw-rw---- 1 root dialout 166, 1 Mar 18 08:59 /dev/ttyACM1 crw-rw---- 1 root dialout 166, 2 Mar 18 08:57 /dev/ttyACM2
**ttyACM1** is das Device unserer Wahl ( Lenovo x301 ThinkPad )
Nun müssen wir unserer Simkarte noch die PIN mitteilen!
“AT+CPIN=MY_SIM_PIN” zum Chatscript hinzufügen
Hierzu ein Perlscript
#!/usr/bin/perl use strict; use warnings; $SIG{ALRM} = sub { die("timeout: no response from modem $modem\n"); }; my $pin = shift; my $modem = '/dev/ttyACM1'; open(MODEM, "+<", $modem) or die("Failed to open modem $modem: $!"); print(MODEM "AT+CPIN=\"$pin\"\n\r"); while (<MODEM>) { if (m/OK/) { close(MODEM); print("PIN accepted\n"); exit(0); } if (m/ERROR/) { close(MODEM); print("PIN rejected\n"); exit(1); } } exit(0);
Das neue PEERS – Script
################################################# # /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 # Connect script: # scripts to initialize the UMTS modem and start the connection, connect /etc/ppp/peers/umts-connect-chat # Disconnect script: # AT commands used to 'hangup' the UMTS connection. disconnect /etc/ppp/peers/umts-disconnect-chat # Serial device to which the UMTS card is connected: /dev/ttyACM1 # Serial port line speed 115200 # 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 0.0.0.0:0.0.0.0 # 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 # 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 mtu 1500 mru 1500 #################################################
################################################# # /etc/ppp/umts.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 AT+CFUN=1 \ OK AT+CPIN? \ OK 'AT+CGDCONT=1,"IP","web.vodafone.de","",0,0' \ OK "ATDT*99*1#" TIMEOUT 10 \ SAY "\nwaiting for connect...\n" \ CONNECT "" \ SAY "\nConnected." \ SAY "\nIf the following ppp negotiations fail,\n" \ SAY "try restarting the phone.\n" #################################################
WICHTIG:
**OK AT+CFUN=1** Wird zum aktivieren des Lenovo – Modems verwendet. Bei Qualcom ist diese Zeile nicht nötig
Die ältere Variante des PEERS – Script
( Funktioniert aber fast besser wie die neuere … )
################################################# # /etc/ppp/peers/umts_old ################################################# nodetach debug lock # Mit diesem Skript werden wir die Merlin/Qualcom - Karte steuern connect "/usr/sbin/chat -v -f /etc/ppp/umts.chat_old" defaultroute /dev/ttyACM0 # korrekte serielle Schnittstelle angeben 460800 crtscts # modem usepeerdns novj noauth # idle gibt an, nach wieviel Sekunden inaktivitöt # Das Modem auflegt idle 300 # persist und demand sind wichtig, damit der pppd # auf Netzwerkanfragen wartet, und eine UMTS # Verbindung automatisch aufbaut, wenn dies nötig ist persist #demand #noipdefault #################################################
################################################# # /etc/ppp/umts.chat_old ################################################# ABORT BUSY #ABORT 'NO CARRIER' ABORT ERROR REPORT CONNECT TIMEOUT 10 # Der nächste Befehl ist kein Standardbefehl, aber # sehr wichtig. Wir fragen mit AT+CPIN? ob bereits # die SIM-PIN eingegeben wurde. Wenn wir kein READY # bekommen übergeben wir die PIN und schauen danach # erneut ob es geklappt hat (ACHTUNG! WIE BEIM HANDY # GILT AUCH HIER 3 MAL FALSCHE PIN == GESPERRTE SIM!) # Ersetze xxxx durch Deine PIN. # "" "AT+CPIN?" READY-AT+CPIN=\0429947\042- "\c" OK "\c" # "" "AT+CPIN?" READY "\c" OK "\c" #TIMEOUT 120 "" "AT&F" OK "AT+CFUN=1" #OK "ATZ" OK "ATE0V1&D2&C1S0=0+IFC=2,2" OK "ATE1" # Hiermit teilen wir der Karte mit, welchen APN # sie verwenden soll OK "AT+CGDCONT=1,\042IP\042,\042web.vodafone.de\042" # Diese etwas ungewühnliche Nummer teilt dem Modem # mit, dass es den APN anwählen soll. OK "ATDT*99***1#" #OK "ATDT*99*1#" CONNECT #################################################
Ein mögliches Disconnect Script (optional)
################################################# # /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"