Get modem SIM properties for mmcli

Brendan Simon brendan.simon at
Mon Apr 24 23:22:22 UTC 2023

IND.T Classification: Public

Thanks Filip for your help.  I think I have enough info to retrieve the information.  I will git it a try.

Yes, it is to be parsed by a program/script.

The ModemManager I am currently using is quite old (v1.10 from Debian 10 Buster) so json (-J) output is practically non-existent.  I either parse the raw human text output or use the -K option and parse.

Thanks, Brendan.

From: Filip Kubicz <filip.kubicz at>
Sent: Monday, April 24, 2023 9:01 PM
To: Brendan Simon <brendan.simon at>
Cc: modemmanager-devel at
Subject: Re: Get modem SIM properties for mmcli

This email originated from EXTERNAL
I assumed you need to parse it for a program, but if you just need a human-readable version, you can also use
mmcli -i 0
For a quick overview, and to filter it, grep for the line that you are interested in.

Kind regards,

On Mon, Apr 24, 2023 at 12:58 PM Filip Kubicz <filip.kubicz at<mailto:filip.kubicz at>> wrote:
Hi Brendan,

There are a few approaches but a convenient method to retrieve values from mmcli is to use -J flag to get the JSON output.

For example, to get modem IMEI, you can do (in bash):
        modem="$(mmcli --list-modems -J | jq '."modem-list"[0]' -r)"
        imei="$(mmcli -m ${modem} -J | jq '.modem."3gpp".imei' -r)"
        echo ${imei}

You should be able to do the same with SIM card information, which you can obtain by running
        mmcli -i 0 -J
and then parsing it with jq tool to obtain exactly the value you need. Note that the SIM may be available under different number/path, which you can get from mmcli -m <modem number> and parsing "primary sim path"

Kind regards,

On Mon, Apr 24, 2023 at 12:34 PM Brendan Simon <brendan.simon at<mailto:brendan.simon at>> wrote:

IND.T Classification: Public

Is there a way to get the modem SIM properties via the mmcli command?
e.g. the ICCID or SimIdentifier
org.freedesktop.ModemManager1.Sim: ModemManager Reference Manual (<>

I couldn’t find anything in the help.

These docs mention the methods (such as sendpin, sendpuk, enablepin, changepin, setpreferrednetworks), which are available via mmcli.

It also mentions various properties (such as Active, SimIdentifier, IMSI, …), but I can’t find a way to retrieving those via mmcli (except maybe via issue AT commands).

org.freedesktop.ModemManager1.Sim: ModemManager Reference Manual (<>

Are these properties easily obtainable via mmcli?  I would think they should be, but I can’t find out how.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ModemManager-devel mailing list