Huawei E220

From Gentoo Linux Wiki

Jump to: navigation, search
Please format this article according to the Style Guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article.

Reason(s):

This guide is written for people who want to use their UMTS/HSDPA Card with Gentoo Linux. The first part of this guide will tell you what kernel options you will need to get the hardware working. The next part will be the configuration for the datacard to establish a ppp connection to your provider. In the explained case the provider is SFR from France.

Contents

[edit] Kernel configuration

USB to Serial converter for the Modem is necessary. To establish the PPP connection to the provider, ppp support also has to be enabled in the kernel.

Linux Kernel Configuration: 2.6.27-gentoo-r8 - USB and PPP setup
Device Drivers ->
    USB support  --->
        <M> OHCI HCD support (If not use Intel or VIA chipset)
        <M> UHCI HCD (most Intel and VIA) support (If use Intel or VIA chipset)
        <M> USB Serial Converter support  --->
            [*] USB Generic Serial Driver
            <M> USB driver for GSM and CDMA modems
    Network device support  --->
        <*> PPP (point-to-point protocol) support
        <*> PPP support for async serial ports

Recompile the kernel and reboot or/and load the newly enabled modules.

[edit] Hardware detection

After loading the necessary modules, plug the modem and wait for a few seconds and check that ttyUSB* devices are created.

dmesg
 usbserial: USB Serial support registered for GSM modem (1-port)
 option: USB Driver for GSM modems: v0.7.2
 option 4-1:1.0: GSM modem (1-port) converter detected
 usb 4-1: GSM modem (1-port) converter now attached to ttyUSB0
 option 4-1:1.1: GSM modem (1-port) converter detected
 usb 4-1: GSM modem (1-port) converter now attached to ttyUSB1

In this case ttyUSB0/1 are created, this might differe if you already have others usb/serial controllers pluged. Check that devices are actually created.

ls -l /dev/ttyUSB*
 crw-rw---- 1 root uucp 188, 0 2009-03-15 17:48 /dev/ttyUSB0
 crw-rw---- 1 root uucp 188, 1 2009-03-15 17:48 /dev/ttyUSB1

Vendor and Product ID can be found by typing lsusb command

lsusb
 Bus 004 Device 003: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem

Last thing to do regarding hardware is to make sure that the user has access to serial port, it has to be a member of the uucp group.

In some cases you'll need to use sys-apps/usb_modeswitch software to disable an embedded usb storage

[edit] Software

[edit] KDE kppp

You need have net-dialup/ppp first.

emerge -av ppp
emerge -av kppp

In Model table, add a new model at /dev/ttyUSB0 (or others), Flow control set to Hardware, termination = CR and speed = 460800. Add extra command at Modem table if you need enter PIN password

 AT+CPIN= [your PIN]

Add a new account and tel number please refer for wvdail session as your telcom setting. For Chunghwa Telcom is

 *99#

Input both Username and password are dummy.

[edit] Vodafone

Vodafone provide a nice UI interface write in python, but only one version seems to work (sometimes) with gentoo

 https://forge.betavine.net/frs/download.php/267/vodafone-mobile-connect-card-driver-for-linux-2.0.beta3.tar.gz

[edit] wvdial

You need have net-dialup/ppp first.

emerge -av ppp

To establish the connexion emerge wvdial if not done yet and edit its configuration file with root priviledges. Below is an example of a configuration used for SFR network in France, you will have to search for a configuration that suits your provider:

nano /etc/wvdial.conf
 [Dialer Defaults]
 Baud = 460800
 ISDN = false
 Init1 = AT+CPIN=6451
 Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
 Init3 = AT+CGDCONT=16,"IP","websfr"
 Modem = /dev/ttyUSB0
 Modem Type = Analog Modem
 username=dummy
 password=dummy
 Phone = *99***16#

