User Tools

Site Tools


UMTS on Debian with Huawei E220 USB-modem

This page describes howto setup a Debian 4.0 Etch system to use the Huawei E220 USB modem (Vodafone Connect)


Prepare Debian

The E220 is recognized as a CDROM for older kernels. The kernel-module “usb-storage” will claim the usb-device.

From kernels > 2.6.20, the “usbserial” kernel-module recognizes the usb-device and creates the nessacery devices /dev/ttyUSB0 and /dev/ttyUSB1

For Debian 4.0 Etch, you can install the “ethnhalf” kernel:

echo "deb trunk main" \
  >> /etc/apt/sources.list
apt-get update
apt-get install linux-image-2.6.24-etchnhalf.1-486


Disable PIN-code

Install minicom:

apt-get install minicom

Prepare this minicom config file:

> cat /etc/minicom/minirc.ttyUSB0

# Machine-generated file - use "minicom -s" to change parameters.
pu port             /dev/ttyUSB0
pu baudrate         230400
pu bits             8
pu parity           N
pu stopbits         1
pu minit            ATZ

Connect using (disconnect using ctrl-A, Q):

> minicom ttyUSB0

Some AT-commands (reference only):

# Show model and EMEI number:
Manufacturer: huawei
Model: E220
IMEI: 354111128111119

# show registers

# provide pin-code:

# Get the network signal strength: the first value.
# Typical values from 5 to 22.
# Minimum acceptable for reliable connections is 12.
+CSQ: 16,99

# (replace xxxx with your own PIN)
# Turn off the PIN question

# To turn the PIN question on again, type

# Check if the PIN question is on or off.
# "+CLCK: 0" PIN is off, "+CLCK: 1" the PIN is on.
+CLCK: 1

Disable PIN procedure in minicom:

# first login with PIN

# disable PIN, providing PIN again:

# check if disabled (0=disabled, 1=enabled)
+CLCK: 0

Set PPP interface

Install wvdial:

apt-get install wvdial

Add the ppp0 interface:

> cat /etc/network/interfaces

auto ppp0
iface ppp0 inet wvdial
 provider VodafoneNL
 # NOTE: "provider VodafoneNL" will call 'wvdial VodafoneNL'
 # and this uses the section [Dialer VodafoneNL] in /etc/wvdial.conf 

Add this file, which is used to start the PPP connection: (note: no other pppd/chat file is required)

> cat /etc/wvdial.conf 

[Dialer Defaults]
Phone = 
Username = 
Password = 
New PPPD = yes

[Dialer VodafoneNL]
Modem = /dev/ttyUSB0
Baud = 460800
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Init3 =
Area Code =
Phone = *99#
Username = ppp
Password = ppp
Ask Password = 0
Dial Command = ATDT
Compuserve = 0
Force Address =
Idle Seconds = 0
DialMessage1 =
DialMessage2 =
ISDN = 0
Auto DNS = 1 
Auto Reconnect = 1
Dial Attempts = 0

Start, Stop and test the ppp0 interface

ifup ppp0
ifdown ppp0

The “auto” keyword in /etc/network/interfaces will do a “ifup” automatically at boottime.

Check and restart after failure

This script will check and restart the ppp0 interface, should the connection be down (e.g. replug of USB-modem)

> cat /usr/local/bin/

# (c)2009 John de Graaff

# add in crontab:
# cat /etc/crontab
# */1 * * * * root /usr/local/bin/


MSG="$0 (PID:$$) started"
echo $MSG


PID=`pidof $PROG`
if test "$PID" != "" ; 
	echo "$PROG seems to be running (PID: $PID)..."
	exit 0

MSG="$0 (PID:$$): $PROG not running!! Starting $PROG now ..."
echo $MSG

CMD="/sbin/ifdown ppp0"
MSG="$0 (PID:$$): executing cmd: $CMD "
echo $MSG

sleep 2

CMD="/sbin/ifup ppp0"
MSG="$0 (PID:$$): executing cmd: $CMD "
echo $MSG

exit 0

Make the script executable:

chmod +x /usr/local/bin/ 

Add this line to the crontab:

> cat /etc/crontab 

*/1 * * * * root /usr/local/bin/

Make the cron daemon reload the config file:

> /etc/init.d/cron reload

Light Indicators

Light colour Explanation
Green blinking A GPRS network has been found and the modem is ready to connect
Green solid Connected to a GPRS network - data being sent and received
Blue blinking A 3G network has been found and the modem is ready to connect
Blue solid Connector to 3G network
Light blue solid Connected to a HASDPA network
/var/www/html/ · Last modified: 2019/03/06 07:33 (external edit)