[OpenWrt-Devel] [ModemManager] How can I make ModemManager work right?

Aleksander Morgado aleksander at aleksander.es
Wed May 6 14:52:03 EDT 2020


Hey!

> Let me provide some additional information and new test log messages.
>
> The problem I reported is improved one setp. Originally it was like:
>    root at LEDE:~# mmcli -L
>    error: couldn't create manager: Timeout was reached
>
> Now it is like:
>    root at LEDE:~# mmcli -L
>    No modems were found
>
> I had to enable "dbus-utils" under "Utilities" of openwrt make menuconfig. So it seems that now mmcli talks with ModemManager at last. The problem now belongs to ModemManager not in the mmcli.
>

Ok, that is good, you made progress there.

>
> And I created the rule file you provided:
>
> # vim /lib/udev/rules.d/78-mm-custom.rules to fit to my modem:
> ACTION!="add|change|move", GOTO="mm_custom_end"
> DEVPATH=="/sys/devices/platform/1a0c0000.usb/usb2/2-1",
> ENV{ID_MM_TTY_BAUDRATE}="115200"
> DEVPATH=="/sys/devices/platform/1a0c0000.usb/usb2/2-1",
> ENV{ID_MM_TTY_FLOW_CONTROL}="xon-xoff"
> LABEL="mm_custom_end"
>

The DEVPATH above goes without the "/sys" prefix.

> I wonder if these rule files are supposed to be provided from the modem provider. In my case, it is Hucom wireless.
> Can I ask them to provide this file?

These rules files are provided by ModemManager itself. You could ask
the manufacturer, but they will very likely just say they don't
support ModemManager.

>
> My modem is supposed to operate with this configs:
>
> device      : /dev/ttyUSB1
> baudrate  : 115200,
> parity        : none,
> data         : 8,
> stop          : 1,
> flow          : xon_xoff
>

Please install minicom in your system, and make sure the ttyUSB1 does
require those settings. Once you have validated that using minicom, we
can go on and debug the ModemManager part.

> And I added config section like shown below in the /etc/config/network:
>
> config interface 'broadband'
>         option device '/sys/devices/platform/1a0c0000.usb/usb2/2-1'
>         option proto 'modemmanager'
>         option apn '5g-internet.sktelecom.com'
>         option username ''
>         option password ''
>         option pincode ''
>         option lowpower '1'
>
> I don't know the username and password, but maybe it wouldn't be needed at all. the pincode... I have no idea with this..
>

Remove the username, password and pincode lines. You can also remove
the lowpower line for now, to simplify the setup.

> And also I added "--debug" in the start script /etc/rc.d/S70modemmanager:
>
> procd_set_param command /usr/sbin/ModemManager --debug
>
> And with these conditions, I rebooted my linux box and after the reboot is done, maybe 5 minutes later I captured log message:
> logread > logread_last.log
>
> And I attached it in this email. Please find the log message and see it through.
>
> And you wanted to know what modem is mine:
> The modem is HUCOM HM-900
>

Never heard of it unfortunately.

> Kernel message related to the hucom modem:
> ==== [hucom_wwan_bind] : HUCOM HM9xx ====
> qmi_wwan_hucom 2-1:1.2: cdc-wdm0: USB WDM device
> HUCOM usbnet bind here
> qmi_wwan_hucom 2-1:1.2 wwan0: register 'qmi_wwan_hucom' at usb-1a0c0000.usb-1, HUCOM wwan/QMI device, a2:25:55:58:dd:dd

Ok, what is that above? Are you using a HUCOM-provided qmi_wwan kernel
driver that is not upstreamed? Why would you need that driver if
you're going to use a ttyUSB port to control the device? Isn't this
device just a plain QMI device that can be controlled via QMI?

