mmcli
List modem
mmcli -L
/org/freedesktop/ModemManager1/Modem/0 [FIBOCOM] L830-EB-00
info
mmcli -m 0
--------------------------------
General | path: /org/freedesktop/ModemManager1/Modem/0
| device id: 87d82c9c3bb77a931a97e6f388e6063b9e8428eb
--------------------------------
Hardware | manufacturer: FIBOCOM
| model: L830-EB-00
| firmware revision: 18300.1002.00.01.01.11
| h/w revision: L830-EB-02 v1.0.1
| supported: gsm-umts, lte
| current: gsm-umts, lte
| equipment id: 864949030999141
--------------------------------
System | device: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-6
| drivers: cdc_acm, cdc_mbim
| plugin: fibocom
| primary port: cdc-wdm1
| ports: cdc-wdm1 (mbim), ttyACM0 (at), wwan0 (net)
--------------------------------
Status | unlock retries: sim-pin (3)
| state: enabled
| power state: on
| signal quality: 25% (recent)
--------------------------------
Modes | supported: allowed: 3g; preferred: none
| allowed: 4g; preferred: none
| allowed: 3g, 4g; preferred: none
| allowed: 3g, 4g; preferred: 3g
| allowed: 3g, 4g; preferred: 4g
| current: allowed: 3g, 4g; preferred: 4g
--------------------------------
Bands | supported: utran-1, utran-5, utran-8, eutran-1, eutran-3, eutran-5,
| eutran-7, eutran-8, eutran-20, eutran-28
| current: utran-1, utran-5, utran-8, eutran-1, eutran-3, eutran-5,
| eutran-7, eutran-8, eutran-20, eutran-28
--------------------------------
IP | supported: ipv4, ipv6, ipv4v6
--------------------------------
3GPP | imei: 864949030999141
| enabled locks: sim
| registration: idle
--------------------------------
3GPP EPS | ue mode of operation: csps-2
--------------------------------
SIM | primary sim path: /org/freedesktop/ModemManager1/SIM/0
send PIN to SIM
mmcli -i 0 --pin=0000
successfully sent PIN code to the SIM
Some additional commands for handling SIM PINs are
enable PIN locking
--enable-pin
disable PIN locking
--disable-pin
changing the PIN
--change-pin=NEW_PIN
`mmcli -i 0 --pin 0000 --change-pin=`
unlocking a PUK-locked (Personal unblocking code)
--puk=PUK
Enable modem
mmcli --modem 0 --enable
successfully enabled the modem
The modem can not be enabled if there is a failure if you get a failure here, make sure that the status shown by the “mmcli –modem 0”. For ex., the following error is due to the PIN is not entered:
mmcli --modem 0 --enable
error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: Cannot enable modem: device locked'
mmcli -m 0
...
Status | lock: sim-pin
| unlock retries: sim-pin (3)
| state: locked
| power state: low
| signal quality: 0% (cached)
...
Scan available 3GPP networks
...
mmcli --modem 0 --3gpp-scan --timeout=300
---------------------
3GPP scan | networks: 20416 - T-Mobile NL (gprs, available)
| 20404 - vodafone NL (gprs, available)
| 20416 - T-Mobile NL (gprs, available)
| 20408 - NL KPN (gprs, available)
| 20408 - NL KPN (gprs, available)
...
Simple connect
mmcli -m 0 --simple-connect="pin=0000,apn=internet"
successfully connected the modem
Simple disconnect
mmcli -m 0 --simple-disconnect
Sending SMS
Create a message
mmcli -m 0 --messaging-create-sms="text='Hello from SE30',number='+1234567890'"
Successfully created new SMS: /org/freedesktop/ModemManager1/SMS/1
Write down the SMS id from output (here: 1)
Send the message
mmcli -s 1 --send
successfully sent the SMS
Source:
http://junyelee.blogspot.com/2021/03/linux-mobile-interface-broadband-model.html
https://ubuntu.com/core/docs/networkmanager/configure-cellular-connections