OpenWrt Forum Archive

Topic: [SOLVED]Huawei E303 HiLink as serial modem

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

Hello all,

I'm quite new to OpenWrt and i'm impressed about it!!!

Atm I'm using TP-Link WDR4300 and a Huawei E303WS  UMTS Dongle with HiLink technology on  ATTITUDE ADJUSTMENT 12.09, r36088

So far everything is running, when the PIN code is deactivated on the SIM over the browser of my PC before using it on the router.

Because the WDR4300 will be positioned far away, i like to protect the SIM with the PIN.

My eth1 is the "virtual" eth interface using the usb Dongle to get the internet connection.
wan2 is connected to the eth1

As soon as i active the PIN Protection on the E303 dongle no internetconnection can be initiated, which is logical and good.

Now my question is: where i have to setup the pincpode using cdc_ether???

In /etc/config/network  eth1 isn't shown, only my wan2, but there the option pincode 'XXXX' doesn't change anything.

Thanks in advance!!!!
DerBasser

(Last edited by DerBasser on 11 Oct 2013, 14:47)

config interface 'wan'
        option proto '3g'
        option service 'umts'
        option device '/dev/ttyUSB0'
        option apn 'internet'
        option pincode '1234'

Do you have 'comgt' installed?

Hi neryba,

thanks for your answer!

comgt is installed

but ls /dev/ doesn't show any ttyUSB device at all.

But the USB is working because the cdc_ether is created correctly and with deactivated PIN on the SIM its working as well...

*EDIT*

/etc/modules.d/60-usb-serial

usbserial vendor=0x12d1 product=0x14db

(Last edited by DerBasser on 11 Oct 2013, 12:22)

install kmod-usb-serial-option and

echo "12d1 14fe" > /sys/bus/usb-serial/drivers/option1/new_id

it will detect your modem

kmod-usb-serial is installed as well

kmod-scsi-core     3.3.8-1
    kmod-scsi-generic     3.3.8-1
    kmod-usb-acm     3.3.8-1
    kmod-usb-core     3.3.8-1
    kmod-usb-net     3.3.8-1
    kmod-usb-net-cdc-ether     3.3.8-1
    kmod-usb-net-rndis     3.3.8-1
    kmod-usb-ohci     3.3.8-1
    kmod-usb-serial     3.3.8-1
    kmod-usb-serial-option     3.3.8-1
    kmod-usb-serial-wwan     3.3.8-1
    kmod-usb-storage     3.3.8-1
    kmod-usb-uhci     3.3.8-1
    kmod-usb2     3.3.8-1
    kmod-wdt-ath79     3.3.8-1

And the echo gives me following error:

can't create /sys/bus/usb-serial/drivers/option1/new_id: nonexistent directory

ls: /dev/ttyU*: No such file or directory

lsusb:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 004: ID 12d1:14db Huawei Technologies Co., Ltd.

/etc/config/network

config interface 'wan2'
    option ifname 'eth1'
    option proto 'dhcp'
    option dns '8.8.8.8'

cat /proc/bus/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  2, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 3.03
S:  Manufacturer=Linux 3.3.8 ehci_hcd
S:  Product=Generic Platform EHCI Controller
S:  SerialNumber=ehci-platform
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0608 Rev=77.64
S:  Product=USB2.0 Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  4 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=14db Rev= 1.02
S:  Manufacturer=HUAWEI
S:  Product=HUAWEI HiLink
C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether
E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=06 Prot=00 Driver=cdc_ether
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms

(Last edited by DerBasser on 11 Oct 2013, 12:37)

Thanks for the Link!

My problemis not to configure the inbuild UMTS modem with my browser.

My problem is, that there are only following option over the webinterface
PIN activated, will ask every time for the pin -> not practical for remote Systems
PIN deactivated to unsecure for public remote Sticks ;(

With the deactivated PIN the UMTS is working perfectly!

So my main question is , is there any way to activate the pin on the sim, but the openwrt manages to enter the pincode after booting?

I recently digged out my Huawei E303s-2 and plugged it to my TP-Link TL-WR1043NDv2 running Chaos Calmer stable release.
Reason enough to necropost in this thread...

The E303 is always being discovered as  -or should I write: 'modeswitched to' a CDC device.
It turned out, that /etc/usb-mode.json switches 12d1:1f01 to 12d1:14db.

The message content, that will initialize a serial modem "55534243000000000000000000000011060000000000000000000000000000", is missing in the json's messages array there.

The block for 12d1:1f01 in the original usb-mode.json is:

"12d1:1f01": {                                         
                        "*": {                                         
                                "t_vendor": 4817,                       
                                "t_product": [ 5339, 5340 ],           
                                "mode": "HuaweiNew",                   
                                "no_driver": true,                     
                                "msg": [  ]                             
                        }                                               
                },

So target devices are 14db an 14dc. (=CDC)

I tried to supply an additional, custom config, but that was inconclusive:

As a result of that custom modeswitch I am getting three modem ports, for a device with the ids 12d1:1001, but the original usb-modeswitch contained another modeswitch ...

"12d1:1001": {                                         
                        "*": {                                         
                                "t_class": 255,                         
                                "mode": "Huawei",                       
                                "msg": [  ]                             
                        }                                               
                },

The modem is being switched back an forth in between these, rendering it unusable.


Hence I replaced the usb-mode.json with a file containing the following:

{
"messages" : [
        "55534243000000000000000000000011060000000000000000000000000000"
],
"devices" : {
    "12d1:1f01": {
        "*": {
            "t_vendor": 4817,
            "t_product": [ 4097, 5339, 5340, 7937 ],
            "msg": [ 0 ],

        }
    },
}
}

Now I am getting a "stable" 12d1:1001 with three modem ports, that I can talk to through socat:

socat - file:/dev/ttyUSB0,raw,echo=0,crtscts,crnl

But I seem to be unable to connect with this... ATD*99# throws "NO CARRIER".

(The modem is unlocked, it's working flawlessly on Ubuntu Linux 14.04 LTS).


I am wondering why now OpenWRT seems to use HiLink modes on those modems? I would have expected, that users would prefer to let their routers do PPP and NAT to circumvent problems of NAT trunks on the one hand or to use officially assigned IPs over mobile internet directly in order to use port forwards and such. (Here in Austria you can apply for a non RFC1918 IPv4 address at least at Hutchison Drei (3) using "Open Internet" oder with VOLmobil (and probably others) in exchange for a monthly extra rate.

Who is the maintainer of the json-style usb-modeswitch?
What is the official strategy of OpenWRT developers to cope with 3G/4G modems?

Update: It seems, that the on the OpenWRT wiki the basic recommendation is not to install the usb-modeswitch in these cases...
I'd suggest to keep to different modeswitch-DBs - one for those preferring serial mode (which I guess are almost all OpenWRT users in favour of network neutrality) and one for the easy to use snapshots (using hilink).

(Last edited by epek on 7 Nov 2015, 11:44)

The discussion might have continued from here.