EG21 ModemManager showing 'registered' but not 'connected'

We have an existing IoT platform that was previously using the Sierra Wireless MC7455. We are looking at switching to the EG21 and hoping that it is mostly a drop-in replacement. We’re using the same IoT SIM which has previously been demonstrated to work well in multiple countries in several continents. The only thing we’re changing here (so far) is the LTE module which, in this case, is an EG21.

It looks like the module does achieve a registration with the network, but ModemManager indicates the ‘state’ stays ‘registered’.

root@0004f31dbf77:~# mmcli -m 0
  --------------------------------
  General  |            dbus path: /org/freedesktop/ModemManager1/Modem/0
           |            device id: 39c06785d5d506a40d1ddaa901292b089700ed81
  --------------------------------
  Hardware |         manufacturer: QUALCOMM INCORPORATED
           |                model: QUECTEL Mobile Broadband Module
           |    firmware revision: EG21GGBR07A11M1G
           |         h/w revision: 10000
           |            supported: gsm-umts, lte
           |              current: gsm-umts, lte
           |         equipment id: [redacted]
  --------------------------------
  System   |               device: /sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.3
           |              drivers: option1, qmi_wwan
           |               plugin: Quectel
           |         primary port: cdc-wdm0
           |                ports: ttyUSB0 (qcdm), ttyUSB2 (at), cdc-wdm0 (qmi), wwan0 (net),
           |                       ttyUSB3 (at)
  --------------------------------
  Numbers  |                  own: 15[redacted]
  --------------------------------
  Status   |                 lock: sim-pin2
           |       unlock retries: sim-pin (3), sim-pin2 (10), sim-puk (10), sim-puk2 (10)
           |                state: registered
           |          power state: on
           |          access tech: lte
           |       signal quality: 47% (recent)
  --------------------------------
  Modes    |            supported: allowed: 2g; preferred: none
           |                       allowed: 3g; preferred: none
           |                       allowed: 4g; preferred: none
           |                       allowed: 2g, 3g; preferred: 3g
           |                       allowed: 2g, 3g; preferred: 2g
           |                       allowed: 2g, 4g; preferred: 4g
           |                       allowed: 2g, 4g; preferred: 2g
           |                       allowed: 3g, 4g; preferred: 3g
           |                       allowed: 3g, 4g; preferred: 4g
           |                       allowed: 2g, 3g, 4g; preferred: 4g
           |                       allowed: 2g, 3g, 4g; preferred: 3g
           |                       allowed: 2g, 3g, 4g; preferred: 2g
           |              current: allowed: 2g, 3g, 4g; preferred: 4g
  --------------------------------
  Bands    |            supported: egsm, dcs, pcs, g850, 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-18, eutran-19,
           |                       eutran-20, eutran-25, eutran-26, eutran-28, eutran-38, eutran-39,
           |                       eutran-40, eutran-41, utran-19
           |              current: egsm, dcs, pcs, g850, 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-18, eutran-19,
           |                       eutran-20, eutran-25, eutran-26, eutran-28, eutran-38, eutran-39,
           |                       eutran-40, eutran-41, utran-19
  --------------------------------
  IP       |            supported: ipv4, ipv6, ipv4v6
  --------------------------------
  3GPP     |                 imei: [redacted]
           |          operator id: 302220
           |         registration: home
  --------------------------------
  3GPP EPS | ue mode of operation: csps-2
  --------------------------------
  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/0
  --------------------------------
  Bearer   |            dbus path: /org/freedesktop/ModemManager1/Bearer/35

The bearer number continues to increase over time.

NetworkManager shows the cdc-wdm0 connection as ‘disconnected’ but ‘available’.

root@0004f31dbf77:~# nmcli
eth1: connected to eth1
        "eth1"
        ethernet (fec), 00:04:F3:1D:BF:77, hw, mtu 1500
        ip4 default
        inet4 172.16.1.54/24
        route4 0.0.0.0/0
        route4 172.16.1.0/24
        inet6 fe80::204:f3ff:fe1d:bf77/64
        route6 ff00::/8
        route6 fe80::/64

cdc-wdm0: disconnected
        "cdc-wdm0"
        1 connection available
        gsm (option1, qmi_wwan), hw

wlan0: disconnected
        "Atheros Wi-Fi"
        wifi (ar6k_wlan), 00:04:F3:1D:BF:79, hw, mtu 1500

eth0: unavailable
        "eth0"
        ethernet (fec), 00:04:F3:1D:BF:78, hw, mtu 1500

can0: unmanaged
        "can0"
        can (flexcan), hw, mtu 16

can1: unmanaged
        "can1"
        can (flexcan), hw, mtu 16

sit0: unmanaged
        "sit0"
        iptunnel (sit), sw, mtu 1480

lo: unmanaged
        "lo"
        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

DNS configuration:
        servers: 172.16.1.10 8.8.8.8
        domains: [redacted]
        interface: eth1

Use "nmcli device show" to get complete information about known devices and
"nmcli connection show" to get an overview on active connection profiles.

Consult nmcli(1) and nmcli-examples(5) manual pages for complete usage details.

Reviewing profiles, the first profile APN is empty:

