Enable ModemManager to run on PCIe

Hi

Is it possible to make ModemManager use PCIe? if so how to do it?

I have tested the PCIe driver ( Quectel_Linux_PCIE_MHI_Driver_V1.3.6) and the connection with the quectel application (quectel-CM) and the connection to the modem is up and running and the board comes online.

Normally we are using USB and ModemManager together and to bring up the connection we are running the "ifup wan"

I have try changing the device option in the network config to "/sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0" and then run ifup wan, but that dont do any for the connection.

Wan config for USB:

config interface 'wan'
        option device '/sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb2/2-1'
        option proto 'modemmanager'
        option auto 'false'
        option defaultroute 'true'
        option ipv6 'false'
        option iptype 'ipv4v6'
        option allowroaming 'yes'
root@OpenWrt:~# lspci
00:00.0 PCI bridge: Qualcomm Device 1001
01:00.0 Unassigned class [ff00]: Qualcomm Device 0308
root@OpenWrt:~# mmcli -L
    /org/freedesktop/ModemManager1/Modem/0 [Quectel] RM520N-GL
root@OpenWrt:~# mmcli -m 0
  --------------------------------
  General  |                 path: /org/freedesktop/ModemManager1/Modem/0
           |            device id: 7b47ed2dc406067694b1214e20a6505207416179
  --------------------------------
  Hardware |         manufacturer: Quectel
           |                model: RM520N-GL
           |    firmware revision: RM520NGLAAR01A07M4G
           |            supported: gsm-umts, lte
           |              current: gsm-umts, lte
           |         equipment id: 868371050137617
  --------------------------------
  System   |               device: /sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb2/2-1
           |              drivers: option1
           |               plugin: quectel
           |         primary port: ttyUSB2
           |                ports: ttyUSB2 (at)
  --------------------------------
  Status   |       unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
           |                state: disabled
           |          power state: on
  --------------------------------
  Modes    |            supported: allowed: 2g, 3g, 4g; preferred: none
           |              current: allowed: 2g, 3g, 4g; preferred: none
  --------------------------------
  IP       |            supported: ipv4, ipv6, ipv4v6
  --------------------------------
  3GPP     |                 imei: 868
  --------------------------------
  3GPP EPS | ue mode of operation: csps-2
  --------------------------------
  SIM      |     primary sim path: /org/freedesktop/ModemManager1/SIM/0

Yeah, Quectel drivers wont work as they use the completely wrong QCA MHI support.

OpenWrt has the MHI drivers, including WWAN subsystem support packaged so just use those.

I have now built an image with the mhi driver and ModemManager now sees the modem, so that is great.

root@OpenWrt:~# mmcli -L
    /org/freedesktop/ModemManager1/Modem/1 [Quectel] RM520N-GL
    /org/freedesktop/ModemManager1/Modem/2 [generic] RM520N-GL

I have modified the network wan device option config to now use the PCIe: sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0

When I run "ifup wan", mmcli said connected, but the board is not online, when i do a ping nothing handles.

any idea what i am doing wrong?