> ==== [hucom_wwan_bind] : HUCOM HM9xx ====
> ahci 1a200000.sata: couldn't get PHY in node sata: -517
> qmi_wwan_hucom: probe of 2-1:1.3 failed with error -22
> ==== [hucom_wwan_bind] : HUCOM HM9xx ====
> qmi_wwan_hucom: probe of 2-1:1.4 failed with error -22
> usbcore: registered new interface driver qmi_wwan_hucom
> l2tp_ppp: PPPoL2TP kernel driver, V2.0
> usbcore: registered new interface driver option
> usbserial: USB Serial support registered for GSM modem (1-port)
> option 2-1:1.0: GSM modem (1-port) converter detected
> usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
> option 2-1:1.1: GSM modem (1-port) converter detected
> ahci 1a200000.sata: couldn't get PHY in node sata: -517
> usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
> option 2-1:1.3: GSM modem (1-port) converter detected
> ahci 1a200000.sata: couldn't get PHY in node sata: -517
> option 2-1:1.4: GSM modem (1-port) converter detected
> ahci 1a200000.sata: couldn't get PHY in node sata: -517
> option 2-1:1.5: GSM modem (1-port) converter detected
> ahci 1a200000.sata: couldn't get PHY in node sata: -517
> usb 2-1: GSM modem (1-port) converter now attached to ttyUSB4
> ahci 1a200000.sata: couldn't get PHY in node sata: -517
> kmodloader: done loading kernel modules from /etc/modules.d/*
>

The device is exposing multiple USB ports. Do you know the purpose of
each of the ports.?


>
> My system environement(HW/SW) :
>
> Target Model        : MediaTek MT7622 AC4300rfb1 board
> Firmware Version : LEDE Reboot 17.01-SNAPSHOT unknown / LuCI
> Kernel Version      : 4.4.124
> Modem                 : HUCOM HM-900
> ModemManager
> Version                 : 1.12.8
> menuconfig          : (QMI on, MBIM off)
>
> It is QMI device.
> qmichannel                                            : /dev/cdc-wdm0
> usbnet_adapter                                      : /sys/class/net/wwan0
> /sys/bus/usb/devices/2-1/manufacturer : QCOM
> /sys/bus/usb/devices/2-1/idVendor        :05C6
> /sys/bus/usb/devices/2-1/idProduct       :90db
> /sys/bus/usb/devices/2-1/speed             :5000
> /sys/bus/usb/devices/2-1/product          :SDXPRAIRIE-MTP _SN:B02CE51B
> /sys/bus/usb/devices/2-1/version           :3.20
> /sys/bus/usb/devices/2-1:1.2/net/wwan0
> /sys/bus/usb/devices/2-1:1.2/net/wwan0/device/driver
> /sys/bus/usb/devices/2-1:1.2/net/wwan0/device
> /sys/bus/usb/devices/2-1:1.2/usbmisc/cdc-wdm0
> /sys/devices/platform/1a0c0000.usb/usb2/2-1/2-1:1.2
>

Yes, a QMI device, so we could actually completely ignore the ttyUSB
port to control this device.

> Kernel modules watched via lsmod
> cdc_wdm                 8821  1 qmi_wwan
> qmi_wwan                6252  0
> usbcore               153512 20 option,usb_wwan,qmi_wwan,cdc_ncm,cdc_ether,usbserial,usbnet,usblp,cdc_wdm,cdc_acm,usb_storage,xhci_mtk,xhci_plat_hcd,xhci_pci,xhci_hcd,uhci_hcd,ohci_platform,ohci_hcd,ehci_platform,ehci_hcd
> usbnet                 19027  3 qmi_wwan,cdc_ncm,cdc_ether
>
> And usbnet adapter kernel module : qmi_wwan.c  written by Bjørn Mork
> USB serial driver option.c written by Matthias Urlichs
>
> Do I miss anything?
>

I cannot see any port probing being done in the log, and that is
extremely strange. But the log you attached is not even full, so
cannot tell what the issue is.

-- 
Aleksander
https://aleksander.es

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list