root@0004f31dbf77:~# qmicli -d /dev/cdc-wdm0 -p --wds-get-profile-list=3gpp
Profile list retrieved:
        [1] 3gpp -
                APN: ''
                PDP type: 'ipv4-or-ipv6'
                PDP context number: '1'
                Username: ''
                Password: ''
                Auth: 'none'
                No roaming: 'no'
                APN disabled: 'no'
        [2] 3gpp -
                APN: 'ims'
                PDP type: 'ipv4-or-ipv6'
                PDP context number: '2'
                Username: ''
                Password: ''
                Auth: 'none'
                No roaming: 'no'
                APN disabled: 'no'
        [3] 3gpp -
                APN: 'sos'
                PDP type: 'ipv4-or-ipv6'
                PDP context number: '3'
                Username: ''
                Password: ''
                Auth: 'none'
                No roaming: 'no'
                APN disabled: 'no'
        [4] 3gpp -
                APN: 'tmus'
                PDP type: 'ipv4-or-ipv6'
                PDP context number: '4'
                Username: ''
                Password: ''
                Auth: 'none'
                No roaming: 'no'
                APN disabled: 'no'

We do have the correct APN in our system connections file:

root@0004f31dbf77:/etc/NetworkManager/system-connections# cat nm.cellular
#Default Cellular Connection Options

[connection]
id=cellular
type=gsm

[gsm]
apn=super
number=*99#

[ppp]
lcp-echo-failure=3
lcp-echo-interval=5

[ipv6]
method=auto

[ipv4]
method=auto

It looks like we’re most of the way there, but we’d like to determine why we don’t see a connection established even though we get a registration on a ‘home’ network. Hopefully this is enough information to go on.

Remove MM, configure the missing APN on the modem directly with AT+CGDCONT and then check everything manually with AT+CGPADDR, etc.

Thank you for the information, jfrog.

I’ve played around with AT+CGDCONT and AT+CGPADDR a bit over the last few days and I have some results but I’m not sure how to interpret them. They are below.

I disabled ModemManager, and can issue the following commands directly to the module:


AT+COPS?
+COPS: 0,0,"TELUS",7

OK
AT+CGDCONT=?
+CGDCONT: (1-24,100-179),"IP",,,(0-2),(0-4),(0-1),(0-1)
+CGDCONT: (1-24,100-179),"PPP",,,(0-2),(0-4),(0-1),(0-1)
+CGDCONT: (1-24,100-179),"IPV6",,,(0-2),(0-4),(0-1),(0-1)
+CGDCONT: (1-24,100-179),"IPV4V6",,,(0-2),(0-4),(0-1),(0-1)

OK
AT+CGDCONT?
+CGDCONT: 1,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 2,"IPV4V6","ims","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 3,"IPV4V6","sos","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,1
+CGDCONT: 4,"IPV4V6","tmus","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0

OK
AT+CGPADDR=1
+CGPADDR: 1,"162.174.129.240,38.7.251.144.240.107.45.101.0.0.0.31.17.140.67.1"

OK
AT+CSQ
+CSQ: 15,99

OK
AT+QSPN
+QSPN: "TELUS","TELUS","",0,"302220"

OK
AT+QGDCNT?
+QGDCNT: 14239,11092

It looks like even with an empty APN I get a set of addresses from the network. My signal strength appears OK and it’s a network I recognize. I even see some data packets going back and forth.

As soon as I exit the serial connection to the module, though, and I re-start ModemManager, it goes through the process of re-establishing a network connection and gets stuck at ‘registered’.

I’m expecting a network connection (cdc-wdm0) in NetworkManager. With ModemManager disabled, I obviously don’t get this. Assuming I’m interpreting this correctly, is it likely that ModemManager not working as expected? If the problem is one level up in the stack then I likely need to seek help elsewhere. I appreciate any direction or advice you might have.

I would set the APN name in context #1
You can switch the modem from QMI to ECM mode, then you will only need to run DHCP on that interface, it will be no need in MM at all.

I’m starting to wonder if ModemManager isn’t actually the problem here. Making sure that ModemManager does not start at all on boot (removing it from systemd entirely) I’m now having to manually issue commands.

Note: I’ve tried this with both IP and IPV4V6—the result is the same.

AT+COPS?
+COPS: 0,0,"TELUS",2

OK
AT+CGDCONT?
+CGDCONT: 1,"IP","super","0.0.0.0",0,0,0,0
+CGDCONT: 2,"IPV4V6","ims","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 3,"IPV4V6","sos","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,1
+CGDCONT: 4,"IPV4V6","tmus","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0

OK
AT+CSQ
+CSQ: 9,99

OK
AT+QSPN
+QSPN: "TELUS","TELUS","",0,"302220"

OK
AT+CGATT?
+CGATT: 1

OK
AT+CGACT?
+CGACT: 1,0
+CGACT: 2,0
+CGACT: 3,0
+CGACT: 4,0

OK
AT+CGACT=1,1
+CME ERROR: 100

Checking the manual (Section 15.4 in EC2x&EC9x&EG2x-G&EM05 Series
AT Commands Manual, 2.0) I don’t see a listing for CME 100.

Is there something obvious I’m missing here?

Access technology = 2 is UTRAN, while you need 7 (E-UTRAN) like you had in the earlier example.

It is worse than it was before, so you probably need to get a better signal first.

This is now resolved: the root of the issue was the SIM card not working with the selected APN.

We have a global IoT SIM from a provider that also has older slightly-less-global SIMs that look otherwise identical. We were able to determine that the SIM was not correct by checking the iccid value, which you can do using this ModemManager command:

mmcli -i /org/freedesktop/ModemManager1/SIM/0 --output-keyvalue

where /org/freedesktop/ModemManager1/SIM/0 is the SIM being queried (it could be a different number if you have more than one or if the number is something other than 0).

In our case, this was down to a faulty belief that we were using the correct SIM card, and in hindsight, all the symptoms we observed were consistent with that.

@jfrog: Thank you for the troubleshooting steps—it turns out our issue was a bit more basic than you had expected, which is a good thing.

1 Like