Sunday, 13 July 2008

HOWTO: 3G Connection to Internet with Huawei E220

The following guide is adapted from a guide found on the Ubuntu forms here. I have updated it with information from my own experiences setting this up for use with the Australian 3G Vodafone network on a kubuntu system, with kernel 2.6.24-19-generic.

Installation

This HOWTO is intended to get a Huawei E220 modem working properly any time you plug it in. I've documented what worked for me with the hope it works for you too:

  • Open a terminal and make sure you have the tools you will need:
    sudo apt-get install wget libusb-dev build-essential

  • Get the source code for the driver program huawei-e220:
    wget http://download386.mediafire.com/ddemxzdoxslg/l5jtywnmycn/huawei-e220.tar.gz

  • Compile it:
    tar zxvf huawei-e220.tar.gz

    cd huawei-e220

    ./setup.sh

  • The setup script installs the driver program and creates a udev rule which ensures that the huawei-e220 driver is loaded every time the modem is plugged in. It also runs a quick test, using the wvdial program. You can customise the wvdial.conf
    You can review these udev rules by viewing:
    vim -R /etc/udev/rules.d/50-huawei-e220.rules

    This should show:
    SUBSYSTEM=="usb", SYSFS{idProduct}=="1003", SYSFS{idVendor}=="12d1", RUN+="/usr/local/bin/huawei-e220"

    SUBSYSTEM=="usb", SYSFS{idProduct}=="1003", SYSFS{idVendor}=="12d1", RUN+="/bin/sleep 5"

    SUBSYSTEM=="usb", SYSFS{idProduct}=="1003", SYSFS{idVendor}=="12d1", RUN+="/sbin/modprobe usbserial vendor=0x12d1 product=0x1003"

  • After you plug the modem in you will see the following devices:
    ls /dev/ttyUSB*

    /dev/ttyUSB0 /dev/ttyUSB1
    This means that the modem is communicating properly with your computer.
    By default the modem is connected to /dev/ttyUSB0.

  • For convenience, create a symbolic link from USB0 to modem:
    ln -sf /dev/ttyUSB0 /dev/modem

  • Configure your connection. Using kppp create a modem:
    In the Modem tab, set
    Modem port to: /dev/modem
    Give the Australian phone number of: *99***1#
    Provide a dummy user id and password, I used: vodafone / vodafone

Problems


  • The first time I installed this, everything worked out OK. The following morning I encountered a strange problem of having a successful connection, where email worked, lynx worked, but firefox and other graphical browsers didn't. In the end I saw that the default gateway was invalidly set to 0.0.0.0, see results from command:
    route -n

    So I had to reset this using:
    route del default gw 0.0.0.0route add default gw 10.64.64.64
    That seemed to do the trick ... momentarily. When I rebooted knetworkmanager had once again reset my default gateway. This time when I quit knetworkmanager I asked it not to automatically load on restart.

  • Why doesn't the vodafone dialup show in knetworkmanager? This is a known problem and may have something to do with knetworkmanager running as root, while kppp was ran as a local user. I added the configuration manually to knetworkmanager, but still no go. So, as a work around I use just kppp from the local user., and ensure that knetworkmanager is not running.

References

No comments: