OpenWrt Forum Archive

Topic: Using Huwaei E1820 on OpenWRT

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

  The following has been used to connect E1820 into OpenWrt- backfire 10.03, with successful
  (top dmesg output)
---------------------------------------------------------------------------------------------------------------------------
Linux version 2.6.32.10 (openwrt@wrt1.marcant.net) (gcc version 4.3.3 (GCC) ) #20 Tue Apr 6 15:53:48 CEST 2010
CPU revision is: 00029007 (Broadcom BCM3302)
ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x09, vendor 0x4243)
ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x07, vendor 0x4243)
ssb: Core 2 found: Fast Ethernet (cc 0x806, rev 0x07, vendor 0x4243)
ssb: Core 3 found: USB 1.1 Device (cc 0x818, rev 0x01, vendor 0x4243)
ssb: Core 4 found: USB 1.1 Host (cc 0x817, rev 0x01, vendor 0x4243)
ssb: Core 5 found: MIPS 3302 (cc 0x816, rev 0x01, vendor 0x4243)
ssb: Core 6 found: MEMC SDRAM (cc 0x80F, rev 0x01, vendor 0x4243)
ssb: Core 7 found: PCI (cc 0x804, rev 0x0A, vendor 0x4243)
---------------------------------------------------------------------------------------------------------------------------

root@openwrt> usb_modeswitch -e
--------------------------------------------------------------

* usb-modeswitch: handle USB devices with multiple modes
* Version 1.1.2alpha (C) Josua Dietze 2010
* Based on libusb0 (0.1.12 and above)

! PLEASE REPORT NEW CONFIGURATIONS !

---------------------------------------------------------------------------------------------------------------------------

  /etc/usb_modeswitch.setup
----------------------------------------------------------------------------------
########################################################
# Huawei E270+  (HSPA+ modem)
# Huawei E1762
# Huawei E1820
#
# Contributor: Paranoid Paranoia

DefaultVendor=  0x12d1
DefaultProduct= 0x1446

TargetVendor=   0x12d1
TargetProduct=  0x14ac

MessageContent="55534243123456780000000000000011060000000000000000000000000000"


/etc/config/network
----------------------------------------------------------------------------------
config 'interface' 'ppp0'
        option 'device' '/dev/ttyUSB0'
        option 'proto' '3g'
        option 'apn' 'INTERNET'
        option 'service' 'hsdpa'
        option 'mtu' '1492'

/etc/modules.d/60-usb-serial
----------------------------------------------------------------------------------
usbserial vendor=0x12d1 product=0x14ac


/etc/rc.d/S95done
----------------------------------------------------------------------------------
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org

START=95
boot() {
        [ -d /tmp/root ] && {
                lock /tmp/.switch2jffs
                firstboot switch2jffs
                lock -u /tmp/.switch2jffs
        }

        # process user commands
        [ -f /etc/rc.local ] && {
                sh /etc/rc.local
        }

        # set leds to normal state
        . /etc/diag.sh
        set_state done
        usb_modeswitch
}

root@openwrt> dmesg
--------------------------------------------------------------
usbserial_generic 1-1:1.0: generic converter detected
usb 1-1: generic converter now attached to ttyUSB0
usbserial_generic 1-1:1.1: generic converter detected
usb 1-1: generic converter now attached to ttyUSB1
usbserial_generic 1-1:1.2: generic converter detected
usb 1-1: generic converter now attached to ttyUSB2
usbserial_generic 1-1:1.3: generic converter detected
usb 1-1: generic converter now attached to ttyUSB3
usbserial_generic 1-1:1.4: generic converter detected
usb 1-1: generic converter now attached to ttyUSB4
usbserial_generic 1-1:1.5: generic converter detected
usb 1-1: generic converter now attached to ttyUSB5
usbcore: registered new interface driver usbserial_generic


root@openwrt> ifup ppp0
--------------------------------------------------------------
SIM ready
PIN set successfully

root@openwrt> ifconfig
--------------------------------------------------------------
ppp0      Link encap:Point-to-Point Protocol
          inet addr:188.140.46.204  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:47 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:3507 (3.4 KiB)  TX bytes:4093 (3.9 KiB)

root@openwrt> ping www.google.com
--------------------------------------------------------------
PING www.google.com (209.85.229.104): 56 data bytes
64 bytes from 209.85.229.104: seq=0 ttl=54 time=170.926 ms
64 bytes from 209.85.229.104: seq=1 ttl=54 time=189.186 ms
64 bytes from 209.85.229.104: seq=2 ttl=54 time=131.618 ms
64 bytes from 209.85.229.104: seq=3 ttl=54 time=130.702 ms
64 bytes from 209.85.229.104: seq=4 ttl=54 time=130.068 ms
64 bytes from 209.85.229.104: seq=5 ttl=54 time=128.887 ms
C64 bytes from 209.85.229.104: seq=6 ttl=54 time=127.449 ms
^C
--- www.google.com ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max = 127.449/144.119/189.186 ms

mv /etc/usb_modeswitch.setup /etc/usb-modeswitch.conf

Install the usb-modeswitch and the usb-modeswitch-data packages.

I'll write my experience with Huawei E1762 and OpenWrt 10.03.1-rc4 here, even though the title says E1820 (this thread seems to be currently the top result in Google for terms "openwrt e1762").

I struggled quite long time following different guides, like this thread and http://josefsson.org/openwrt/dongle.html

Finally the breakthrough for me was to install kmod-usb-serial-option and leave /etc/modules.d/60-usb-serial untouched (ie. don't put any vendor or product code there).
Also I didn't need to create any /etc/usb-modeswitch.conf file. I installed the usb-modeswitch and usb-modeswitch-data packages, though. I also installed a lot of usb related modules during the trial-and-error session, many of those maybe unnecessary, and comgt.

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

(Last edited by Akhwel on 3 Feb 2011, 12:04)

OpenWRT r26276 on TL-MR3420 (v1) with a Huawei E1820.

opkg install comgt kmod-usb-serial-option usb-modeswitch  usb-modeswitch-data
vi /etc/config/network
etc/init.d/network restart

/etc/config/network entry:
config interface wan
        option ifname ppp0
        option device /dev/ttyUSB0
        option proto 3g
        option apn internet
        option service hsdpa

The discussion might have continued from here.