OpenWRT 8.09 plus Huawei E220

Now that OpenWRT 8.09 has been released, I finally took the time to write down my notes on how to use it together with the Huawei E220 dongle, which supports 3G/HSDPA.

Huawei E220

The writeup on how to do this is long, so I put it at a separate page:
http://josefsson.org/openwrt/dongle.html

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Tags: , , , , , ,

20 Responses to “OpenWRT 8.09 plus Huawei E220”

  1. Mikko says:

    Hey,

    Thanks for the guide!
    Do you know if there is any easy way to do this on demand? I mean to use the 3G as a backup for the regular connection. If the normal connection doesn’t work it would automatically (or some other way easily) switch to 3G.

  2. simon says:

    Mikko: Good questions, I don’t think this is easy to achieve with OpenWRT but I’d love to be proven wrong. I am aware of this work but there are no openwrt packages for it:

    http://lsm.foobar.fi/

    Maybe someone could port it..

    /Simon

  3. arran says:

    Good guide. Worked very well. Instead of using usb-serial, you can also use the option driver (depends on usb-serial), which provides better speeds. Didn’t even have to provide vendor/product id with option.

    However, even though the modem works, I can’t get it to forward/masquerade traffic to my local lan. Was that never an issue for you?

  4. szögi says:

    Hi!

    Nice howto! You can use ‘enable’ for init scripts instead symlinking.
    Eg. ‘ln -s ../init.d/open-wan-ssh-port /etc/rc.d/S90open-wan-ssh-port’ - ‘/etc/init.d/open-wan-ssh-port enable’. Seems better. :)

  5. simon says:

    szögi: thanks! I have updated the writeup.

  6. dietmar schmidt says:

    im testing with an E160 it works.
    A notice in the documentation abouth /etc/chatscripts ATDT would be helpful.
    Not all providers have the same number. For example “ATDT*99#”

    also problems with dns
    the ip for the dns servers from my provider 10.11.12.13 are not functional.
    i need en entry in /etc/system/network
    option ‘peerdns’ ‘0′ and option ‘dns’ ‘ipaddress1′
    i need en entry in resolv.conf nameserver ipaddress1
    i need en entry in /etc/dnsmasq.conf dhcp-option=6,ipaddress1,ipaddress2

  7. niknik says:

    Great, very very nice Simon. Thanks Thanks. A lot of providers use the HUAWEI model E169 (like in my case TIM in ITALY) so I changed the module file as follow:

    #####################################
    root@caramel:/# cat>/etc/modules.d/60-usb-serial
    #for E220
    usbserial vendor=0×12d1 product=0×1003 maxSize=4096
    #or for E169
    #usbserial vendor=0×12d1 product=0×1001 maxSize=4096
    root@caramel:/# reboot
    #######################################

  8. Martin says:

    Thanks for that! Two things: If using ‘ppp0′ the ip forwarding did not work for me - had to use ‘wan’. And my provider needed a ‘username’ and ‘password’ in the ppp0. It could be set to any value but needed to be there.

  9. I read your howto with great interest. I am trying to do somthing similar, that is, use OpenWRT on an ALIX board with Ubiquiti PCI radio as a router to extend range of WiFi for my clients. (see web site). I must have somthing wrong because the wifi network does not get an IP address.
    Can you email me a copy of your /etc/config/network and etc/config/wireless. I must be missing somthing. Or, could it be in the firewall? I see your wireless config in the howto but not your network file so these would be most helpful.

  10. Calin Rus says:

    Hi Simon,

    thanks a lot for your howto. Half a year ago, I spent many hours to get my Asus WL500gp to work with my 3G dongle using some shady czech(?) firmware, but it did’t work. Now with your howto and OpenWrt ist worked straight away, even though my 3G dongle (Web’n'walk Stick IV from T-Mobile Germany) is a Huawei e176 clone, not e220. But vendor/model correspond to your howto (12d1/1003). Odd, but it works. The same with another noname dongle (I’m not even sure it’s Huawei) i tried briefly: it works without modification. So thanks again, nice work.

    Greetings, Calin

  11. Carlo D'Ippolito says:

    Hi Simon,

    your howto is great!!!

    I want use your howto to get my Asus WL500W (n wireless) to work with my Huawey E220 but I would not like to use OpenWRT but X-WRT variant.

    Is possible? or I need some modification of the procedures?

    Thanks in advance

    Carlo

  12. Emerson Gomes says:

    Hello Simon,

    I just would like to congratulate you on this tutorial, it helped a lot! Keep up the good work!

  13. ostbernd says:

    Great guide, thanks a lot!

    But: cat somefile| sed dosomething > somefile isr pretty useless. The easiest way is: sed -ei s/search/replace/n somefile.

  14. Davide says:

    i’ve applied successfully your guide.

    I have a billing plan that is flat only if i’m connected to a specific network (HSDPA, 2100MHz, provider:TRE)

    is there any way to add support to check/configure the network settings of the usb modem (better if via the webGUI)?

    Thank you in advance

    Davide

  15. pepenue says:

    I can not connect 3g
    pleas help me.
    What is the problem?

    [/config/network]

    config ‘interface’ ‘ppp’
    option ‘ifname’ ‘ppp’
    option ‘proto’ ‘3g’
    option ‘device’ ‘/dev/ttyUSB1′
    option ‘username’ ‘MOVISTAR’
    option ‘password’ ‘MOVISTAR’
    option ‘apn’ ‘movistar.es’

    [ifup ppp]

    SIM ready
    PIN set successfully

    [logread]

    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: abort on (BUSY)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: abort on (NO CARRIER)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: abort on (ERROR)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: report (CONNECT)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: timeout set to 10 seconds
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: send (AT&F^M)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: expect (OK)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: AT&F^M^M
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: OK
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: — got it
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: send (ATE1^M)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: expect (OK)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: ^M
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: ATE1^M^M
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: OK
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: — got it
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: send (AT+CGDCONT=1,”IP”,”movistar.es”^M)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: timeout set to 30 seconds
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: expect (OK)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: ^M
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: AT+CGDCONT=1,”IP”,”movistar.es”^M^M
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: OK
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: — got it
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: send (ATD*99***1#^M)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: expect (CONNECT)
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: ^M
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: ATD*99***1#^M^M
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: NO CARRIER
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: — failed
    Jan 1 00:16:05 OpenWrt local2.info chat[1545]: Failed (NO CARRIER)
    Jan 1 00:16:05 OpenWrt daemon.err pppd[1474]: Connect script failed

  16. Phil says:

    Thanks for the very clear instructions. It’s been working for me for about one week now with an Australian Virgin Mobile supplied Huawei E1762 USB broadband dongle. Throughput is pretty much the same as under Windows.

    One problem is that it seems to disconnect from the internet after about one day or so. It comes back online after rebooting the router.

    What would be the easiest way to monitor the health of the connection and reboot if the connection drops out for say 5 minutes - and then continues rebooting if the connection doesn’t come back 5 minutes after reboot?

    Cheers,
    Phil

  17. Delix says:

    2 pepenue
    I had the same shit. The problrem was in following line
    option ‘device’ ‘/dev/ttyUSB1′
    Just try ttyUSB0
    ‘device’ ‘/dev/ttyUSB0′
    It works for me.
    I used D-Link DIR 320 with Huawei E219 3g modem.
    Btw the pincode was desibled.

  18. Jeffrie says:

    Great guide, thanks a lot!
    But I am still having troubles logging into the router using SSH from an foreign internet address.
    Wenn I am using the WAN port and also connect this port wired, than everythings working fine.
    As soon as I am switching on to the 3G connection, I can access internet, but can’t access the router with SSH over the internet.
    Do you have any idea? Hope so…

    Kind regards
    Jeffrie

  19. Keith says:

    Thanks for the great guides - we’ve been using it for a few years now on 7.09 (Kamikaze) with no problem on a WRTG54G3G

    However, today I tried installing 10.03 (Backfire) and it refuses to see the PCMCIA card (I have tried a Huawei E800 and E620)

    root@router:~# cardctl status
    no pcmcia driver in /proc/devices

    root@router:~# opkg list-installed | grep pcm
    kmod-pcmcia-core - 2.4.37.9-1
    kmod-pcmcia-serial - 2.4.37.9-1
    pcmcia-cs - 3.2.8-1

    root@router:~# uname -a
    Linux router 2.4.37.9 #42 Tue Apr 6 15:59:04 CEST 2010 mips GNU/Linux

    Any ideas, please?!

  20. Keith says:

    Just to feedback…. All I had to do was run:

    insmod ds

    …and that fixed the probelm

Leave a Reply


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.