Posts Tagged ‘huawei’

SFR Huawei 3G+ USB key with Debian

Wednesday, July 29th, 2009

After Orange GPRS with Nokia 6630 and SFR GPRS with Nokia E65, I use now mainly Huawei 3G+ USB key with SFR (french mobile phone provider).

lsusb info about this Huawei 3G+ USB key:

Bus 003 Device 003: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem

And dmesg info:

[208765.818448] option 3-1:1.0: GSM modem (1-port) converter detected
[208765.818448] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB3
[208765.830451] usb-storage: probe of 3-1:1.1 failed with error -5
[208765.830451] option 3-1:1.1: GSM modem (1-port) converter detected
[208765.830451] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB4
[208765.830502] scsi12 : SCSI emulation for USB Mass Storage devices
[208765.834458] usb 3-1: New USB device found, idVendor=12d1, idProduct=1003
[208765.834458] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[208765.834458] usb 3-1: Product: HUAWEI Mobile
[208765.834458] usb 3-1: Manufacturer: HUAWEI Technologies
[208765.834458] usb-storage: device found at 3
[208765.834458] usb-storage: waiting for device to settle before scanning
[208770.863868] usb-storage: device scan complete
[208770.866850] scsi 12:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[208770.887881] sr0: scsi-1 drive
[208770.887881] sr 12:0:0:0: Attached scsi CD-ROM sr0
[208770.887881] sr 12:0:0:0: Attached scsi generic sg1 type 5

For connecting, I tried an infamous GUI distributed by Vodafone in Debian package. Too buggy, too complex. The best solution is using a PPP chatscript.

Then, plug USB key, sleep 20 and unlock it:

echo 'at+cpin="1234"' > /dev/ttyUSB3

Note: 1234 is PIN code (or not) and /dev/ttyUSB3 is modem device.

Create these 2 files:

/etc/ppp/peers/gprs:

noauth
debug
nodetach
connect "/usr/sbin/chat -v -f /etc/ppp/peers/huawei-e220.chat"
/dev/ttyUSB3
230400
crtscts
defaultroute
noipdefault
user ignored
remotename whatever
ipparam whatever
usepeerdns

/etc/ppp/peers/huawei-e220.chat:

# Chat file for Huawei E220 HSDPA USB modem
ABORT BUSY ABORT 'NO CARRIER' ABORT 'NO ANSWER' ABORT DELAYED
'' AT
OK ATZ
OK 'ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0'
OK 'AT+CGDCONT=1,"IP","websfr"'
OK ATDT*99***1#
CONNECT ""

Finally you can:

pppd call gprs