Reading IMSI

Aleksander Morgado aleksander at aleksander.es
Wed Sep 6 16:45:30 UTC 2017


Hey,

On Wed, Sep 6, 2017 at 6:22 PM, Nathaniel Haggard <natester at gmail.com> wrote:
> I'd like to read the IMSI just before assigning APN, but
>
> ~# mmcli -m 0 --command="AT+CIMI"
> error: command failed:
> 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: Cannot
> send AT command to modem: operation only allowed in debug mode'
>
> and sometimes:
>

mmcli --command is limited only for when ModemManager runs with --debug.

But you should have the IMSI reported in the "SIM object" associated
to the modem. E.g. if your SIM object is in index #0, you may already
have the value you need in the "mmcli -i 0" output.

> ~# qmicli -d /dev/cdc-wdm0 --dms-uim-get-imsi | grep IMSI: | cut -d "'" -f2
> error: couldn't create client for the 'dms' service: CID allocation failed
> in the CTL client: Transaction timed out
>
> other times I get this:
>
> ~# qmicli -d /dev/cdc-wdm0 --dms-uim-get-imsi
> [/dev/cdc-wdm0] UIM IMSI retrieved:
> IMSI: '310410874358522'
>
>
> I thought qmi-proxy took care of locking issues.  How can I get the IMSI
> reliably?
>

Yes, but you need to explicitly select the proxy usage, by adding "-p"
in all your qmicli calls. Otherwise, you're competing with
ModemManager in the communication through the cdc-wdm device.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list