Modify

Opened 4 years ago

Last modified 3 years ago

#15328 new enhancement

NCM Protocol support

Reported by: jake1981 Owned by: developers
Priority: high Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: ncm Cc:

Description

Hi.

NCM is used by some 3G/LTE dongles. In some cases, it is also sometimes called as HiLink, but HiLink is a system by Huawei that is not the same as NCM.
But it does have some similarities. In my opinion, it's a hybrid of branches..
Here's some information about how different dongles work:

standard/legacy dongles:

  • initialized by usb modeswitch
  • commanded with set of AT commands
  • interfaced with PPP through serial port
  • provides amount of serial ports (usually 3, control, statistics and connection)

HiLink:

  • possibly not initialized at all
  • not commanded at all, connection is available after plugging in to USB port
  • controlling: with web interface by setting specific ip address range for computer
  • interfaced like any usb rj45 adapter (physically doesn't have rj45 at all and might need a driver)
  • provides network device

NCM:

  • Initialized by usb modeswitch
  • command with set of AT commands
  • provides one or more serial ports and a network devices
  • after connection is initiated with AT commands through serial port, network device reports a link
  • interfaced through network device and connection details are acquired by DHCP (device possibly emulates PPP for a network device???)

Anyway, openwrt has all the basic requirements for NCM dongles to be used, but it requires some scripting and designed connection methods
are more or less useless with manual scripts. I wrote a protocol support named NCM for OpenWrt which allows OpenWrt to gain support for NCM
connection. Another way is to use r00ter firmware which is a fork of OpenWrt, but I'll rather stick with the stock one and install few packages, so
that motivated me.. Also I think, r00ter was doing a lot of things all the time which I think was pretty unnecessary and scripts used by r00ter were
a mess to me..

I made the system modular, it also detects used dongle, but currently provides only support for this one device, but it is easy to create more
AT-command set scripts to support other dongles as well, AT-command sets are provided in different brand/model specific packages so actual
protocol doesn't need to be touched at all when providing support for another device.

I also wrote luci packages. Discussion is available at luci's mailing list here: https://lists.subsignal.org/pipermail/luci/2014-March/001483.html

This patch contains NCM protocol support without drivers for any dongles.

Attachments (1)

ncm101.patch (17.4 KB) - added by jake1981 4 years ago.
NCM protocol support package and package containing AT command set for Huawei e3276

Download all attachments as: .zip

Change History (14)

comment:1 in reply to: ↑ description Changed 4 years ago by jake1981

This patch contains NCM protocol support without drivers for any dongles.

Sorry. This patch contains NCM protocol support and AT command set(driver) support for Huawei e3276 dongle.

Changed 4 years ago by jake1981

NCM protocol support package and package containing AT command set for Huawei e3276

comment:2 Changed 4 years ago by jake1981

Discussion and screenshots available here:
https://forum.openwrt.org/viewtopic.php?pid=218745#p218745

comment:3 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

comment:4 Changed 3 years ago by fabian_unreal@…

This needs to be implemented.

comment:5 Changed 3 years ago by gazambuja@…

  • Dhcp does not work -

Hi, I install the packages and the devices is present now, but I can't get DHCP from LTE/4G dongle:

Fri Dec 19 16:42:32 2014 kern.info kernel: [ 2617.280000] cdc_ncm 1-1:1.2 wwan0: register 'cdc_ncm' at usb-ehci-platform-1, Mobile Broadband Network Device, 0c:5b:8f:XX:XX:XX
Fri Dec 19 16:44:46 2014 kern.info kernel: [ 2751.400000] IPv6: ADDRCONF(NETDEV_UP): wwan0: link is not ready
Fri Dec 19 16:44:46 2014 daemon.notice netifd: Interface 'usbmodem' is now up
Fri Dec 19 16:44:46 2014 kern.info kernel: [ 2751.430000] cdc_ncm: wwan0: 150 mbit/s downlink 150 mbit/s uplink
Fri Dec 19 16:44:46 2014 kern.info kernel: [ 2751.440000] cdc_ncm: wwan0: network connection: connected
Fri Dec 19 16:44:46 2014 kern.info kernel: [ 2751.460000] IPv6: ADDRCONF(NETDEV_CHANGE): wwan0: link becomes ready
Fri Dec 19 16:44:46 2014 daemon.notice netifd: Network device 'wwan0' link is up
Fri Dec 19 16:44:47 2014 daemon.notice netifd: usbmodem (17616): udhcpc (v1.22.1) started
Fri Dec 19 16:44:47 2014 daemon.notice netifd: Interface 'usbmodem' has lost the connection
Fri Dec 19 16:44:47 2014 daemon.notice netifd: Network device 'wwan0' link is down
Fri Dec 19 16:44:47 2014 daemon.notice netifd: usbmodem (17616): Sending discover...
Fri Dec 19 16:44:47 2014 daemon.notice netifd: usbmodem (17616): udhcpc: sendto: Network is down
Fri Dec 19 16:44:47 2014 daemon.notice netifd: usbmodem (17616): Read error: Network is down, reopening socket
Fri Dec 19 16:44:48 2014 daemon.info dnsmasq[1441]: reading /etc/resolv.conf
Fri Dec 19 16:44:48 2014 daemon.info dnsmasq[1441]: using local addresses only for domain lan
Fri Dec 19 16:44:48 2014 daemon.warn dnsmasq[1441]: ignoring nameserver 127.0.0.1 - local interface
Fri Dec 19 16:44:50 2014 daemon.notice netifd: usbmodem (17616): Sending discover...
Fri Dec 19 16:44:50 2014 daemon.notice netifd: usbmodem (17616): udhcpc: sendto: Network is down
Fri Dec 19 16:44:50 2014 daemon.notice netifd: usbmodem (17616): Read error: Network is down, reopening socket
Fri Dec 19 16:44:53 2014 daemon.notice netifd: usbmodem (17616): Sending discover...
Fri Dec 19 16:44:53 2014 daemon.notice netifd: usbmodem (17616): udhcpc: sendto: Network is down
Fri Dec 19 16:44:53 2014 daemon.notice netifd: usbmodem (17616): Read error: Network is down, reopening socket

Config file:

config interface 'usbmodem'         
        option proto 'ncm'          
        option ifname 'wwan0'       
        option device '/dev/ttyUSB1'
        option mode 'preferlte'
        option apn 'antel.lte'                 
        option pincode '1234' 
        option authtype 'none'
        option delay '25'

This seen to be related: http://www.spinics.net/lists/linux-usb/msg97112.html

comment:6 Changed 3 years ago by gazambuja@…

UPDATE: I install the last trunk image (r43757), and still the same problem:

https://downloads.openwrt.org/snapshots/trunk/ar71xx

opkg update; opkg install kmod-usb-net-cdc-ncm usb-modeswitch kmod-usb-serial-wwan kmod-usb-serial-option kmod-usb-net-huawei-cdc-ncm

(this is the package: kmod-usb-net-huawei-cdc-ncm_3.14.26-1_ar71xx.ipk)

root@OpenWrt:~# ifconfig wwan0
wwan0     Link encap:Ethernet  HWaddr 0C:5B:8F:XX:XX:XX  
          inet6 addr: fe80::e5b:8fff:fe27:9b64/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:99 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:2756818 (2.6 MiB)

root@OpenWrt:~# ifup usbmodem

Logread:

Mon Dec 22 19:57:45 2014 daemon.notice netifd: Interface 'usbmodem' is enabled
Mon Dec 22 19:57:45 2014 daemon.notice netifd: Interface 'usbmodem' is setting up now
Mon Dec 22 19:57:45 2014 daemon.notice netifd: usbmodem (1745): udhcpc (v1.22.1) started
Mon Dec 22 19:57:45 2014 daemon.notice netifd: usbmodem (1745): Sending discover...
Mon Dec 22 19:57:48 2014 daemon.notice netifd: usbmodem (1745): Sending discover...
Mon Dec 22 19:57:51 2014 daemon.notice netifd: usbmodem (1745): Sending discover...

comment:7 Changed 3 years ago by oskari.rauta@…

Terribly sorry that I cannot help you - I no longer own such hardware that uses NCM and due to non-interest of openwrt, I have discontinued this project. It seems that someone else could take over and fix the issue and share the work-around here and patchwork..?

Marry christmas in any case and sorry that I cannot help, it's just that, there's nothing I could do since I now have a QMI dongle..

comment:8 Changed 3 years ago by anonymous

u can using luci-proto-3g to config. but we cant see modem status

comment:9 Changed 3 years ago by anonymous

No. luci-proto-3g configures the modem in ppp mode, not in NCM mode. Speed is slower.

comment:10 Changed 3 years ago by gazambuja@…

I think this can be the problem. You knew if its already patch in new versions of openwrt?
http://www.spinics.net/lists/linux-usb/msg104620.html

[ 1082.972893] cdc_ncm_setup: huawei_cdc_ncm 3-1:1.1: Using default maximum receive length=32768
[ 1082.973281] cdc_ncm_setup: huawei_cdc_ncm 3-1:1.1: Setting NTB format to 16-bit failed

comment:11 Changed 3 years ago by stratos@…

Hi,
Got the same issue with ASUS RT-N16 / BB 14.07 and Huawei E3276 dongle
PPP works, but extremely slow. Any clues?

comment:12 Changed 3 years ago by anonymous

I have posted a thread on the forum about this also, as it seems to be a "widespread" issue....

https://forum.openwrt.org/viewtopic.php?pid=273099

comment:13 Changed 3 years ago by anonymous

Is it true that both:

proto_init_update "*"
ubus call network add_dynamic

weren't supported by BB? I tried to backport the script from trunk https://dev.openwrt.org/browser/trunk/package/network/utils/comgt/files/ncm.sh?rev=42866 , but those lines gave me errors. I had to use:

proto_init_update "wwan0"

and a separate dhcp configuration for wwan0

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.