NSLU2-Linux
view · edit · print · history

These instructions show how to add a Huawei E220 3G modem to a Slug running Debian Etch.

If anybody proves it works on other types of Slugs, please edit this page.

BEFORE YOU START - Check your internet connection using a command such as ping www.google.com. Steps 1-4 need an internet connection from your NSLU2 to the outside world.

 On kernel 2.6.22-2-ixp4xx all you need is wvdial, you can skip 1-9 steps.

It is assumed you are logged into the Slug as root.

1. Get gcc and its standard build environment

 apt-get install build-essential

2. Get the USB libraries

 apt-get install libusb-dev

3. Get the modem dialler

 apt-get install wvdial

4. Fetch utility huaweiAktBbo.c (thanks to Miroslav Bobovsky for this utility)

 wget www.kanoistika.sk/bobovsky/archiv/umts/huaweiAktBbo.c

5. Compile the utility

 gcc -lusb huaweiAktBbo.c -o huaweiAktBbo.out

6. Disable the CD-drive portion of the E220

 rmmod usb-storage

7. Enable the E220 as a USB serial port

 mknod /dev/ttyUSB1 c 188 1
 mknod /dev/ttyUSB2 c 188 2
 modprobe usbserial vendor=0x12d1 product=0x1003

8. This utility re-creates the USB communication which is used in Windows.

 ./huaweiAktBbo.out

9. Edit /etc/wvdial.conf to contain the following text. Note that I use Vodafone Ireland. If you are using anything else, check out the configuration files which are created on a Windows machine by the E220. Even though Vodafone does not use a username or password, I think wvdial needs some dummy values. You must use a provider which matches the SIM card in your modem.

 [Dialer vodafone]
 Phone = *99#
 Username = user
 Password = pass
 Stupid Mode = 1
 Dial Command = ATDT
 Modem = /dev/ttyUSB0
 Baud = 460800
 Init2 = ATZ
 Init3 = ATQ0 V1 S0=0 &C1 &D2 +FCLASS=0
 ISDN = 0
 Modem Type = Analog Modem
 Init4 = AT+CGDCONT=1,"IP","hs.vodafone.ie"

A working wvdial.conf for 3ireland

[Dialer Defaults]
Phone = *99#
Username = 3ireland
Password = 3ireland
Stupid Mode = 1
Dial Command = ATDT

[Dialer 3ireland]
Modem = /dev/ttyUSB0
Baud = 460800
Init2 = ATZ
Init3 = ATE0 V1 &D2 &C1 S0=0 +IFC=2,2
ISDN = 0
Modem Type = Analog Modem
Init5 = AT+CGDCONT=1,"IP","3ireland.ie"

10. Connect device to /dev/ppp0 using the wvdial program (note my wvdial.conf starts with [Dialer vodafone] but you can use what you want). This only works if the modem has been plugged in for about a minute, when the blue light is flashing slowly.

 wvdial vodafone &

11. Set the ppp device as your default route (this is fairly simplistic, you may want to improve this at a later time)

 route add default ppp0

12. Unplug your old internet connection (for example your DSL router or dial-up modem) and test your new connection to the internet. Make sure you don't break the ssh connection from your terminal to the Slug!

 ping www.google.com

13. To use your NSLU2 as internet gateway configure eth0 interface as:

allow-hotplug eth0
iface eth0 inet static
        address 192.168.1.1
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255

Configure iptables (just basic config to make internet working):

iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain


iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT

echo 1 > /proc/sys/net/ipv4/ip_forward

Note: If MASQUERADE is not accepted as an argument, use "apt-get install dnsmasq" to install it.

On your router set an 192.168.1.x address, use 192.168.1.1 as gateway, for DNS I used pppd console output to find the real DNS address.

Sumbitted by bred.hacker hotmail.com 27 June 2007

Huawei he220rc2 installer Refer to http://en.wikipedia.org/wiki/Huawei_E220 Get it free at:

http://upload2.net/page/download/vO1zcUWsn4gdGBW/he220rc2.tar.gz.html http://www.savefile.com/files/1378220

1. After extract tar.gz file, change directories to the file and be the su@superuser@sudo. For installation, firstly you must be a root and run this command:

make install

2.Dial wvdial huawei or sh /etc/mod.sh at terminal or use kppp to dial.

Remark: The device is also easy to use with the SlugOS. You need to install (at least) the following packages: kernel-module-usbserial kernel-module-ppp-generic kernel-module-ppp-async libusb-0.1-dev ppp. First compile huaweiAktBbo as described above. Then load the usbserial module, run huaweiAktBbo and three serial ports ttyUSB{0-2} should appear under /dev. As there was no wvdial package available, I managed to initialize a connection using a simple script:

#!/bin/sh
DEV=/dev/ttyUSB0
echo "ATZ" >$DEV
head -n 2 $DEV
echo 'AT+CGDCONT=1,"IP","web.yesss.at"' >$DEV
head -n 2 $DEV
echo 'ATD*99***1#' >$DEV
head -n 2 $DEV
sleep 1
/usr/sbin/pppd debug nodetach 460800 $DEV
Page last modified on May 13, 2008, at 10:52 AM