Get modem SIM properties for mmcli

Filip Kubicz filip.kubicz at tier.app
Mon Apr 24 11:01:17 UTC 2023


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,
Filip


On Mon, Apr 24, 2023 at 12:58 PM Filip Kubicz <filip.kubicz at tier.app> 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,
> Filip
>
>
> On Mon, Apr 24, 2023 at 12:34 PM Brendan Simon <
> brendan.simon at ind-technology.com.au> 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
>> (www.freedesktop.org)
>> <https://www.freedesktop.org/software/ModemManager/doc/latest/ModemManager/gdbus-org.freedesktop.ModemManager1.Sim.html#gdbus-property-org-freedesktop-ModemManager1-Sim.SimIdentifier>
>>
>>
>>
>> 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
>> (www.freedesktop.org)
>> <https://www.freedesktop.org/software/ModemManager/doc/latest/ModemManager/gdbus-org.freedesktop.ModemManager1.Sim.html>
>>
>>
>>
>> Are these properties easily obtainable via mmcli?  I would think they
>> should be, but I can’t find out how.
>>
>>
>>
>> Thanks,
>>
>> Brendan.
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20230424/5673641b/attachment.htm>


More information about the ModemManager-devel mailing list