Huawei E303 3G Stick

This article describes how to use the Huawai E303 3G (UMTS) stick with the Raspberry Pi. It might also work for other Huawai models or even for different manufacturers.

The Huawei E303 emulates a regular ethernet interface, which makes it very easy to use. It takes about two minutes to set up and will even support hot plugging. This is much easier than then wvdial approach described in many existing tutorials on the web.

The E303, like many other USB peripherals, defaults to mass storage ("memory stick") mode to provide driver installation files for the OS. Once installed, the driver then switches the device to its actual function. On Linux, however, we don't need to install any driver at all. We will use a small utility called usb-modeswitch to switch the E303 to 3G mode. Install this while the stick is not plugged in:

sudo apt-get install usb-modeswitch

Then add the following two lines to /etc/network/interfaces:

iface eth1 inet dhcp
allow-hotplug eth1

Now plug the stick directly into the Pi. Hubs may interfere with the E303 so be sure to disconnect them for now. Even if the stick is not connected through the hub, the hub may still stop it from working correctly. So first check that everything is working without a hub connected, then connect the hub and test whether it's still working.

Verify that the new interface eth1 is active:

$ ifconfig eth1
eth1      Link encap:Ethernet HWaddr 12:34:56:78:9a:bc
          inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:79 errors:0 dropped:0 overruns:0 frame:0
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9661 (9.4 KiB) TX bytes:6858 (6.6 KiB)

Ping your favorite server to test the connection.

The stick's local web interface is at http://hi.link/ and requires a browser with JavaScript support. Make sure the settings meet your needs. Specifically, enter your SIM card PIN or disable PIN entry. You can also use a regular cellphone to disable PIN entry.

Ready :-) You can unplug and replug the stick at any time.

Troubleshooting

If the 3G stick is not working, try the following steps. This may help isolate the problem. Make sure you're connecting the stick directly and no hub is connected to the Pi at all.

First unplug the stick. Then remove usb-modeswitch if you installed it:

sudo apt-get remove usb-modeswitch

Now plug the stick directly into the Pi and watch it show up in lsusb:

Bus 001 Device 008: ID 12d1:1f01 Huawei Technologies Co., Ltd. E353/E3131 (Mass storage mode)
Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Microchip Technology, Inc. (formerly SMSC) SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Note the ID <vendor>:<product> part. The above values 12d1:1f01 indicate that the E303 is in mass storage mode (newer OS versions actually print that, as shown above) . This is the useless mode that we need to switch away from.

Now (re)install usb-modeswitch:

sudo apt-get install usb-modeswitch

Then unplug and replug the stick. After a few seconds, run lsusb again:

Bus 001 Device 007: ID 12d1:14db Huawei Technologies Co., Ltd. E353/E3131
Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Microchip Technology, Inc. (formerly SMSC) SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Verify that the product part of the ID has changed (from 1f01 to 14db), indicating that the stick is now in 3G mode. If the correct product ID does not show up, then usb-modeswitch could not switch the stick to 3G mode. Otherwise, the stick already is in 3G mode; double-check that /etc/network/interfaces is edited as above.