Huawei E220 3G modem on Raspberry pi

Linux kernel has drivers for this modem, so the installation is straight forward:

# apt-get install wvdial

Edit configuration

# nano /etc/wvdial.conf

Modem standard configuration:

Image for post
Image for post
[Dialer Defaults]
New PPPD = yes
Stupid Mode = 1
Modem Type = 3G Modem
Baud = 460800
Modem = /dev/ttyUSB0
ISDN = 0

[Dialer poweron]
Init1 = AT+CFUN=1

[Dialer poweroff]
Init1 = AT+CFUN=0

ISP specific config. Here you have different configurations for two ISPs from Spain.

Movistar:

[Dialer movistar]
Init2 = AT
Init3 = AT&F&D2&C1E0V1S0=0
Init4 = AT+IFC=2,2
Init5 = ATS0=0
Init6 = AT
Init7 = AT&F&D2&C1E0V1S0=0
Init8 = AT+IFC=2,2
Phone = *99***1#
Password = MOVISTAR
Username = MOVISTAR

FreedomPop (Uses masmovil configuration)

[Dialer freedompop]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Init3 =
Init4 = AT+CGDCONT=1,"IP","internetmas","",0,0
Baud = 3600000
Username = off
Password = off
New PPPD = yes
Phone = *99*#
Dial Command = ATDT
Stupid Mode = 1
Compuserve = 0
Force Address =
Idle Seconds = 0
Carrier Check = no
ISDN = 0
Auto DNS = 1
Remote Name = "*"

To dial, type:

# wvdial freedompop

I have deactivated SIM’s PIN for simplicity and I haven’t tested to dial with it, but you could test with:

[Dialer pin]
Dial Command = ATDT
Init = ATZ
Init2 = AT+CPIN=XXXX

then:

# wvdial pin
# wvdial movistar

To test if it has worked sue an ifconfig to see if ppp0 has a valid IP

# ifconfig

To connect at startup edit

# nano /etc/network/interfaces

and add this line

iface ppp0 inet wvdial
provider movistar

As the modem takes some time for initialization we could delay the dialing in

# nano /etc/rc.local

for 20 seconds

sleep 20
ifup ppp0

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store