Skip to content

NCM with Huawei E3372 #84

Closed
Closed

Description

@halms

I have been trying to get my E3372 to work in NCM-Mode in the current trunk.
This has been working quite well for a while now, when manually sending the AT^NDISDUP,1,1,"apn" to /dev/ttyUSB0, and setting the wwan0 to proto dhcp.
(provided that all the necessary packages, esp. kmod-usb-net-huawei-cdc-ncm are installed)

But using the builtin (i.e. setting the proto for wwan0 to wwan or ncm) tools, it did not work at all.

  1. proto wwan
    There the issue is, that the Stick has USB Vendor/ProductID 12d1:1506 and is therefore recognized as something else, which defaults to using ppp instead of ncm

I don't know if the E367/E398 support NCM, but if yes then it would probably be a good idea to change that.

  1. proto ncm
    When forcing the protocol to ncm this all gets handled by ncm.sh and ncm.json

And there are a few issues at hand:
ncm.sh uses getcardinfo.gcom to select the device manufacturer, but my stick returns the line just "Manufacturer:" without anything which leads to an empty string. This then leads to all the sent commands being empty which does obviously not work.

When fixing the manufacturer string to "huawei" in ncm.sh, it basically works, but then the initialization fails at the AT+CGDCONT=1,... command, which the stick does not support.
From what my tests have shown, the stick does not need any initialization at all besides the AT^NDISDUP,1,1,...

In order to create a clean solution, I would recommend:
Somehow reworking the ncm.sh in order how to decide which commandset to use. Maybe a similar way as in wwan.sh could be possible? (selection based on USB Vendor&DeviceID).

And as it is clear now that not all devices by one manufacturer need the same commands, a bit more differentiation will be needed in ncm.json.

I'm definitely willing to help to resolve this issue, but I'm not yet familiar enough with the codebase to come up with a solution all on my own.

Activity

  1. adrianmihalko commented on Oct 17, 2017

    @adrianmihalko

    Any update on this? I can't use my Huawei modem with OpenWRT/LEDE.

    The guide is useless:

    https://wiki.openwrt.org/doc/recipes/ethernetoverusb_ncm

  2. halms commented on Oct 18, 2017

    @halms
    Author

    I digged into this a bit back then copied a bit together a "new" protocol.
    It is basically still just writing the AT^NDISDUP to a device file, but automates this a bit better.

    As before, the packages kmod-usb-net-huawei-cdc-ncm and probably usb-modeswitch have to be installed.

    The following files need to go under /lib/netifd/proto
    https://gist.github.com/halmi/70ac29a31878f8675366459a3a4b9fe2
    There are two variants, but I mainly used the huawei_dhcp one.

    I then configured the interface as

    config interface 'lte'
      option ifname 'wwan0'
      option proto 'huawei_dhcp'
      option device '/dev/cdc-wdm0'
      option apn 'drei.at'

    Took me quite a while to figure all this out, but it has been running very nicely for over a year now.

  3. adrianmihalko commented on Oct 18, 2017

    @adrianmihalko

    Hello Halmi,

    I have kmod-usb-net-huawei-cdc-ncm installed, but I have no device /dev/cdc-wdm0.

    Issuing command:

    echo -e "AT^NDISDUP=1,1,"internet"\r" > /dev/ttyUSB0

    ...the LED on the modem constantly lit, which means it is connected to the network.

    I have no idea why I don't have /dev/cdc-wdm0 device, do you have any idea?

    [   16.049007] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
    [   16.050224] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
    
    lsusb:
    
    Bus 002 Device 002: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/N
    etworkcard
    

    usbmode -l is empty, interesting. But If I am not wrong it must works, because 12d1:1506 is a modified indentifier.

    In rPi where I have this modem working I have modeswitch config:

    cat /etc/usb_modeswitch.d/12d1\:14fe 
    DefaultVendor=0x12d1
    DefaultProduct=0x14fe
    
    TargetVendor=0x12d1
    TargetProductList="1506,150f,151d"
    HuaweiNewMode=1
    
  4. adrianmihalko commented on Oct 18, 2017

    @adrianmihalko

    Edit:

    Ok I reinstalled everything, including Lede on rPi. I installed kmod-usb-net-huawei-cdc-ncm as you suggested.

    Now, /dev/cdc-wdm0 is recognized correctly.

    Installed /lib/netifd/proto/huawei_dhcp.sh, chmod +x…

    Created network interface in /etc/config/network as you wrote.

    Result: It's working. Yeah. :)

    1, it does not connect on start. How do you manage this?
    2, What happens if there is a network problem, do you monitor your connection and in case restart the interface? Or just simple problem the dhcp from your ISP expiring, I think you need to restart interface too.

  5. nixnuex commented on Nov 11, 2017

    @nixnuex

    Tried the huawei_dhcp with my Huawei 3372 non-HiLink USB LTE Adapter and it worked out of the box! Thanks a lot! Started up automatically on boot, will see if it always stays online.

  6. added a commit that references this issue on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions