QMI and MBIM Interface issue with modem

Could I get the support to let the OpenWrt system detect the modem

Modem: Quectel - RM551

I would like to ask your support if you can share with me command to be added on startup of OpenWrt to detect the modem of router as MBIM or QMI ..
.

  • Where I tried QMI & MBIM command and I got network but I can't connect it on Interface of router because no modem

AT+QCFG="usbnet",0 < QMI/PPP/Default
AT+QCFG="usbnet",1 < ECM
AT+QCFG="usbnet",2 < MBIM

I got network on these commands but system can't detect the modem on MBIM and QMI interface

I'm using DCHP interface to get network based on USB0


Where for Modem manager ( I used one of commands my friend gave it to me and I added it ---- on startup , it made the system detect the modem as usb

echo "2c7c 0122 ff" > /sys/bus/usb-serial/drivers/option1/new_id


So please is there any command I can put it on Startup of system to let system find modem for MBIM and QMI .


Pictures :






root@OpenWrt:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux 6.6.35 xhci-hcd xHCI Host Controller
Bus 001 Device 002: ID 2109:2822 VIA Labs, Inc. USB2.0 Hub
Bus 001 Device 003: ID 2109:8822 VIA Labs, Inc. USB Billboard Device
Bus 002 Device 001: ID 1d6b:0003 Linux 6.6.35 xhci-hcd xHCI Host Controller
Bus 002 Device 002: ID 2109:0822 VIA Labs, Inc. USB3.1 Hub
Bus 002 Device 003: ID 2c7c:0122 Quectel RM551E-GL

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

USB debug information:
""
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 1
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0002 Rev= 6.06
S: Manufacturer=Linux 6.6.35 xhci-hcd
S: Product=xHCI Host Controller
S: SerialNumber=11200000.usb
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= 5
D: Ver= 2.10 Cls=09(hub ) Sub=00 Prot=02 MxPS=64 #Cfgs= 1
P: Vendor=2109 ProdID=2822 Rev= 0.30
S: Manufacturer=VIA Labs, Inc.
S: Product=USB2.0 Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=01 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=256ms
I:* If#= 0 Alt= 1 #EPs= 1 Cls=09(hub ) Sub=00 Prot=02 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=256ms

T: Bus=01 Lev=02 Prnt=02 Port=04 Cnt=01 Dev#= 3 Spd=480 MxCh= 0
D: Ver= 2.01 Cls=11(blbrd) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=2109 ProdID=8822 Rev= 0.01
S: Manufacturer=VIA Labs, Inc.
S: Product=USB Billboard Device
S: SerialNumber=0000000000000001
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 0 Cls=11(blbrd) Sub=00 Prot=00 Driver=(none)

T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=10000 MxCh= 1
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 3.10 Cls=09(hub ) Sub=00 Prot=03 MxPS= 9 #Cfgs= 1
P: Vendor=1d6b ProdID=0003 Rev= 6.06
S: Manufacturer=Linux 6.6.35 xhci-hcd
S: Product=xHCI Host Controller
S: SerialNumber=11200000.usb
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=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 4
D: Ver= 3.10 Cls=09(hub ) Sub=00 Prot=03 MxPS= 9 #Cfgs= 1
P: Vendor=2109 ProdID=0822 Rev= 0.30
S: Manufacturer=VIA Labs, Inc.
S: Product=USB3.1 Hub
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=13(Int.) MxPS= 2 Ivl=16ms

T: Bus=02 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=5000 MxCh= 0
D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1
P: Vendor=2c7c ProdID=0122 Rev= 5.15
S: Manufacturer=Quectel
S: Product=RM551E-GL
S: SerialNumber=6c63fe16
C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA
A: FirstIf#=10 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=85(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#=10 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether
E: Ad=88(I) Atr=03(Int.) MxPS= 16 Ivl=32ms
I: If#=11 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
I:* If#=11 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
E: Ad=87(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
root@OpenWrt:~# uci show network
network.loopback=interface
network.loopback.device='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='fd25:9927:cf9::/48'
network.globals.packet_steering='2'
network.globals.steering_flows='256'
network.@device[0]=device
network.@device[0].name='br-lan'
network.@device[0].type='bridge'
network.@device[0].ports='lan1' 'lan2' 'lan3' 'eth1'
network.lan=interface
network.lan.device='br-lan'
network.lan.proto='static'
network.lan.ipaddr='192.168.2.2'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.@device[1]=device
network.@device[1].name='br-wan'
network.@device[1].type='bridge'
network.@device[1].ports='wan' 'eth2'
network.@device[2]=device
network.@device[2].name='wan'
network.@device[2].macaddr='5e:7d:f5:bc:40:67'
network.@device[3]=device
network.@device[3].name='eth2'
network.@device[3].macaddr='5e:7d:f5:bc:40:67'
network.wan=interface
network.wan.device='br-wan'
network.wan.proto='dhcp'
network.wan6=interface
network.wan6.device='br-wan'
network.wan6.proto='dhcpv6'
network.USB=interface
network.USB.proto='dhcp'
network.USB.device='usb0'
network.@device[4]=device
network.@device[4].name='usb0'
network.unm=interface
network.unm.proto='none'
network.unm.device='usb0'

Note : All drivers are installed

Please post

ubus call system board

eth1 and lan1 in same line looks like you did not wipe config to migrate swconfig to dsa....

Hi Dear @brada4

root@OpenWrt:~# ubus call system board
{
        "kernel": "6.6.35",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 0",
        "model": "Bananapi BPI-R4",
        "board_name": "bananapi,bpi-r4",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "SNAPSHOT",
                "revision": "r26815-b4069fad02",
                "target": "mediatek/filogic",
                "description": "OpenWrt SNAPSHOT r26815-b4069fad02"
        }
}

You have leftovers of swconfig configuration. You had to reset it when prompted by upgrade.
If modemmanager locks up your modem obviously luci cannot access it anymore.

1 Like

always its like this .... if I didn't use that command on startup the modemManager can't detect any modem on device option

mostly because this new modem RM551 so I need to to add command to let QMI and MBIM to detect it like ModemManager

I'm not sure but it could be the reason

modemmanager has rich database of connection profiles, for native luci interface you will need to provide APN.
Set modem to QMI mode
https://openwrt.org/docs/guide-user/network/wan/wwan/ltedongle
reboot router, note that all USB endpoints are present but only one is working at any given time. Now check logs for detected operator names and modemmanager setting APN, so much for industiral scale espionage, you can use that APN in native config after uninstalling modemmanager.

already , I tried all these steps and all these packages are installed

Note :

root@OpenWrt:~# ls -l /dev/cdc-wdm0
ls: /dev/cdc-wdm0: No such file or directory

root@OpenWrt:~# cat /sys/kernel/debug/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=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 6.06
S:  Manufacturer=Linux 6.6.35 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=11200000.usb
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= 5
D:  Ver= 2.10 Cls=09(hub  ) Sub=00 Prot=02 MxPS=64 #Cfgs=  1
P:  Vendor=2109 ProdID=2822 Rev= 0.30
S:  Manufacturer=VIA Labs, Inc.
S:  Product=USB2.0 Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=01 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms
I:* If#= 0 Alt= 1 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=02 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

T:  Bus=01 Lev=02 Prnt=02 Port=04 Cnt=01 Dev#=  3 Spd=480  MxCh= 0
D:  Ver= 2.01 Cls=11(blbrd) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=2109 ProdID=8822 Rev= 0.01
S:  Manufacturer=VIA Labs, Inc.
S:  Product=USB Billboard Device
S:  SerialNumber=0000000000000001
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 0 Cls=11(blbrd) Sub=00 Prot=00 Driver=(none)

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=10000 MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.10 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 6.06
S:  Manufacturer=Linux 6.6.35 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=11200000.usb
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=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=5000 MxCh= 4
D:  Ver= 3.10 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=2109 ProdID=0822 Rev= 0.30
S:  Manufacturer=VIA Labs, Inc.
S:  Product=USB3.1 Hub
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=13(Int.) MxPS=   2 Ivl=16ms

T:  Bus=02 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=5000 MxCh= 0
D:  Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
P:  Vendor=2c7c ProdID=0122 Rev= 5.15
S:  Manufacturer=Quectel
S:  Product=RM551E-GL
S:  SerialNumber=6c63fe16
C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA
A:  FirstIf#=10 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=85(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#=10 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether
E:  Ad=88(I) Atr=03(Int.) MxPS=  16 Ivl=32ms
I:  If#=11 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
I:* If#=11 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
E:  Ad=87(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
root@OpenWrt:~#

root@OpenWrt:~# lsmod | grep -e qmi_wwan -e cdc_wdm
cdc_wdm                20480  2 cdc_mbim,qmi_wwan
qmi_wwan               28672  0
usbcore               192512 18 qcserial,option,cdc_mbim,usb_wwan,rndis_host,qmi_wwan,cdc_ncm,cdc_ether,usbserial,usbnet,cdc_wdm,cdc_acm,xhci_plat_hcd,xhci_pci,xhci_mtk_hcd,xhci_hcd,dwc3,cdns_usb_common
usbnet                 24576  5 cdc_mbim,rndis_host,qmi_wwan,cdc_ncm,cdc_ether

Anoother industrial espionage option - boot fork distribution from USB on x86-64 and check how it configures modem.Then repeat in OpenWRT.
https://ofmodemsandmen.com/routers.html
Since your device is brand new you may ask to cherry-pick enablement patch from mainline linux back to OpenWRT kernels.

Already , I tried ROOter also... same issue can't detect the modem on QMI or MBIM
I approched them on their forum but no luck to get reply

Patience over there, they have even better auto-config scripts than modemmanager :wink:

1 Like

I assume that's an engineering sample and that you're stuck with whatever pre-production firmware it came with. Which isn't necessarily a big problem. You just have to establish which features are implemented and working satisfactorily in that firmware. And you'll most likely also have to take responsibility for adding device IDs to vendor specfic drivers, since nobody else has been testing this hardware/firmware on any Linux system (internal Quectel testing doesn't count since they don't share anything with the community).

And this is the only thing that really matters wrt subject. The modem firmware decides the supported functions, and this is the switch to make the firmware select QMI, ECM or MBIM. Note the OR.

What you should do first (probably too late now) is to note which setting the firmware came with by default. This is most likely the intended firmware default. Which is important for pre-production firmware because you don't know if the other modes have had much real world testing.

For example:

AT+QCFG="usbnet"

+QCFG: "usbnet",0

OK

And then try each of those modes and see if they are actually working. Note that you have to reset the modem between each test to make the firmware apply the changes.

AT+QCFG="usbnet",2
OK
AT+CFUN=1,1
OK

Make a copy of the USB descriptors for each mode, so you know which functions are exported and what drivers to use (and patch). I.e, when the modem comes back after reset:

cat /sys/kernel/debug/usb/devices

You may also want to do some functional testing for each mode. But you'll most likely have to manually bind the correct drivers to their appropriate functions for any vendor specific function.

where this is part of the test. But you should be aware of the drawbacks: The option driver will bind to all vendor specific functions with bulk in and out interfaces. This includes functions like for example ADB and QMI. And when a function is bound then it's not available for any other driver. Which means that you're hiding those functions. This will be a show stopper for your QMI testing since you want qmi_wwan to bind to one of those ff interfaces.

This makes this solution an absolutely no-go for anything except initial testing to figure out which interfaces (or class/subclass/protocol triplests) you need to add to the different drivers.

So here we see the modem is in ECM mode, and the option driver is bound to all other functions. Which look like DIAG, possibly GNSS and AT functions, so that's fine. You have all the driver support needed and this mode should work like this, if the modem firmware works.

The interesting question is now how this works after AT+QCFG="usbnet",0 or AT+QCFG="usbnet",2. If any of those modes are supported at all by your modem.

2 Likes

There will be network when I run these commands with reboot the modem ....but still will be like ECM ... Driver=cdc_ether

Maybe all options of UsbNet are taking me to ECM ?

The new