ZBT-5926 enable LTE chip modem

Great work!

Take a look at the wwan and comgt packages. You'll see that the wwan handlers use comgt to set up a connection for devices using the cdc_ether, cdc_ncm or huawei_cdc_ncm drivers. The AT commands for each vendor are collected in the ncm.json file in comgt. Would be great if you extended that with support for this modem and similar ones.

I am afraid that I need some more help to get this properly integrated with OpenWrt. I have installed wwan and comgt packages. I then noticed that the /lib/netifd/proto/wwan.sh script makes use of a long list of configuration files in /lib/network/wwan, with names consisting of the USB vendor and product ID.
I have created a new file 19d2:0532 in that directory, but I cannot figure out what configuration section I need to create in /etc/config/network or elsewhere, in order to trigger proto_wwan_setup() within wwan.sh to get called. I have tried something like this:

config interface 'modem'
	option proto 'wwan'
	option ifname 'eth1'

But all that happens is that the UI reports the new interface as "Unsupported protocol type."

Also, I have not figured out where in the configuration I would set the keyword user to look up the relevant set of AT commands in ncm.json. Existing sections have keys such as "huawei", "samsung", or "sony", and I think that I could easily populate a new section called "zte" with the commands I have seen working, but I need help where to then put "zte" in my configuration.

See https://openwrt.org/docs/guide-user/network/wan/wan_interface_protocols#protocol_wwan_usb_modems_autodetecting_above_protocols for the 'wwan' config reference.

I often find it useful to look at the git log to figure out how to add new stuff. Unfortunately there hasn't been much action fot this package. But you should find some useful examples here anyway: https://git.openwrt.org/?p=openwrt/openwrt.git;a=history;f=package/network/utils/wwan;hb=HEAD

Or you could decide to configure the 'ncm' proto directly instead. Might be easier while debugging, as you have less automagic stuff to worry about.

The manufacturer keywork lookup is found by lower casing the value from AT+CIMI. See
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/network/utils/comgt/files/ncm.sh;h=9aaaa25f37f1ae4e38fdfb83cc5a14089fed6cc6;hb=HEAD#l76

This should just work. You can try of the command in the shell to see what your value is:

gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | awk 'NF && $0 !~ /AT\+CGMI/ { sub(/\+CGMI: /,""); print tolower($1); exit; }'

I have not been able to get the builtin ncm or wwan drivers to work with the ThinkWill ML7820 modem, however, a workaround is to put the following in the rc.local file (can be done from the web interface):

That, together with having isntalled kmod-usb-net kmod-usb-net-cdc-ether kmod-usb-serial will result in the eth1 interface becoming functional and forwarding LTE data. By then editing the two WAN interfaces to use eth1 instead of eth0.1, both IPv4 and IPv6 routing works for me.

Depending on your carrier, you may need to provide an "APN" as an additional argument in quotes to the AT+CGDCONT command.

echo "0x19d2 0x0532" > /sys/bus/usb-serial/drivers/generic/new_id
sleep 1
gcom -d /dev/ttyUSB0 -s /proc/self/fd/0 << EOF
opengt
 set com 115200n81
 set comecho off
 set senddelay 0.02
 waitquiet 0.2 0.2
 flash 0.1

:start
 send "AT!RESET^m"
EOF

sleep 10
gcom -d /dev/ttyUSB0 -s /proc/self/fd/0 << EOF
opengt
 set com 115200n81
 set comecho off
 set senddelay 0.02
 waitquiet 0.2 0.2
 flash 0.1

:start
 send "AT+CFUN=1^m"
 waitfor 3 "OK"
 send 'AT+CGDCONT=1,"IPV4V6"^m'
 waitfor 10 "OK"
 send 'AT+CGACT=1,1^m'
 waitfor 10 'OK'
 send 'AT+ZGACT=1,1^m'
 waitfor 10 'OK'
EOF

Just to add to this conversation. I've been messing around to get this Thinkwill ML7820+ mini pcie card to work.

