Assistance Needed with SIM Card Issue Causing QMI Operation Failures

Aleksander Morgado aleksandermj at
Tue Feb 13 11:56:24 UTC 2024

> i'm seeing similar (not necessarily related) problems with an EC21 when using Telefonica SIM cards (other cards work fine, these work sporadically). It seems as if those cards have a longer startup time. With the following patch the cards work most of the time (ModemManager 1.18.6):
> ---
>  src/mm-iface-modem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
> index 8bf0893c01a2..be05bf4a7a8b 100644
> --- a/src/mm-iface-modem.c
> +++ b/src/mm-iface-modem.c
> @@ -420,7 +420,7 @@ mm_iface_modem_abort_invocation_if_state_not_reached (MMIfaceModem          *sel
>   * are modems on which the SIM takes more than 15s to be ready, luckily,
>   * they happen to be QMI modems where the SIM's iccid in load_sim_slots
>   * lets us know that there is a sim */
>  /* Time between retries */
> I have no idea why this patch is working since the EC21 is a QMI modem which, according to the comment,  should not be affected by this...
> If someone with a deeper understanding of ModemManagers internals would like to look into this i would be happy to offer my support.

There have been several updates in this regard in MM git master, some
of them may already be in MM 1.22, but don't know exact details. The
main issue with this approach of increasing the number of retries is
that for the case where there is no SIM card inserted at all, the
modem would go over all the requested retries before it is exposed in
DBus, so it would take a long time.

Ideally, if we do 6 checks and it fails, we would mark the modem as
invalid as we do. But as soon as the SIM card is then properly
detected by the device, the device should notify about the change, and
in that case we would re-probe the whole device from scratch. If that
is not happening with MM git master, please let me know and we'll
debug further. Maybe we're not setting up the event handlers properly
while in failed state.


More information about the ModemManager-devel mailing list