First steps with EM74 embedded linux modemmanager - no ttyUSB

Hi There !

I’m trying to get started with an EM7421 on an embedded linux system (yocto OE build).

The aim is to interact with the modem from our application using ModemManager (over the MBIM interface) for location services - and also WWAN using NetworkManager (transparently to our application). Does this sound reasonable ?!

First, I have tested the HW by installing drivers/Skylight on Win10. I can connect PuTTY to the NMEA and AT (WWAN modem) USB ports, where I see data and can issue AT commands.

However, when connecting to the Linux device :-

# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 1199:9091 Sierra Wireless, Inc.
Bus 001 Device 004: ID 1286:204e Marvell Semiconductor, Inc.
Bus 001 Device 002: ID 0424:3803 Microchip Technology, Inc. (formerly SMSC)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

But

# mmcli -L
No modems were found

And

# ls /dev/ttyUSB*
ls: cannot access ‘/dev/ttyUSB*’: No such file or directory

And

# dmesg | grep usb
:
[ 5207.950066] usb 1-1.2: new high-speed USB device number 6 using cdns-usb3
[ 5208.054680] usb 1-1.2: config 1 has an invalid interface number: 8 but max is 3
[ 5208.062194] usb 1-1.2: config 1 has no interface number 1

I am supposing that the ModemManager would be dependent on the USB interface.
Is that true ?

Do I need some specific USB driver ?
Maybe I need to manually add the product VIDs ? (I will look at this in a moment)
I understood that these would be included in the core Linux build (V5.4.120).

Is the max interface number = 3 important ?

Any pointers welcome :wink:

Tim

You need to install the mbpl usb driver

https://source.sierrawireless.com/resources/airprime/software/mbpl/mbpl-software-latest/#sthash.coNtiA56.dpbs

Right - I notice that I do not have a qcserial folder in /sys/bus/usb-serial/drivers/ - or are they something more generic ?

I didn’t think that I would need to be adding device-specific code to our build.

I would rather include the Linux drivers, if they would be enough. We’re not looking to use any extended functionality… (my Yocto-bitbake skills still remain entry-level :flushed:)

I have checked our WP76 yocto source, it should have the qcserial.c and qmi_wwan.c

owner@CNHKG-EX-001367:~/Yocto/WP76/R17_SWI9X07Y_03.01.07.00/yocto$ ls ./kernel/drivers/usb/serial/qcserial.c -l
-rw-r--r-- 1 owner owner 17690 Mar 16 22:14 ./kernel/drivers/usb/serial/qcserial.c
owner@CNHKG-EX-001367:~/Yocto/WP76/R17_SWI9X07Y_03.01.07.00/yocto$ ls ./kernel/drivers/net/usb/qmi_wwan.c -l
-rw-r--r-- 1 owner owner 53965 Mar 16 22:14 ./kernel/drivers/net/usb/qmi_wwan.c

Hi,

Yes - our Yocto is based on one from Toradex, so is set up a bit differently.

I changed the config using bitbake -c menuconfig virtual/kernel to include the USB Qualcomm Serial modem which includes the drivers which come with the base version of linux, and results in /sys/bus/usb-serial/drivers/qcserial appearing. So now :-

# dmesg | grep usb
[ 6.481399] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB0
[ 6.529149] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB1
[ 6.558658] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB2

and

# mmcli -L
/org/freedesktop/ModemManager1/Modem/0 [Sierra Wireless, Incorporated] EM7421

Do you think that the version coming from the Linux distribution is in some way incompatible with the EM7421 ?

did you try to compile the MBPL USB driver ?

Can the /dev/ttyUSB2 now in your platform communicate with AT command?

No…
[I suppose I could diff the source code between the Linux one that we are using and your latest version…]

Yes :slight_smile:

And ModemManager seems happy :-

# mmcli -m 0
-----------------------------
General | dbus path: /org/freedesktop/ModemManager1/Modem/0
| device id: a0e90c05254cc0b5800d4b711a240a3c82cdd0b0
-----------------------------
Hardware | manufacturer: Sierra Wireless, Incorporated
| model: EM7421
| firmware revision: SWI9X50C_01.14.03.00 b06bd3 jenkins 2020/09/23 10:53:35
| supported: gsm-umts
| current: gsm-umts
| equipment id: 356281110479116
-----------------------------
System | device: /sys/devices/platform/bus@5b000000/5b110000.usb3/xhci-cdns3/usb1/1-1/1-1.2
| drivers: qcserial
| plugin: Generic
| primary port: ttyUSB2
| ports: ttyUSB0 (qcdm), ttyUSB2 (at), ttyUSB1 (gps)
-----------------------------
Status | state: failed
| failed reason: sim-missing
| power state: on
| signal quality: 0% (cached)
-----------------------------
Modes | supported: allowed: 3g, 4g; preferred: none
| current: allowed: any; preferred: none
-----------------------------
IP | supported: ipv4, ipv6, ipv4v6

So I think we can call this closed.

Many thanks for your help !

I am supposing that the ModemManager would be dependent on the USB interface.
Is that true ?

Yes, in order for MM to work, the kernel bits managing the USB interfaces should already be working.

Do I need some specific USB driver ?

For the serial ports, qcserial as you already found out. If you also want QMI or MBIM you’ll also need cdc-wdm and qmi_wwan or cdc_mbim.

Is the max interface number = 3 important ?

No, that is not important. Given that it’s reporting a interface number 8, I’d assume it’s exposing a QMI interface. You must prefer QMI over AT.

| plugin: Generic
| primary port: ttyUSB2
| ports: ttyUSB0 (qcdm), ttyUSB2 (at), ttyUSB1 (gps)

While MM would be happy with the TTY-only modem, using QMI will give you support for a network interface, instead of needing PPP over ttyUSB2. Make sure you try to install the QMI and/or MBIM drivers in your yocto.

The best way to know how to best manage this type of modem in Linux is to use it on a standard distribution, like Ubuntu or Debian, and a recent enough MM installed there. If MM is using QMI in that distro, you want to use QMI in your own setup as well.

Hi aleksander0m,

Thanks for the definitive tips - very useful to confirm. The truth is that I don’t remember the details of what I did, other than I had got enough working to satisfy us that we would be able to achieve our goals. For now though this side-project is on hold, while core project get done !

But I am pretty sure we will want to implement something for this in the next few months. Possibly starting from a completely different Yocto build base…

All the best,

Tim