0

I am working with nmcli to create a modem connection using a SIM.

I need to know: is there a command (possibily, a nmcli command) that queries the SIM and returns an answer that tells whether the PIN is enabled or not on that SIM?

Thanks in advance.

EM90
  • 552
  • 1
  • 8
  • 22

1 Answers1

1

You can do it using mmcli.

Get modem index using:

$ mmcli -L
    Found 1 modems:
    /org/freedesktop/ModemManager1/Modem/0 [huawei] E176

and then get the modem info (including SIM info) using:

$ sudo mmcli -m 0
...
  -------------------------
  Status   |           lock: 'sim-pin'
           | unlock retries: 'sim-pin (3), sim-puk (10)'
           |          state: 'locked'
           |    power state: 'on'
           |    access tech: 'unknown'
           | signal quality: '0' (cached)
  -------------------------
...
  SIM      |           path: '/org/freedesktop/ModemManager1/SIM/0'
...

See link

ofirule
  • 4,233
  • 2
  • 26
  • 40
  • Thanks a lot, I assume that the `lock` and the `state` are telling me what I want to know. – EM90 Dec 23 '20 at 13:32