root@OpenWrt:~# mmcli -m 2
  ------------------------------------
  General   |                    path: /org/freedesktop/ModemManager1/Modem/2
            |               device id: 79e6a75fd6ee48e018b18fa643cf4863e8117fcb
  ------------------------------------
  Hardware  |            manufacturer: generic
            |                   model: RM520N-GL
            |       firmware revision: RM520NGLAAR01A07M4G
            |          carrier config: ROW_Commercial
            | carrier config revision: 0A010809
            |            h/w revision: RM520N-GL
            |               supported: gsm-umts, lte, 5gnr
            |                 current: gsm-umts, lte, 5gnr
            |            equipment id: 8683710501
  ------------------------------------
  System    |                  device: /sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0
            |                 drivers: mhi_net, mhi-pci-generic
            |                  plugin: generic
            |            primary port: wwan0mbim0
            |                   ports: mhi_hwip0 (net), wwan0mbim0 (mbim), wwan0qcdm0 (ignored)
  ------------------------------------
  Status    |                    lock: sim-pin2
            |          unlock retries: sim-pin2 (3)
            |                   state: connected
            |             power state: on
            |             access tech: lte, 5gnr
            |          signal quality: 22% (recent)
  ------------------------------------
  Modes     |               supported: allowed: 3g; preferred: none
            |                          allowed: 4g; preferred: none
            |                          allowed: 3g, 4g; preferred: 4g
            |                          allowed: 3g, 4g; preferred: 3g
            |                          allowed: 5g; preferred: none
            |                          allowed: 4g, 5g; preferred: 5g
            |                          allowed: 4g, 5g; preferred: 4g
            |                          allowed: 3g, 5g; preferred: 5g
            |                          allowed: 3g, 5g; preferred: 3g
            |                          allowed: 3g, 4g, 5g; preferred: 5g
            |                          allowed: 3g, 4g, 5g; preferred: 4g
            |                          allowed: 3g, 4g, 5g; preferred: 3g
            |                 current: allowed: 4g, 5g; preferred: 5g
  ------------------------------------
  Bands     |               supported: utran-1, utran-4, utran-6, utran-5, utran-8, utran-2,
            |                          eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8,
            |                          eutran-12, eutran-13, eutran-14, eutran-17, eutran-18, eutran-19,
            |                          eutran-20, eutran-25, eutran-26, eutran-28, eutran-29, eutran-30,
            |                          eutran-32, eutran-34, eutran-38, eutran-39, eutran-40, eutran-41,
            |                          eutran-42, eutran-43, eutran-46, eutran-48, eutran-66, eutran-71,
            |                          utran-19, ngran-1, ngran-2, ngran-3, ngran-5, ngran-7, ngran-8,
            |                          ngran-12, ngran-13, ngran-14, ngran-18, ngran-20, ngran-25, ngran-26,
            |                          ngran-28, ngran-29, ngran-30, ngran-38, ngran-40, ngran-41, ngran-48,
            |                          ngran-66, ngran-70, ngran-71, ngran-75, ngran-76, ngran-77, ngran-78,
            |                          ngran-79
            |                 current: utran-1, utran-4, utran-6, utran-5, utran-8, utran-2,
            |                          eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8,
            |                          eutran-12, eutran-13, eutran-14, eutran-17, eutran-18, eutran-19,
            |                          eutran-20, eutran-25, eutran-26, eutran-28, eutran-29, eutran-30,
            |                          eutran-32, eutran-34, eutran-38, eutran-39, eutran-40, eutran-41,
            |                          eutran-42, eutran-43, eutran-46, eutran-48, eutran-66, eutran-71,
            |                          utran-19, ngran-1, ngran-2, ngran-3, ngran-5, ngran-7, ngran-8,
            |                          ngran-12, ngran-13, ngran-14, ngran-18, ngran-20, ngran-25, ngran-26,
            |                          ngran-28, ngran-29, ngran-30, ngran-38, ngran-40, ngran-41, ngran-48,
            |                          ngran-66, ngran-70, ngran-71, ngran-75, ngran-76, ngran-77, ngran-78,
            |                          ngran-79
  ------------------------------------
  IP        |               supported: ipv4, ipv6, ipv4v6
  ------------------------------------
  3GPP      |                    imei: 86837105
            |           enabled locks: fixed-dialing
            |             operator id: 23806
            |           operator name: 3
            |            registration: home
            |    packet service state: attached
            |                     pco: 0: (partial) '270480'

  ------------------------------------
  3GPP EPS  |     initial bearer path: /org/freedesktop/ModemManager1/Bearer/2
            |  initial bearer ip type: ipv4v6
  ------------------------------------
  3GPP 5GNR |               mico mode: unsupported
            |               drx cycle: unsupported
  ------------------------------------
  SIM       |        primary sim path: /org/freedesktop/ModemManager1/SIM/1
            |          sim slot paths: slot 1: none
            |                          slot 2: /org/freedesktop/ModemManager1/SIM/1 (active)
  ------------------------------------
  Bearer    |                   paths: /org/freedesktop/ModemManager1/Bearer/3

You added a firewall zone to wwan interface?

