linux huawei 3g modem ppp vodafone setup

when I bought this modem and the subscription from vodafone like a year ago the above mentioned dudes had no idea how to make it run under linux. they said they do tho. they had an entire dev team developing python guis that weren't working. thats tipical for corporates.



to all who cursed vodafone and friends for not being able to run their ppp, i apologize for writing this quick howto so late.


my huawei is
Bus 002 Device 005: ID 12d1:1465 Huawei Technologies Co., Ltd.
but usb_modeswitch supports many other types of devices. check your dev ids in lsusb output.

prerequisites:
- linux 2.6 system
- comgt (http://sourceforge.net/projects/comgt/)
- usb_modeswitch (http://www.draisberghof.de/usb_modeswitch/#download )

1. install comgt
2. install usb_modeswitch
3. install this as file /etc/udev/rules.d/55-huawei.rules:
ACTION=="add", SUBSYSTEMS=="scsi", DRIVERS=="sr", \
ATTRS{vendor}=="HUAWEI ", \
RUN:=""
ACTION=="add", SUBSYSTEM=="usb", \
ATTR{idVendor}=="12d1", ATTR{idProduct}=="1520", \
RUN:="/usr/local/bin/usbflip %s{idVendor} %s{idProduct}"

install this as script /usr/local/bin/usbflip and chmod-it +x
#!/bin/sh
VID="$1"
PID="$2"
PATH=/usr/local/bin/:usr/bin:/bin:/usr/sbin:/sbin
# Need to wait for the device to settle before sending the command
sleep 1
# Huawei recommended switch sequence
echo "FLIP-FLOP: ${VID}:${PID} !!"
/usr/sbin/usb_modeswitch -v ${VID} -p ${PID} -M 55534243EE0000006000000000000611062000000000000000000000000000
sleep 1
modprobe -a option
sleep 1
echo 0x12d1 0x1465 > /sys/bus/usb-serial/drivers/option1/new_id

-insert the modem. you should see /dev/ttyUSB[0-4] being created in dev
-run:
COMGTPIN=1234 comgt -d /dev/ttyUSB0 PIN
you should get a "SIM ready" message
-run:
comgt -d /dev/ttyUSB0 reg
you should get a message like this:
root@pinkpony:~# COMGTPIN=1234 comgt -d /dev/ttyUSB0 reg
Waiting for Registration.........
Registered on Home network: "22601",2

preparing ppp
===============

install this as /etc/ppp/peers/vodafone

name vodafone
460800
noipv6
lock
crtscts
local
noccp
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
nodeflate
nomagic
nomp
nopredictor1
defaultroute
lcp-echo-failure 0
lcp-echo-interval 0
noauth
debug
kdebug 1
nodetach
user internet.vodafone.ro
password vodafone
connect "/usr/sbin/chat -V -v -f /etc/ppp/chatscripts/vodafone2"
noipdefault
ipcp-no-addresses
maxfail 40
persist
ipcp-accept-local
ipcp-accept-remote
noipx
usepeerdns


install this as /etc/ppp/chatscripts/vodafone2

'ABORT' 'BUSY'
'ABORT' 'ERROR'
'ABORT' 'NO CARRIER'
REPORT CONNECT
'TIMEOUT' '60'
'' 'ATH'
'OK' 'ATZ'
'OK' 'ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0'
'OK' "AT&F"
'OK' "ATE1"
'OK' 'AT+CGDCONT=1,"IP","internet.vodafone.ro"'
TIMEOUT 120
'OK' "ATD*99***1#"
'CONNECT' '\c'



you are kinda ready to run ppp:

pppd /dev/ttyUSB0 call vodafone

you should be getting output similar to this:

cia@pinkpony:~$ sudo pppd /dev/ttyUSB0 call vodafone
[sudo] password for cia:
ATH
OK
ATZ
OK
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
AT&F
OK
ATE1
OK
AT+CGDCONT=1,"IP","internet.vodafone.ro"
OK
ATD*99***1#
CONNECTchat: Jul 17 10:21:50 CONNECT
Script /usr/sbin/chat -V -v -f /etc/ppp/chatscripts/vodafone2 finished (pid 2121), status = 0x0
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
...
...
...
sent [IPCP ConfAck id=0x1]
rcvd [IPCP ConfAck id=0x4 ]
Could not determine remote IP address: defaulting to 10.64.64.64
Cannot determine ethernet address for proxy ARP
local IP address 10.85.113.180
remote IP address 10.64.64.64
primary DNS address 81.12.132.206
secondary DNS address 81.12.128.206
Script /etc/ppp/ip-up started (pid 2128)
Script /etc/ppp/ip-up finished (pid 2128), status = 0x0


my huawei modem info
E: ID_VENDOR=HUAWEI_Technology
E: ID_VENDOR_ENC=HUAWEI\x20Technology
E: ID_VENDOR_ID=12d1
E: ID_MODEL=HUAWEI_Mobile
E: ID_MODEL_ENC=HUAWEI\x20Mobile
E: ID_MODEL_ID=1465
E: ID_REVISION=0000
E: ID_SERIAL=HUAWEI_Technology_HUAWEI_Mobile
E: ID_TYPE=generic
E: ID_BUS=usb
E: ID_USB_INTERFACES=:ffffff:0206ff:0a0000:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=option
E: ID_IFACE=00
E: ID_VENDOR_FROM_DATABASE=Huawei Technologies Co., Ltd.
you're done. have fun.

No comments:

Post a Comment