My progress so far - https://gitlab.com/db260179/openwrt-u7621-01/-/commit/4ac2e4c3a9052387bcca382cdfe67e5e27b005d8

Original idea from https://www.spinics.net/lists/netdev/msg214433.html as this seems to show the same way to work via the cdc_com mode to activate the qmi

These commands seem to have the same affect to action - http://www.usr.cn/Down/WH_G405tf-AT-command-set_V1.0.0.pdf

Mostly debugging from the original firmware and the commands its uses.

I get this result from my openwrt patch on the 19.07.2 branch

[   58.646616] qmi_wwan 1-1:1.0: cdc-wdm0: USB WDM device
[   58.658487] qmi_wwan 1-1:1.0 wwan0: register 'qmi_wwan' at usb-1e1c0000.xhci-1, WWAN/QMI device, a6:c7:76:xxxxxx
[   58.679804] usbcore: registered new interface driver qmi_wwan
[   58.695020] usbcore: registered new interface driver option
[   58.706417] usbserial: USB Serial support registered for GSM modem (1-port)
[   58.721111] option 1-1:1.2: GSM modem (1-port) converter detected
[   58.733812] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[   58.748091] option 1-1:1.3: GSM modem (1-port) converter detected
[   58.760758] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[   58.775091] option 1-1:1.4: GSM modem (1-port) converter detected
[   58.787848] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[   58.802151] option 1-1:1.5: GSM modem (1-port) converter detected
[   58.814816] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3

But havent tested yet - let me know it it works for you?

Sorry, but that will not be accepted unless the modem speaks QMI. Does it? If not, then use the cdc_ether driver instead. It should work without any patching.

QMI control is in the original firmware, but so far im just poking around for now.

Yes i wont push this as is, probably only the serial id for now as you can use the modem via ppp and you are correct using the usb_cdc_ether will achieve the same result

Do you know which GPIO pins boot the ML7820+ or chip?
GPIO configs from /sys will be helpful

Anybody can share finished working firmware OPENWRT for ZBT-5926WD?

Hi! I successfully connected subj on OpenWrt 21'st branch in NCM protocol
First. install packages: kmod-usb-net-rndis, kmod-usb-serial-oprion, luci-proto-ncm
Second. add vid:pid modem to option driver
echo '19d2 0532 ff' > /sys/bus/usb-serial/drivers/option1/new_id
Thrid. Modified /etc/gcom/ncm.json. Exampe commit https://github.com/koshev-msk/openwrt-conf/commit/1a119846a005f3f04ca6b0eea6ccfb21ad86f10f

Images:

Small improvement:
at+qnetdevctl command is currently hardcoded to IPv4 only

"at+qicsgp=${profile},1,\\\"${apn}\\\"

1 is actually a pdptype mapped as follows:

1 IPv4 (default)
2 IPv6
3 IPv4v6

I also have the ML 7820+ modem and want to use it for my Internet, but it doesn't work.

I have installed the necessary packages and set the driver, which is confirmed by the output of cat /sys/kernel/debug/usb/devices.

I also customized the ncm.json file, following the template.

Then I created the NCM interface which does not work.

It would be nice if someone could help me.

Output of cat /sys/kernel/debug/usb/devices:

T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=01 Dev#=  3 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=19d2 ProdID=0532 Rev= 1.00
S:  Manufacturer=ZXIC,Incorporated
S:  Product=ZXIC Mobile Boardband
S:  SerialNumber=1234567890ABCDEF
C:* #Ifs= 7 Cfg#= 1 Atr=c0 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether
E:  Ad=87(I) Atr=03(Int.) MxPS=  16 Ivl=32ms
I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

You have no comm port(s), you need to add your modem to the driver:

1 Like

I've set the driver with the command you've sent, but the output of cat /sys/kernel/debug/usb/devices is the same and also the modem isn't working.

Then something is most likely wrong.

Sorry for not being more specific, but that's a good as it gets based on the provided information.

Make sure kmod-usb-serial-option is installed then repeat echo 19d2 0532 ff > /sys/bus/usb-serial/drivers/option1/new_id