There is this "wan" zone, but that I the default setting in the firewall.

When I worked with the USB connection, I didn't have to change anything in the firewall.

config zone
        option name             wan
        list   network          'wan'
        list   network          'wan6'
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
        option masq             1
        option mtu_fix          1

config forwarding
        option src              lan
        option dest             wan

No the firewall rules, but is the WWAN interface part of any zone?

Because if not then for sure it wont work

There is reference to the wwan interface in the firewall rules. I will have to try and implement the rule.

I assume that the wwan interface is the one you can see under ifconfig?

I noticed that is says MBIM is the ModemManager information.
Do you know if it is possible to make it use QMI over mhi driver? and then also make use of the qmicli?

System    |                  device: /sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0
            |                 drivers: mhi_net, mhi-pci-generic
            |                  plugin: generic
            |            primary port: wwan0mbim0
            |                   ports: mhi_hwip0 (net), wwan0mbim0 (mbim), wwan0qcdm0 (ignored)

Why would you use QMI instead of MBIM?

You can use mbimcli instead

Does mbim has the same commands arguments?
We are using the qmicli in some lua scripts to get information from the connection/modem and if i can avoid going though our scripts and change from qmicli to mbimcli, that would be nice :smiley:

No, it has a different syntax.

It should be possible to switch to QMI as I am using QMI on RM520N, but the AT command is not documented.

Can you check what
AT+QCFG=? returns.

Usually the command is AT+QCFG="usbnet",0 but I am not sure if that works on RM520N

The response on AT+QCFG=?:

+QCFG: "rrc",(0-5)
+QCFG: "pdp/duplicatechk",(0,1)
+QCFG: "risignaltype",("respective","physical")
+QCFG: "lte/bandprior",(1-43),(1-43),(1-43)

The response for AT+QCFG="usbnet":
+QCFG: "usbnet",2

I have tried the AT+QCFG="usbnet",0 and repowered the system. MM is still saying mbim.

  System    |                  device: /sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0
            |                 drivers: mhi_net, mhi-pci-generic
            |                  plugin: generic
            |            primary port: wwan0mbim0
            |                   ports: mhi_hwip0 (net), wwan0mbim0 (mbim), wwan0qcdm0 (ignored)

Log for the ModemManager start up:

