[Solved] Openwrt and EC200A-EU with NCM proto

Hi.

My first topic on the forum, despite usisng openwrt for years, and usually solve my doubts and issues reading
and seeking info over the forum. This time I could got a working solution form using the EC200A modem with
NCM proto as @AndrewZ suggested here: https://forum.openwrt.org/t/quectel-ec200a-eu-modem-is-not-recognized/191983/14
So far I was able to use it with dhcp proto mode. No issue, and the speeds of the connection are the expected
with my ISP 35Mbps down / 20 up

I found a working solution here for dhcp mode with some adjustments ( usb ID ). https://blog.tanatos.org/posts/quectel_ec200t_openwrt/

my configs and logs are:

root@OpenWrt:~# lsusb

Bus 001 Device 003: ID 2c7c:6005 Quectel Wireless Solutions Co., Ltd.

root@OpenWrt:~# echo -e ATI | socat - /dev/ttyUSB2,crnl

Quectel

EC200A

Revision: EC200AEUHAR01A21M16

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

interface configuration:

config interface 'wwan'
        option proto 'dhcp'
        option ifname 'usb0'

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

system log:

Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: + + socat - /dev/ttyUSB1,crnl
Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: echo 'at+cgatt?'
Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200:
Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200:
Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: +CGATT: 1
Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200:
Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: + + socat - /dev/ttyUSB1,crnl
Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: echo 'at+cgact?'
Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200:
Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200:
Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: +CGACT: 1,1
Sat Mar 23 00:48:27 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200:
Sat Mar 23 00:48:28 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: + + socat - /dev/ttyUSB1,crnl
Sat Mar 23 00:48:28 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: echo 'at+cgact=1,1'
Sat Mar 23 00:48:28 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: + + socat - /dev/ttyUSB1,crnl
Sat Mar 23 00:48:28 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: echo 'AT+CGCONTRDP=1'
Sat Mar 23 00:48:28 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200:
Sat Mar 23 00:48:28 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200:
Sat Mar 23 00:48:28 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: +CGCONTRDP: 1,5,"internet.mnc006.mcc268.gprs","xxx.xx.xxx.xxx","","xx.xxx.xxx.x","xx.xx.xxx.x","","",0,0
Sat Mar 23 00:48:28 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200:
Sat Mar 23 00:48:29 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: + + socat - /dev/ttyUSB1,crnl
Sat Mar 23 00:48:29 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: echo 'AT+QNETDEVCTL=1,1,1'
Sat Mar 23 00:48:29 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: + sleep 1
Sat Mar 23 00:48:30 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: + + socat - /dev/ttyUSB1,crnl
Sat Mar 23 00:48:30 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: echo 'AT+QNETDEVCTL=1,1,1'
Sat Mar 23 00:48:31 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: + sleep 1
Sat Mar 23 00:48:32 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: + + socat - /dev/ttyUSB1,crnl
Sat Mar 23 00:48:32 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: echo 'AT+QNETDEVCTL=1,1,1'
Sat Mar 23 00:48:32 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: + sleep 1
Sat Mar 23 00:48:33 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: + + socat - /dev/ttyUSB1,crnl
Sat Mar 23 00:48:33 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: echo 'AT+QNETDEVCTL?'
Sat Mar 23 00:48:33 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200:
Sat Mar 23 00:48:33 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200:
Sat Mar 23 00:48:33 2024 daemon.notice procd: /etc/rc.d/S98quectel_EC200: +QNETDEVCTL: 1,1,1,1

Trying NCM mode:

root@OpenWrt:~# echo AT+QNETDEVCTL? | $SOCAT_RUN


+QNETDEVCTL: 3,1,0,1

root@OpenWrt:~# echo ATI | $SOCAT_RUN


Quectel

EC200A

Revision: EC200AEUHAR01A21M16

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

interface status:

Protocol: NCM
RX: 0 B (0 Pkts.)
TX: 0 B (0 Pkts.)
Error: Network device is not present

------------------------------
system log:


Sat Mar 23 01:19:17 2024 daemon.notice netifd: wwan (4300): WARNING: Variable 'quectel' does not exist or is not an array/object
Sat Mar 23 01:19:17 2024 daemon.notice netifd: wwan (4300): Unsupported modem
Sat Mar 23 01:19:17 2024 daemon.notice netifd: wwan (4368): Stopping network wwan
Sat Mar 23 01:19:18 2024 daemon.notice netifd: wwan (4368): sending ->
Sat Mar 23 01:19:22 2024 daemon.notice netifd: Interface 'wwan' is now down

Any help to get It working with ncm proto will appreciated.
Thanks

For ECM mode to work you need to send to the modem AT+QNETDEVCTL=3,1 once and the modem will dial automatically on its own and you will need to have just a regular DHCP interface on OpenWrt side.

In NCM mode the connection script will send AT+QNETDEVCTL=1,1 every time to initiate the connection, then it will use the same DHCP mechanism to get the IP address from the modem, but first you need to disable the auto dial you set before, so send once AT+QNETDEVCTL=0,1

Please do not do anything described in that blog post, follow OpenWrt wiki only. Make sure you made no modification to OpenWrt files.
Show your NCM interface configuration if the problem persists.

1 Like

Hi

Thanks, it's working as you described for dhcp..

1st try with dhcp proto and AT+QNETDEVCTL=3,1 and nothing from the blog, worked like a charm.

config interface 'wwan'
        option proto 'dhcp'
        option ifname 'usb0'

Protocol: DHCP client
Uptime: 0h 4m 30s
MAC: 02:0C:29:A3:9B:6D
RX: 1.10 MB (1856 Pkts.)
TX: 566.93 KB (1667 Pkts.)
IPv4: 192.168.43.100/24



root@OpenWrt:~# echo AT+QNETDEVCTL? | $SOCAT_RUN


+QNETDEVCTL: 3,1,0,1

root@OpenWrt:~# echo ATI | $SOCAT_RUN


Quectel

EC200A

Revision: EC200AEUHAR01A21M16

Got connection to my ISP and got internet.

But with ncm no deal. Couldn't get any connection:

config interface 'wwan'
        option ifname 'usb0'
        option proto 'ncm'
        option ipv6 'auto'
        option apn 'internet'
        option pdptype 'IP'
        option service 'preferlte'
        option device '/dev/ttyUSB1'


Protocol: NCM
RX: 0 B (0 Pkts.)
TX: 0 B (0 Pkts.)
Error: Network device is not present

and even sending at commands stop working.

root@OpenWrt:~# echo -e ATI | socat - /dev/ttyUSB2,crnl
ATI
ATI

Even not working with ncm, I consider a success, no need for a fancy script. Lool
But if you get any more suggestion for ncm proto, I will be grateful

Update.
Got it working using ncm proto.


config interface 'wwan'
        option proto 'ncm'
        option device '/dev/ttyUSB1'
        option mode 'preferlte'
        option pdptype 'IP'
        option apn 'internet'
        option ipv6 'auto'

wwan
usb0

Type: Ethernet Adapter
Device: usb0
Connected: yes
MAC: 02:0C:xx:xx:xx:xx
RX: 3.97 MB (6813 Pkts.)
TX: 1.88 MB (6668 Pkts.)

wwan_4
usb0

Protocol: Virtual dynamic interface (DHCP client)
Uptime: 0h 16m 1s
IPv4: 192.168.43.100/24

I just updated openwrt from v19 to the latest: OpenWrt 23.05.0 r23497-6637af95aa
Working at 1st try, with @AndrewZ tips for modem initialization.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.