Nota: For SFR in France you may have to use this configuration if previous one doesn't work for /etc/wvdial.conf

 [Dialer Defaults]
 Modem = /dev/ttyUSB0
 [Dialer pin]
 Modem = /dev/ttyUSB0
 Baud = 115200
 Dial Attempts = 2
 Init1 = ATZ
 Init2 = AT+CPIN=<your pin number>
 Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
 [Dialer Vodafone]
 Init1 = ATZ
 Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
 Init3 = AT+CGDCONT=1,"IP","slsfr"
 Modem Type = Analog Modem
 Baud = 115200
 New PPPD = yes
 Modem = /dev/ttyUSB0
 ISDN = 0
 Dial Command = ATDT
 Phone = "*99***1#"
 Password = "slsfr"
 Username = "slsfr"

and you have to do so to connect

wvdial pin : initialize the modem wvdial Vodafone : connect to internet

This is for Australia's Network 3 (Three):

 [Dialer Defaults]
 Init1 = ATZ
 Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
 Check Def Route = on
 Phone = *99#
 Modem Type = Analog Modem
 Stupid Mode = 1
 Baud = 9600
 Dial Command = ATDT
 Dial Attempts = 3
 Modem = /dev/ttyUSB0
 ISDN = 0
 Password = dummy
 Username = dummy
 [Dialer connect]
 Init2 = ATZ
 Init3 = ATE0V1&D2&C1S0=0+IFC=2,2
 Init4 = AT+CGDCONT=1,"IP","$apn"
 ISDN = 0
 Modem = /dev/ttyUSB1
 Modem Type = Analog Modem
 Baud = 460800

This is for Finland's Network Saunalahti:

 [Dialer Defaults]
 Init = AT+CGDCONT=1,"IP","internet.saunalahti"
 Init1 = ATZ
 Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
 Stupid Mode = 1
 Modem Type = Analog Modem
 Phone = *99***1#
 ISDN = 0
 Username = " "
 Password = " "
 Modem = /dev/ttyUSB0
 Baud = 9600

For Chunghwa Telcom (中華電信) Taiwan :

 [Dialer Defaults]
 Phone = *99#
 APN = internet
 Username = pummy
 Password = pummy
 Stupid Mode = 1
 Dial Command = ATDT
 Modem = /dev/ttyUSB0
 Baud = 460800
 Init1 = ATZ
 Init2 = AT+CPIN= [your PIN password] (if need)
 Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
 ISDN = 0
 Modem Type = Analog Modem 

Now it's time to establish the connection, open a console with your user and run wvdial.

wvdial
 --> WvDial: Internet dialer version 1.60
 --> Initializing modem.
 --> Sending: AT+CPIN=6451
 AT+CPIN=6451
 OK
 --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
 ATQ0 V1 E1 S0=0 &C1 &D2
 OK
 --> Sending: AT+CGDCONT=16,"IP","websfr"
 AT+CGDCONT=16,"IP","websfr"
 OK
 --> Modem initialized.
 --> Sending: ATDT*99***16#
 --> Waiting for carrier.
 ATDT*99***16#
 CONNECT
 --> Carrier detected.  Waiting for prompt.
 --> Don't know what to do!  Starting pppd and hoping for the best.
 --> Starting pppd at Sun Mar 15 18:16:10 2009
 --> Warning: Could not modify /etc/ppp/pap-secrets: Permission denied
 --> --> PAP (Password Authentication Protocol) may be flaky.
 --> Warning: Could not modify /etc/ppp/chap-secrets: Permission denied
 --> --> CHAP (Challenge Handshake) may be flaky.
 --> Pid of pppd: 7930
 --> Using interface ppp0
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> local  IP address 10.162.164.227
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> remote IP address 10.64.64.64
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> primary   DNS address 172.20.2.39
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]
 --> secondary DNS address 172.20.2.10
 --> pppd: ¨·[06][08]½[06][08]Ø·[06][08]

Connection is now established, you can check that the network interface is up and it has an ip address:

ifconfig
 ppp0      Link encap:Point-to-Point Protocol
           inet addr:10.162.164.227  P-t-P:10.64.64.64  Mask:255.255.255.255
           UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
           RX packets:44 errors:0 dropped:0 overruns:0 frame:0
           TX packets:55 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:3
           RX bytes:17688 (17.2 KiB)  TX bytes:6282 (6.1 KiB)

The modem should have a fixed green light if connected in 2G, a blue light if connected in 3G, you should now be connected to the internet.

[edit] See also

[edit] External links

Personal tools