Sat Aug 19 14:07:02 2023 daemon.info ModemManager[2612]: hotplug: checking if ModemManager is available...
Sat Aug 19 14:07:02 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=ttyS0, subsystem=tty, sysfspath=/sys/devices/platform/serial8250/tty/ttyS0
Sat Aug 19 14:07:02 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=ttyS0, subsystem=tty
Sat Aug 19 14:07:02 2023 daemon.err ModemManager[2612]: hotplug: parent device sysfspath not found
Sat Aug 19 14:07:02 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=ttyMSM0, subsystem=tty, sysfspath=/sys/devices/platform/soc/78af000.serial/tty/ttyMSM0
Sat Aug 19 14:07:02 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=ttyMSM0, subsystem=tty
Sat Aug 19 14:07:02 2023 daemon.info procd: - init complete -
Sat Aug 19 14:07:03 2023 daemon.err ModemManager[2612]: hotplug: parent device sysfspath not found
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=ttyS1, subsystem=tty, sysfspath=/sys/devices/platform/serial8250/tty/ttyS1
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=ttyS1, subsystem=tty
Sat Aug 19 14:07:03 2023 daemon.err ModemManager[2612]: hotplug: parent device sysfspath not found
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=mhi_hwip0, subsystem=net, sysfspath=/sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0/mhi0/mhi0_IP_HW0/net/mhi_hwip0
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=mhi_hwip0, subsystem=net
Sat Aug 19 14:07:03 2023 daemon.info ModemManager[2612]: hotplug: interface 'wan' is set to configure device '/sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0'
Sat Aug 19 14:07:03 2023 daemon.info ModemManager[2612]: hotplug: now waiting for modem at sysfs path /sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=wwan0qcdm0, subsystem=wwan, sysfspath=/sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0/mhi0/wwan/wwan0/wwan0qcdm0
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=wwan0qcdm0, subsystem=wwan
Sat Aug 19 14:07:03 2023 daemon.err ModemManager[2612]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:03 2023 daemon.info ModemManager[2612]: hotplug: already waiting for modem at sysfs path /sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=wwan0mbim0, subsystem=wwan, sysfspath=/sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0/mhi0/wwan/wwan0/wwan0mbim0
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=wwan0mbim0, subsystem=wwan
Sat Aug 19 14:07:03 2023 daemon.info [2674]: <info>  [qrtr3/qmi] Creating QMI device from QRTR node...
Sat Aug 19 14:07:03 2023 daemon.info ModemManager[2612]: hotplug: already waiting for modem at sysfs path /sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=wwan0qmi0, subsystem=wwan, sysfspath=/sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0/mhi0/wwan/wwan0/wwan0qmi0
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=wwan0qmi0, subsystem=wwan
Sat Aug 19 14:07:03 2023 daemon.info ModemManager[2612]: hotplug: already waiting for modem at sysfs path /sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=wlan0, subsystem=net, sysfspath=/sys/devices/platform/soc/a000000.wifi/net/wlan0
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=wlan0, subsystem=net
Sat Aug 19 14:07:03 2023 daemon.err ModemManager[2612]: hotplug: parent device sysfspath not found
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=wlan1, subsystem=net, sysfspath=/sys/devices/platform/soc/a800000.wifi/net/wlan1
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=wlan1, subsystem=net
Sat Aug 19 14:07:03 2023 daemon.err ModemManager[2612]: hotplug: parent device sysfspath not found
Sat Aug 19 14:07:03 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=ttyUSB0, subsystem=tty, sysfspath=/sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb2/2-1/2-1:1.0/ttyUSB0/tty/ttyUSB0
Sat Aug 19 14:07:04 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=ttyUSB0, subsystem=tty
Sat Aug 19 14:07:04 2023 daemon.err ModemManager[826]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:04 2023 daemon.info ModemManager[2612]: hotplug: no need to wait for modem at sysfs path /sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb2/2-1
Sat Aug 19 14:07:04 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=ttyUSB1, subsystem=tty, sysfspath=/sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb2/2-1/2-1:1.1/ttyUSB1/tty/ttyUSB1
Sat Aug 19 14:07:04 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=ttyUSB1, subsystem=tty
Sat Aug 19 14:07:04 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=ttyUSB2, subsystem=tty, sysfspath=/sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb2/2-1/2-1:1.2/ttyUSB2/tty/ttyUSB2
Sat Aug 19 14:07:04 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=ttyUSB2, subsystem=tty
Sat Aug 19 14:07:04 2023 daemon.debug ModemManager[2612]: hotplug: cached event found: action=add, name=ttyUSB3, subsystem=tty, sysfspath=/sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb2/2-1/2-1:1.3/ttyUSB3/tty/ttyUSB3
Sat Aug 19 14:07:04 2023 daemon.debug ModemManager[2612]: hotplug: event reported: action=add, name=ttyUSB3, subsystem=tty
Sat Aug 19 14:07:04 2023 daemon.info dnsmasq[1]: exiting on receipt of SIGTERM
Sat Aug 19 14:07:05 2023 daemon.info [2674]: <info>  [device qcom-soc] creating modem with plugin 'qcom-soc' and '1' ports
Sat Aug 19 14:07:05 2023 daemon.warn [2674]: <warn>  [base-manager] couldn't create modem for device 'qcom-soc': Failed to find a net port in the QMI modem
Sat Aug 19 14:07:05 2023 daemon.info [2674]: <info>  [wwan0mbim0/mbim] MBIM device is not QMI capable
Sat Aug 19 14:07:06 2023 daemon.info [2674]: <info>  [base-manager] couldn't check support for device '/sys/devices/platform/soc/a000000.wifi': not supported by any plugin
Sat Aug 19 14:07:06 2023 daemon.info [2674]: <info>  [base-manager] couldn't check support for device '/sys/devices/platform/soc/a800000.wifi': not supported by any plugin
Sat Aug 19 14:07:08 2023 daemon.err ModemManager[2612]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:09 2023 daemon.err ModemManager[826]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:13 2023 daemon.err ModemManager[2612]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:14 2023 daemon.err ModemManager[826]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:18 2023 daemon.err ModemManager[2612]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:18 2023 daemon.warn odhcpd[2260]: No default route present, overriding ra_lifetime!
Sat Aug 19 14:07:19 2023 daemon.err ModemManager[826]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:22 2023 authpriv.info dropbear[4091]: Child connection from 192.168.1.152:49758
Sat Aug 19 14:07:22 2023 authpriv.notice dropbear[4091]: Auth succeeded with blank password for 'root' from 192.168.1.152:49758
Sat Aug 19 14:07:23 2023 daemon.err ModemManager[2612]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:24 2023 daemon.err ModemManager[826]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:28 2023 daemon.err ModemManager[2612]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:29 2023 daemon.err ModemManager[826]: hotplug: timed out waiting for the modem to get exported at /sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0
Sat Aug 19 14:07:29 2023 daemon.info [2674]: <info>  [device /sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb2/2-1] creating modem with plugin 'quectel' and '4' ports
Sat Aug 19 14:07:29 2023 daemon.warn [2674]: <warn>  [plugin/quectel] could not grab port ttyUSB3: Cannot add port 'tty/ttyUSB3', unhandled port type
Sat Aug 19 14:07:29 2023 daemon.warn [2674]: <warn>  [plugin/quectel] could not grab port ttyUSB1: Cannot add port 'tty/ttyUSB1', unhandled port type
Sat Aug 19 14:07:29 2023 daemon.warn [2674]: <warn>  [plugin/quectel] could not grab port ttyUSB0: Cannot add port 'tty/ttyUSB0', unhandled port type
Sat Aug 19 14:07:29 2023 daemon.info [2674]: <info>  [base-manager] modem for device '/sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb2/2-1' successfully created
Sat Aug 19 14:07:30 2023 daemon.warn [2674]: <warn>  [modem1/sim0] couldn't load list of emergency numbers: Failed to parse CRSM query result '+CRSM: 148,8,""'
Sat Aug 19 14:07:30 2023 daemon.warn [2674]: <warn>  [modem1/sim0] couldn't load list of preferred networks: Operation not allowed
Sat Aug 19 14:07:30 2023 daemon.warn [2674]: <warn>  [modem1/sim0] couldn't load GID1: Failed to parse CRSM query result '+CRSM: 106,130,""'
Sat Aug 19 14:07:30 2023 daemon.warn [2674]: <warn>  [modem1/sim0] couldn't load GID2: Failed to parse CRSM query result '+CRSM: 106,130,""'
Sat Aug 19 14:07:30 2023 daemon.info [2674]: <info>  [modem1] state changed (unknown -> disabled)
Sat Aug 19 14:07:33 2023 daemon.err ModemManager[2612]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:34 2023 daemon.warn odhcpd[2260]: No default route present, overriding ra_lifetime!
Sat Aug 19 14:07:39 2023 daemon.err ModemManager[2612]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:44 2023 daemon.err ModemManager[2612]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:49 2023 daemon.err ModemManager[2612]: hotplug: modem not detected at sysfs path
Sat Aug 19 14:07:49 2023 daemon.info [2674]: <info>  [device /sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0] creating modem with plugin 'generic' and '4' ports
**Sat Aug 19 14:07:49 2023 daemon.warn [2674]: <warn>  [plugin/generic] could not grab port wwan0qmi0: Cannot add port 'wwan/wwan0qmi0', unhandled port type**
Sat Aug 19 14:07:49 2023 daemon.info [2674]: <info>  [base-manager] modem for device '/sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0' successfully created
Sat Aug 19 14:07:49 2023 daemon.info [2674]: <info>  [modem2/wwan0mbim0/mbim] MBIM device is QMI capable
Sat Aug 19 14:07:50 2023 daemon.info [2674]: <info>  [modem2] QMI-based capability and mode switching support enabled
Sat Aug 19 14:07:50 2023 daemon.warn [2674]: <warn>  [modem2/sim1] couldn't load list of emergency numbers: No AT port available to run command
Sat Aug 19 14:07:50 2023 daemon.warn [2674]: <warn>  [modem2/sim1] couldn't load GID1: Couldn't read data from UIM: QMI protocol error (16): 'NotProvisioned'
Sat Aug 19 14:07:50 2023 daemon.warn [2674]: <warn>  [modem2/sim1] couldn't load GID2: Couldn't read data from UIM: QMI protocol error (16): 'NotProvisioned'
Sat Aug 19 14:07:50 2023 daemon.warn [2674]: <warn>  [modem2] couldn't load UE mode of operation for EPS: No AT port available to run command
Sat Aug 19 14:07:50 2023 daemon.warn odhcpd[2260]: No default route present, overriding ra_lifetime!
Sat Aug 19 14:07:54 2023 daemon.err ModemManager[2612]: hotplug: timed out waiting for the modem to get exported at /sys/devices/platform/soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0
Sat Aug 19 14:08:00 2023 daemon.warn [2674]: <warn>  [modem2] couldn't load supported assistance data types: Failed to receive indication with the predicted orbits data source
Sat Aug 19 14:08:00 2023 daemon.info [2674]: <info>  [modem2] state changed (unknown -> disabled)

