07 February 2010

Huawei E220 USB Modem on Linux (conf files for 3Ireland)


I don't use it anymore since 2008, but before I forget everything, I'd like to share the files/scripts that took me so long to compile in order to make it work. Just in case, I was using Linux Debian.

The modem is great, but 3Ireland is not so great.

Files to modify

/etc/ppp/files ? Not sure about this.


============================== /etc/resolv.conf ==========================================

# 3 IRELAND
nameserver 172.31.140.69
nameserver 172.30.140.69
#
nameserver 62.36.225.150
nameserver 62.37.228.20
===================== end of  /etc/resolv.conf =======================================================

========================== /etc/ppp/peers/provider ============================================                                                                     

# These are the options to dial out to your default service provider.
# Please customize them correctly. Only the "provider" file will be
# handled by poff and pon (unless with extra command line arguments).

## You usually need this if there is no PAP authentication
#noauth
#
## The chat script (be sure to edit that file, too!)
#connect "/usr/sbin/chat -v -f /etc/chatscripts/provider"
#
## Set up routing to go through this PPP link
#defaultroute
#
## Default modem (you better replace this with /dev/ttySx!)
#/dev/modem
#
## Speed
#38400
#
## Keep modem up even if connection fails
#persist
#
#
#
#======================== 3 Ireland ==================================



connect "/usr/sbin/chat -V -v -f /etc/chatscripts/pap -T *99#"
user "user"
noauth

# Serial device to which the modem is connected.

#/dev/modem
#/dev/ttyS0
#/dev/ttySL0

# ------ ESTA NO
/dev/ttyUSB0
#/dev/usb/ttyUSB0


# Speed of the serial line.
460800

# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault

# Try to get the name server addresses from the ISP.
#usepeerdns

# Use this connection as the default route.
defaultroute

# Makes pppd "dial again" when the connection is lost.
persist

# Do not ask the remote to authenticate.
#noauth

# Be extra verbose
debug

# pppd will detach from controlling terminal when connection is up
updetach

# no compression - ppp is used only until the modem
novj
novjccomp
nopcomp
nodeflate

# put in a default gateway even if one was present before
replacedefaultroute

# if connection has failed, redial in this number of seconds
# don't use too low - 3 seems to drive modem crazy
holdoff 5
========================== end of /etc/ppp/peers/provider ============================================                                                                     

                                                                     

===================================== /etc/chatscripts/pap =================================================


# You can use this script unmodified to connect to sites which allow
# authentication via PAP, CHAP and similar protocols.
# This script can be shared among different pppd peer configurations.
# To use it, add something like this to your /etc/ppp/peers/ file:
#
# connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T PHONE-NUMBER"
# user YOUR-USERNAME-IN-PAP-SECRETS
# noauth

# Uncomment the following line to see the connect speed.
# It will be logged to stderr or to the file specified with the -r chat option.
#REPORT CONNECT

#ABORT BUSY
#ABORT VOICE
#ABORT "NO CARRIER"
#ABORT "NO DIALTONE"
#ABORT "NO DIAL TONE"
#"" ATZ
#OK ATDT\T
##CONNECT ""
##
##

ABORT BUSY
ABORT VOICE
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
"" ATZ
OK ATE0V1&D2&C1S0=0+IFC=2,2
OK AT+CGDCONT=1,"IP","3ireland.ie"
OK ATDT*99#
CONNECT ""


===================================== end of /etc/chatscripts/pap =================================================


This is the script I call after connecting the modem and waiting a few seconds.



============================= /where/you/want/connect3Ireland.sh ==================================================
#!/bin/bash


echo -e "\n Bringging up/down network interfaces."
sudo ifconfig eth1 down && sudo ifconfig eth0 down && sudo ifconfig lo up && echo "Done!!" || echo "NOT Done.!!!!!!!!"

echo -e "\n rmmod usb_storage"
sudo rmmod usb_storage && echo "Done." || echo "NOT Done.!!!!!!!!"

echo -e "\n modprobe usbserial vendor=0x12d1 product=0x1003"
sudo modprobe usbserial vendor=0x12d1 product=0x1003 && echo "Done." || echo "NOT Done.!!!!!!!!"


echo -e "\n Now, pon"
# and then (as user)
pon && echo "Miaaauuuu.......!!!!" || echo "Grrrrr.... :o( "

# Check the mail
kmail --check


exit
============================= end of /where/you/want/connect3Ireland.sh ==================================================



Caveats:

- Do not use usb extension cables, unless it works well with your modem. In my case the speed was lower and the modem was getting very hot.
- You have to wait a few seconds for the (blue I believe) signal to run the script.
- The SIM inside the modem, you have to put it on a mobile and remove the PIN protection.





Many months after I stopped using the 3G service I wanted to unlock the modem. I paid it in full but 3Ireland had no obligation (according with Irish law) to unlock it and they didn't do it.
The reason is that I wanted to use the modem to make backups of my SIM cards (5+ at the moment).


================= To unlock this Huawei E220 USB Modem:

From windows (you can do it from a Windows in a Virtual Machine too).
In about 20 min.
If any step fail, try again SLOWLY. BE PATIENT.
http://www.seejay.net/2009/02/how-to-unlock-huawei-e220-hsdpa-modem.html

0 Comments:

Post a Comment

<< Home

Too Cool for Internet Explorer