Diagnosing PIN and signal issues through the ModemManager

Nestor Hiebl | viewpointsystem n.hiebl at viewpointsystem.com
Thu Oct 13 07:44:37 UTC 2022

Hi all,

My company produces a device with the Sierra EM7565 Modem and we've been looking for a robust way to diagnose the root cause of problems it may encounter. Specifically, we require users to only use SIM cards that have had their PIN previously disabled. If they haven't done so, creating a mobile connection will quietly fail. My first question is: How can we reliably tell that the PIN has been disabled or that it is still enabled? Searching through the archive, I found the following quote at https://lists.freedesktop.org/archives/modemmanager-devel/2017-August/005555.html:

> Here's the issue: If PIN1 is currently disabled, some modem reports
> the info about another PIN, say PIN2, to a MBIM_CID_PIN query. When we
> try to enable PIN1, we won't know the retries count until after
> entering a PIN once. Suppose the retries count doesn't go to 0 after a
> wrong attempt (i.e. not in sim-puk state), we still can't query MM for
> the retries count of PIN1.

Currently, when inspecting a modem with PIN-disabled SIM in it using mmcli, we get output resembling the following:

  Status   |                 lock: sim-pin2
           |       unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
           |                state: enabled
           |          power state: on
           |       signal quality: 0% (cached)

Would I be correct in assuming that the lock field being set to "sim-pin2" always means "PIN diabled", whereas "sim-pin" always means "PIN enabled"?

My second question has to do with the relation between signal quality and modem state. According to https://www.freedesktop.org/software/ModemManager/doc/latest/ModemManager/ModemManager-Flags-and-Enumerations.html#MMModemState, MM_MODEM_STATE_ENABLED means:

"The modem is enabled and powered on but not registered with a network provider and not available for data connections."

I am not sure whether this indicates an error state or simply means that the modem has no reception. Our devices are often used in areas where reception is patchy or inconsistent, and we would love to have a way of reliably confirming that our issues come from that rather than a software issue on our part.

Thanks a lot!
Flags and Enumerations: ModemManager Reference Manual - freedesktop.org<https://www.freedesktop.org/software/ModemManager/doc/latest/ModemManager/ModemManager-Flags-and-Enumerations.html#MMModemState>
MM_BEARER_IP_METHOD_UNKNOWN. Unknown method. MM_BEARER_IP_METHOD_PPP. Use PPP to get IP addresses and DNS information. For IPv6, use PPP to retrieve the 64-bit Interface Identifier, use the IID to construct an IPv6 link-local address by following RFC 5072, and then run DHCP over the PPP link to retrieve DNS settings.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20221013/f2fbf65e/attachment.htm>

More information about the ModemManager-devel mailing list