Sadly, switch from one mode to another is not documented at all.

Do you have Quectel support access?

I do have a guy I can write too from Quectel. I will hear if he knows something about it.

Most 4G and newer Qualcomm modems with MBIM support implement a "QMI over MBIM" service. If your modem supports it then you can simply run qmicli (or uqmi) over the MBIM management channel.

For example:

root@miraculix:/tmp# mbimcli -p -d /dev/cdc-wdm0 --no-close  --query-device-services
[/dev/cdc-wdm0] Device services retrieved:
        Max DSS sessions: '0'
                Services: (16)

                          Service: 'basic-connect'
                             UUID: [a289cc33-bcbb-8b4f-b6b0-133ec2aae6df]:
                      DSS payload: 0
                Max DSS instances: 0
                             CIDs: device-caps (1),
                                   subscriber-ready-status (2),
                                   radio-state (3),
...blah, blah, blah

                          Service: 'qmi'
                             UUID: [d1a30bc2-f97a-6e43-bf65-c7e24fb0f0d3]:
                      DSS payload: 0
                Max DSS instances: 0
                             CIDs: msg (1)
... etc

and if libqmi is built with MBIM support (this is optional), then I can do (with expliciti MBIM - default is auto which will also work fine):

root@miraculix:/tmp# qmicli -p  --device-open-mbim -d /dev/cdc-wdm0  --nas-get-system-info 
[/dev/cdc-wdm0] Successfully got system info:
        WCDMA service:
                Status: 'none'
                True Status: 'none'
                Preferred data path: 'no'
        LTE service:
                Status: 'available'
                True Status: 'available'
                Preferred data path: 'no'
                Domain: 'cs-ps'
                Service capability: 'cs-ps'
                Roaming status: 'off'
                Forbidden: 'no'
                Cell ID: '52026113'
                MCC: '242'
                MNC: '01'
                Tracking Area Code: '33186'
                Voice support: 'no'
                IMS voice support: 'no'
                eMBMS coverage info support: 'no'
                eMBMS coverage info trace ID: '65535'
                Cell access: 'all-calls'
                Registration restriction: 'unrestricted'
                Registration domain: 'not-applicable'
        SIM reject info: 'available'

You can send any QMI request to the modem this way, including stuff which will mess up the MBIM session. Extremely useful for requests which has no MBIM counterpart.

ModemManager will automatically use this functionality for some features, like the Sierre Wireless FCC auth stuff.

The MBIM service proxying is also implemented in uqmi, for that very reason.

bjorn@miraculix:~$ uqmi -h 2>&1|grep MBIM
  --mbim, -m                        NAME is an MBIM device with EXT_QMUX support

This will work on any modem showing the d1a30bc2-f97a-6e43-bf65-c7e24fb0f0d3 MBIM service UUID.

1 Like

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