USB Modem with modemmanager and networkmanager on embedded linux (yocto dunfell)

2.4k Views Asked by At

I am trying to get a USB Modem working on my embedded system which uses Linux from Yocto Dunfell with ModemManager and NetworkManager.

As you can see below, I am able to connect the modem on the network but I can't create the connection and bring up the interface.

Here are the outputs of different commands:

root@rpi-cm3:/# mmcli -L
    /org/freedesktop/ModemManager1/Modem/2 [Telit] LE910-EU V2
root@rpi-cm3:/# mmcli -m 2
  --------------------------------
  General  |            dbus path: /org/freedesktop/ModemManager1/Modem/2
           |            device id: d522cda0f436245296a7a9e47c981e9601af3bc7
  --------------------------------
  Hardware |         manufacturer: Telit
           |                model: LE910-EU V2
           |    firmware revision: 20.00.402
           |            supported: gsm-umts, lte
           |              current: gsm-umts, lte
           |         equipment id: 351622072422039
  --------------------------------
  System   |               device: /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5
           |              drivers: cdc_acm, cdc_ncm
           |               plugin: Telit
           |         primary port: ttyACM0
           |                ports: ttyACM1 (unknown), ttyACM3 (at), ttyACM5 (unknown), 
           |                       wwan0 (net), ttyACM0 (at), ttyACM4 (unknown), ttyACM2 (unknown)
  --------------------------------
  Status   |                state: registered
           |          power state: on
           |          access tech: umts
           |       signal quality: 57% (recent)
  --------------------------------
  Modes    |            supported: allowed: 2g; preferred: none
           |                       allowed: 3g; preferred: none
           |                       allowed: 2g, 3g; preferred: none
           |                       allowed: 4g; preferred: none
           |                       allowed: 2g, 4g; preferred: none
           |                       allowed: 3g, 4g; preferred: none
           |                       allowed: 2g, 3g, 4g; preferred: none
           |              current: allowed: 2g, 3g, 4g; preferred: none
  --------------------------------
  Bands    |            supported: egsm, dcs, utran-1, utran-8, eutran-1, eutran-3, eutran-7, 
           |                       eutran-8, eutran-20
           |              current: egsm, dcs, utran-1, eutran-1
  --------------------------------
  IP       |            supported: ipv4, ipv6, ipv4v6
  --------------------------------
  3GPP     |                 imei: 351622072422039
           |         registration: home
  --------------------------------
  3GPP EPS | ue mode of operation: csps-2
  --------------------------------
  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/2
  --------------------------------
  Bearer   |            dbus path: /org/freedesktop/ModemManager1/Bearer/1
root@rpi-cm3:/# mmcli -b 1
  ------------------------
  General    |  dbus path: /org/freedesktop/ModemManager1/Bearer/1
             |       type: default
  ------------------------
  Status     |  connected: no
             |  suspended: no
             | ip timeout: 20
  ------------------------
  Properties |        apn: gprs.swisscom.ch
             |    roaming: allowed
root@rpi-cm3:/# nmcli device show
GENERAL.DEVICE:                         wwan0
GENERAL.TYPE:                           wwan
GENERAL.HWADDR:                         00:00:11:12:13:14
GENERAL.MTU:                            1500
GENERAL.STATE:                          20 (unavailable)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --

GENERAL.DEVICE:                         eth0
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         B8:27:EB:F7:A1:B3
GENERAL.MTU:                            1500
GENERAL.STATE:                          10 (unmanaged)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
WIRED-PROPERTIES.CARRIER:               off
IP4.GATEWAY:                            --
IP6.GATEWAY:                            --

GENERAL.DEVICE:                         lo
GENERAL.TYPE:                           loopback
GENERAL.HWADDR:                         00:00:00:00:00:00
GENERAL.MTU:                            65536
GENERAL.STATE:                          10 (unmanaged)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
IP4.ADDRESS[1]:                         127.0.0.1/8
IP4.GATEWAY:                            --
IP6.ADDRESS[1]:                         ::1/128
IP6.GATEWAY:                            --
root@rpi-cm3:/# nmcli c show
NAME   UUID                                  TYPE  DEVICE 
modem  e7482093-2d4c-47fa-b52b-e6e282902453  gsm   --   
root@rpi-cm3:/# nmcli c up modem
Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).

I am stuck here and I was not able to find information on how to create the connection.

Something strange is that I was not able to configure the NetworkManager to manage the wwan interface automatically, I add to force it with the command:

nmcli dev set wwan0 managed yes

Thank you for your help

Best regards

1

There are 1 best solutions below

0
On

I've been struggling for days and days to make my modem work (i have an EM7455B) and I finally made it work with these commands (in that order):

unlock the sim (supposing 'mmcli -L' gives you '0', use this on '-m')

  • sudo mmcli -m 0 --sim=0 --pin=your_pin_here

this will allow you to enable the modem:

  • sudo mmcli -m 0 -e

and then connect:

  • sudo mmcli -m 0 --simple-connect="apn=your_apn_here"

verify

  • sudo mmcli -b 0