mmcli(1)

๐Ÿ“ฆ
version 1.25.95_git20260527 ยท 3 versions
, in alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ mmcli ๐ŸŽ€ Control and monitor the ModemManager โœจ

User Commands, section 1 ๐Ÿ’–

โœจ NAME โœจ

mmcli - Control and monitor the ModemManager ๐Ÿ“ฑ

๐Ÿ’… SYNOPSIS ๐Ÿ’…

mmcli [OPTION...]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so ModemManager is a DBus-powered Linux daemon ๐Ÿงš and it gives you one unified, high level API for talking to (mobile broadband) modems. it acts as a standard RIL (Radio Interface Layer) ๐Ÿ“ก and different connection managers, like NetworkManager, can use it. the built-in plugin architecture is the real iconic part: ModemManager talks to really different kinds of modems through really different kinds of ports โœจ. on top of the standard AT serial ports, it also supports Qualcomm-based QCDM and QMI ports ๐Ÿ’œ.

๐Ÿฆ‹ HELP OPTIONS ๐Ÿฆ‹

  • -h, --help โ€” shows you a summary of the options, sorted by group ๐Ÿ“‹
  • --help-all โ€” shows every group and every option ๐Ÿ‘€
  • --help-manager โ€” shows the manager specific options ๐Ÿ‘‘
  • --help-common โ€” shows the common options ๐Ÿซถ. these are used for defining the device an option operates on, like modems, bearers, SIMs, SMS's, etc.
  • --help-modem โ€” shows the modem specific options ๐Ÿ“ฑ
  • --help-3gpp โ€” shows the 3GPP specific options ๐ŸŒˆ
  • --help-cdma โ€” shows the CDMA specific options ๐Ÿ“
  • --help-simple โ€” shows the simple options ๐ŸŽ€. these are your go-to for getting connected or disconnected and understanding the state of things super fast, without stressing about the details โœจ
  • --help-location โ€” shows the location or positioning specific options ๐Ÿ“
  • --help-messaging โ€” shows the messaging specific options ๐Ÿ’ฌ. see also --help-sms, which is related ๐Ÿซถ
  • --help-cell-broadcast โ€” shows the cell broadcast specific options. is related. ๐Ÿ™ˆ
  • --help-time โ€” shows the time specific options โฐ
  • --help-firmware โ€” shows the firmware specific options ๐Ÿ”ง
  • --help-oma โ€” shows the OMA specific options ๐Ÿงš
  • --help-sim โ€” shows the SIM card specific options ๐Ÿ’ณ
  • --help-bearer โ€” shows the bearer specific options ๐Ÿฆ‹
  • --help-sms โ€” shows the SMS specific options ๐Ÿ’Œ. see also --help-messaging, which is related ๐Ÿ’œ

๐Ÿ‘‘ MANAGER OPTIONS ๐Ÿ‘‘

  • -B, --get-daemon-version โ€” asks for the version of the ModemManager daemon that's currently running ๐Ÿ”ฅ
  • -G, --set-logging=[ERR|WARN|INFO|DEBUG] โ€” sets the logging level in the ModemManager daemon ๐Ÿ“. if you want the debugging info, go with DEBUG. every level above DEBUG gives you less detail, and honestly in most cases ERR (for displaying errors) has the messages that matter most ๐Ÿ™ˆ

the default mode is ERR ๐Ÿ’….

  • -L, --list-modems โ€” lists the available modems ๐Ÿ“‹
  • -M, --monitor-modems โ€” lists the available modems and keeps watch for modems being added or removed ๐Ÿ‘€
  • -S, --scan-modems โ€” scans for any potential new modems ๐Ÿ”. this is only useful when you're expecting pure RS232 modems, since the kernel doesn't notify about those automatically ๐Ÿฅฒ
  • -I, --inhibit-device=[UID] โ€” inhibits a specific device so ModemManager won't use it ๐Ÿšซ. the UID you give should be the value of the Device property exposed by a given modem. that's equal to the ID_MM_PHYSDEV_UID if one is set, or otherwise equal to the full device sysfs path ๐Ÿง .
โš ๏ธ this command won't exit right away, because that would quietly remove the inhibition. you have to stop the mmcli process by hitting Ctrl+C to un-inhibit the device ๐Ÿ’€.

when a device is inhibited this way, ModemManager will disable the modem (which stops any ongoing connection) and won't use it again until it's uninhibited ๐Ÿ˜ญ.

  • --report-kernel-event=['KEY1=VALUE1,KEY2=VALUE2,...'] โ€” manually reports kernel events, instead of relying on udev ๐Ÿ”Œ. this is handy if the daemon is running with --no-auto-scan, or if the system was built without udev support ๐Ÿ› ๏ธ.

the supported KEYs are:

  • 'action' โ€” the action to report, one of 'add' or 'remove'. this one is required โ—
  • 'subsystem' โ€” the subsystem of the specific port being reported, e.g. 'tty' (for serial ports), 'net' (for network interfaces), or 'usbmisc' (for cdc-wdm ports) ๐ŸŽ€
  • 'name' โ€” the name of the port being reported, e.g. 'ttyACM0', 'wwan0' or 'cdc-wdm0' ๐Ÿฆ‹
  • 'uid' โ€” the specific UID of the device, equivalent to the ID_MM_PHYSDEV_UID udev tag ๐Ÿ’–. all ports reported with the same 'UID' value are treated as part of the same device, which can be useful for modems with multiple platform TTYs ๐Ÿซถ
  • --report-kernel-event-auto-scan โ€” when built with udev support but the daemon is running with --no-auto-scan, this lets you automatically report kernel events based on udev ๐Ÿค–

this command won't exit right away either ๐Ÿ™ˆ. you have to stop the mmcli process by hitting Ctrl+C to stop monitoring for new events โœ‹.

๐Ÿซง COMMON OPTIONS ๐Ÿซง

all of the options below take a PATH or INDEX argument ๐ŸŽฏ. if you don't give an action, you get the default information about the modem, bearer, etc. instead โœจ.

the PATH and INDEX get created automatically when the modem is plugged in ๐Ÿ”Œ. you can find them with mmcli -L, which gives you something like this (for modems only):

Found 1 modems:
  /org/freedesktop/ModemManager1/Modem/4

in this case, the INDEX is 4 and the PATH is the entire string above ๐Ÿ’….

for bearers, SIMs and SMS, the PATH is slightly different ๐Ÿ‘€. the Modem part gets swapped out for the object name in use, like Bearer. for example:

/org/freedesktop/ModemManager1/Bearer/4
  • -m, --modem=[PATH|INDEX] โ€” specifies a modem ๐Ÿ“ฑ
  • -b, --bearer=[PATH|INDEX] โ€” specifies a bearer ๐Ÿฆ‹
  • -i, --sim=[PATH|INDEX] โ€” specifies a SIM card ๐Ÿ’ณ
  • -s, --sms=[PATH|INDEX] โ€” specifies an SMS ๐Ÿ’Œ

๐Ÿ“ฑ MODEM OPTIONS ๐Ÿ“ฑ

all of the modem options below use the --modem or -m switch to pick which modem to act on ๐ŸŽ€.

some operations need a MODE ๐ŸŒˆ. a MODE can be any combination of the modes the modem actually supports. in the perfect case, these are possible:

  • '2G' โ€” 2G technologies, e.g. EDGE, CDMA1x ๐Ÿ“ถ
  • '3G' โ€” 3G technologies, e.g. HSPA, EV-DO ๐Ÿ“ถ
  • '4G' โ€” 4G technologies, e.g. LTE ๐Ÿš€
  • 'ANY' โ€” for all supported modes ๐ŸŒŸ
  • -w, --monitor-state โ€” keeps an eye on the state of a given modem ๐Ÿ‘€
  • -e, --enable โ€” enables a given modem โšก. this powers up the antenna, starts the automatic registration process, and generally gets the modem ready to be connected ๐Ÿ’–
  • -d, --disable โ€” disables a given modem ๐Ÿ˜ด. this disconnects any existing connection(s) for the modem and puts it into a low power mode ๐Ÿ”‹
  • -r, --reset โ€” resets the modem to the settings it had when it was power cycled ๐Ÿ”„
  • --factory-reset=CODE โ€” resets the modem to its original factory default settings ๐Ÿญ

the CODE you provide is vendor specific ๐Ÿงพ. without the correct vendor code, this operation is unlikely to succeed ๐Ÿ™ƒ. this isn't a common user action, so maybe don't go poking at it just for fun ๐Ÿ’€.

  • --command=COMMAND โ€” sends an AT COMMAND to the given modem ๐Ÿ“Ÿ. for example, COMMAND could be 'AT+GMM' to probe for phone model information ๐Ÿ”. this operation is only available when ModemManager is run in debug mode ๐Ÿ› ๏ธ.
  • --create-bearer=['KEY1=VALUE1,KEY2=VALUE2,...'] โ€” creates a new packet data bearer for a given modem ๐ŸŒ. the KEYs and some VALUEs are listed below:
    • 'apn' โ€” the Access Point Name. required in 3GPP ๐Ÿ“ก
    • 'ip-type' โ€” the addressing type ๐Ÿงญ. given as a MMBearerIpFamily value (e.g. 'ipv4', 'ipv6', 'ipv4v6'). optional in 3GPP and CDMA
    • 'allowed-auth' โ€” the authentication method to use ๐Ÿ”. given as a MMBearerAllowedAuth value (e.g. 'none|pap|chap|mschap|mschapv2|eap'). optional in 3GPP
    • 'user' โ€” the user name (if any) the network requires ๐Ÿ™‹. optional in 3GPP
    • 'password' โ€” the password (if any) the network requires ๐Ÿคซ. optional in 3GPP
    • 'allow-roaming' โ€” a flag for whether the connection is allowed while roaming ๐Ÿงณ, given as a boolean value (i.e 'yes' or 'no'). optional in 3GPP
    • 'rm-protocol' โ€” the protocol of the Rm interface ๐Ÿ”—, given as a MMModemCdmaRmProtocol value (e.g. 'async', 'packet-relay', 'packet-network-ppp', 'packet-network-slip', 'stu-iii'). optional in CDMA
    • 'number' โ€” the telephone number to dial โ˜Ž๏ธ. required in POTS
  • --delete-bearer=[PATH|INDEX] โ€” deletes a bearer from a given modem ๐Ÿ—‘๏ธ
  • --set-allowed-modes=[MODE1|MODE2|...] โ€” sets the allowed modes for a given modem ๐ŸŽš๏ธ. for the possible modes, check the top of this section ๐Ÿ‘†
  • --set-preferred-mode=MODE โ€” sets the preferred MODE for the given modem ๐ŸŒŸ. the MODE must be one of the allowed modes you set with --set-allowed-modes. the possible MODE arguments are detailed at the top of this section ๐Ÿ’…
  • --set-current-bands=[BAND1|BAND2|...] โ€” sets the bands the modem should use ๐Ÿ“ป. these are frequency ranges. there are quite a few supported bands, and listing them all here would be extremely long, so for the details check out the MMModemBand documentation ๐Ÿ“š

an example would be: 'egsm|dcs|pcs|g850', which selects all the GSM frequency bands ๐ŸŒ.

  • --set-primary-sim-slot=[SLOT] โ€” requests a switch to the primary SIM slot ๐Ÿ”

the given SLOT must be a valid slot number in the [1,N] range, where N is the number of SIM slots available in the system ๐ŸŽฐ.

  • --inhibit โ€” inhibits a specific modem so ModemManager won't use it ๐Ÿšซ. this is completely equivalent to --inhibit-device, with one difference: the modem has to be managed by the daemon at the time the inhibition is requested ๐Ÿง.
โš ๏ธ this command won't exit right away, because that would quietly remove the inhibition. you have to stop the mmcli process by hitting Ctrl+C to un-inhibit the device ๐Ÿ’€.

when a device is inhibited this way, ModemManager will disable the modem (which stops any ongoing connection) and won't use it again until it's uninhibited ๐Ÿ˜ญ.

โœจ 3GPP OPTIONS โœจ

okay so 3GPP stands for the 3rd Generation Partnership Project, which is basically a squad of telecom associations working together ๐Ÿค these options are for devices that speak 3GPP ๐Ÿ“ฑ

you can also control USSD (Unstructured Supplementary Service Data) sessions with these, which is giving secret-code vibes ๐Ÿ•ต๏ธโ€โ™€๏ธ

every 3GPP option below uses --modem or -m to pick which modem it's acting on ๐ŸŽ€

  • --3gpp-scan โ€” scans for available 3GPP networks ๐Ÿ”
  • --3gpp-register-home โ€” asks a given modem to register on its home network ๐Ÿ 

this registers with the default network(s) the modem specifies, bestie ๐Ÿ’…

  • --3gpp-register-in-operator=MCCMNC โ€” asks a given modem to register on the network of the operator with the given MCCMNC (Mobile Country Code, Mobile Network Code) ๐ŸŒ this code is used for GSM/LTE, CDMA, iDEN, TETRA and UMTS public land mobile networks and some satellite mobile networks. the ITU-T Recommendation E.212 is the one that defines mobile country codes, so that's where to look if you're curious ๐Ÿค“
  • --3gpp-ussd-status โ€” checks the status of ANY ongoing USSD session ๐Ÿ‘€
  • --3gpp-ussd-initiate=COMMAND โ€” asks the given modem to start a USSD session with COMMAND ๐Ÿ“ž

for example, COMMAND could be '*101#' to check your current pre-pay balance ๐Ÿ’ธ

  • --3gpp-ussd-respond=RESPONSE โ€” when you start a USSD session, the network might send its own request and need a RESPONSE back. this option is how you answer it ๐Ÿซถ
  • --3gpp-ussd-cancel โ€” cancels an ongoing USSD session for a given modem ๐Ÿ™…โ€โ™€๏ธ
  • --3gpp-disable-facility-lock=FACILITY,CONTROL_KEY โ€” turns off the selected facility lock using the control key you give it ๐Ÿ”“
    • FACILITY โ€” one of these lock types:
      • 'net-pers' โ€” network personalization
      • 'net-sub-pers' โ€” network subset personalization
      • 'provider-pers' โ€” provider personalization
      • 'corp-pers' โ€” corporate personalization
    • CONTROL_KEY โ€” the alphanumeric code that unlocks the facility ๐Ÿ”‘

โœจ CDMA OPTIONS โœจ

okay the CDMA (Code Division Multiple Access) options are all giving "you need --modem or -m first" ๐ŸŽ€ no shortcuts here, bestie

  • --cdma-activate=CARRIER โ€” activates the given modem using OTA (Over the Air) settings ๐Ÿ“ก the CARRIER is a code the network hands over for the default settings they provide ๐ŸŽ

โœจ SIMPLE OPTIONS โœจ

every simple option has to be used with --modem or -m, no exceptions ๐Ÿ’–

  • --simple-connect=['KEY1=VALUE1,KEY2=VALUE2,...'] โ€” runs a full connection sequence using KEY / VALUE pairs ๐Ÿš€ you can use the --create-bearer options too, plus any of these:
    • 'pin' โ€” your SIM-PIN unlock code ๐Ÿ”
    • 'operator-id' โ€” the ETSI MCC-MNC of a network you want to force registration on ๐Ÿ“ถ
  • --simple-disconnect โ€” disconnects ALL connected bearers for a given modem ๐Ÿ‘‹

โœจ LOCATION OPTIONS โœจ

these are the location vibes ๐Ÿ—บ๏ธ they figure out where you are using Global Positioning System (GPS) or straight from your mobile network infrastructure (either 3GPP or 3GPP2) ๐Ÿ›ฐ๏ธ

every location option must be used with --modem or -m ๐Ÿ’…

  • --location-status โ€” shows the current status of discovering our location ๐Ÿงญ
  • --location-get โ€” shows ALL the location information available ๐Ÿ“
  • --location-enable-3gpp โ€” turns on location discovery using the 3GPP network ๐Ÿ“ถ
  • --location-disable-3gpp โ€” turns off location discovery using the 3GPP network ๐Ÿ™…โ€โ™€๏ธ
  • --location-enable-agps-msa โ€” turns on A-GPS (MSA) support ๐Ÿ›ฐ๏ธ heads up, this does NOT start the GPS engine by itself. it just says A-GPS should be enabled once the engine starts ๐Ÿ’ญ so you should enable A-GPS before the raw or NMEA outputs with --location-enable-gps-raw or --location-enable-gps-nmea, periodt โœจ
  • --location-disable-agps-msa โ€” turns off A-GPS (MSA) support ๐Ÿ™ƒ
  • --location-enable-agps-msb โ€” turns on A-GPS (MSB) support ๐Ÿ›ฐ๏ธ same deal as MSA: it does NOT implicitly start the GPS engine, it just marks A-GPS as enabled when the engine starts ๐Ÿ’ญ so request A-GPS before the raw or NMEA outputs are enabled with --location-enable-gps-raw or --location-enable-gps-nmea ๐Ÿซถ
  • --location-disable-agps-msb โ€” turns off A-GPS (MSB) support ๐Ÿฅ€
  • --location-enable-gps-nmea โ€” turns on location discovery using GPS, reported with NMEA traces ๐Ÿงพ

this command will start the GPS engine if it isn't already running ๐Ÿ”ฅ

  • --location-disable-gps-nmea โ€” turns off location discovery using GPS and NMEA traces ๐Ÿ›‘

if the raw output isn't enabled at the same time, the GPS engine gets stopped too ๐Ÿ’€

  • --location-enable-gps-raw โ€” turns on location discovery using GPS, reported with raw (i.e. longitude/latitude) values ๐ŸŒ

this command will start the GPS engine if it isn't already running ๐Ÿ”ฅ

  • --location-disable-gps-raw โ€” turns off location discovery using GPS and raw values ๐Ÿ›‘

if the NMEA output isn't enabled at the same time, the GPS engine will be stopped ๐Ÿ’€

  • --location-enable-cdma-bs โ€” turns on location discovery using the 3GPP2 network ๐Ÿ“ก
  • --location-disable-cdma-bs โ€” turns off location discovery using the 3GPP2 network ๐Ÿ™ˆ
  • --location-enable-gps-unmanaged โ€” turns on location discovery using GPS WITHOUT taking control of the NMEA tty port ๐Ÿค this lets other programs, e.g. gpsd, use the NMEA tty once the GPS engine is enabled ๐Ÿงš
  • --location-disable-gps-unmanaged โ€” turns off location discovery using GPS and the unmanaged port ๐ŸŒ™
  • --location-set-gps-refresh-rate=SEC โ€” sets the location refresh rate on the DBus interface to SEC seconds โฑ๏ธ if you set it to 0, the new location gets published on the DBus interface as soon as ModemManager detects it โšก
  • --location-set-supl-server=[IP:PORT] or --location-set-supl-server=[FQDN:PORT] โ€” configures the location of the A-GPS SUPL server ๐Ÿ—บ๏ธ you can give either the IP address (IP:PORT) or a fully qualified domain name ([FQDN:PORT]) ๐ŸŒธ
  • --location-inject-assistance-data=[PATH] โ€” injects assistance data into the GNSS module, loaded from a local file at PATH ๐Ÿ’‰ the data has to be in a format the device expects, e.g. stuff downloaded from the URLs exposed by the 'AssistanceDataServers' property ๐Ÿ“ฆ
  • --location-set-enable-signal โ€” enables reporting location updates through DBus property signals ๐Ÿ“ฃ this is needed if apps rely on listening to 'Location' property updates, instead of asking directly with the policy-protected 'GetLocation' method ๐Ÿ””

these DBus property signal updates are disabled by default, so you have to turn them on yourself ๐Ÿ’…

  • --location-set-disable-signal โ€” disables reporting location updates through DBus property signals ๐Ÿ”•

โœจ MESSAGING OPTIONS โœจ

all messaging options must be used with --modem or -m ๐Ÿ’Œ

  • --messaging-status โ€” shows the status of the messaging support ๐Ÿ“ฌ
  • --messaging-list-sms โ€” lists the SMS messages available on a given modem ๐Ÿ“ฅ
  • --messaging-create-sms=['KEY1=VALUE1,...'] โ€” creates a new SMS on a given modem โœ๏ธ these are the KEYs you can use:
    • 'number' โ€” the number the message is addressed to ๐Ÿ“ฑ
    • 'text' โ€” the message text, in UTF-8 ๐Ÿ’ฌ when sending, if the text is bigger than the limit of the technology or modem, the message gets broken into multiple parts or messages ๐Ÿงฉ heads up: text and data are NEVER given at the same time ๐Ÿ™…โ€โ™€๏ธ
    • 'smsc' โ€” the SMS service center number ๐Ÿข
    • 'validity' โ€” specifies when the SMS expires in the SMSC โŒ›
    • 'class' โ€” the 3GPP message class (0..3) ๐Ÿท๏ธ
    • 'delivery-report-request' โ€” specifies whether a delivery report is requested when sending the SMS ('yes' or 'no') ๐Ÿ“จ
    • 'storage' โ€” specifies where this message is kept ๐Ÿ—„๏ธ storages may be 'sm', 'me', 'mt', 'sr', 'bm', 'ta'
  • --messaging-create-sms-with-data=PATH โ€” uses the file at PATH as the data for a new SMS ๐Ÿ“Ž
  • --messaging-create-sms-with-text=PATH โ€” uses the file at PATH as the message for a new SMS ๐Ÿ“
  • --messaging-delete-sms=[PATH|INDEX] โ€” deletes an SMS from a given modem ๐Ÿ—‘๏ธ

โœจ TIME OPTIONS โœจ

all time operations require --modem or -m โฐ

  • --time โ€” displays the current network time from the operator ๐Ÿ•ฐ๏ธ this includes the timezone, which is usually the important bit ๐ŸŒ

โœจ VOICE OPTIONS โœจ

all voice operations require --modem or -m ๐Ÿ“ž

  • --voice-list-calls โ€” lists the calls managed on a given modem (initiated, received, ongoing) โ˜Ž๏ธ
  • --voice-create-call=['KEY1=VALUE1,...'] โ€” creates a new outgoing call on a given modem ๐Ÿ“ฒ these are the KEYs you can use:
    • 'number' โ€” the number to call ๐Ÿค™
  • --voice-delete-call=[PATH|INDEX] โ€” deletes a call from a given modem ๐Ÿซฃ

โœจ FIRMWARE OPTIONS โœจ

all firmware options require --modem or -m ๐Ÿ› ๏ธ

  • --firmware-status โ€” shows firmware update specific details and properties ๐Ÿ“‹
  • --firmware-list โ€” lists all the firmware images installed on a given modem ๐Ÿ’ฟ
  • --firmware-select=ID โ€” selects a firmware image from the ones installed on a given modem ๐ŸŽฏ you can see the list of available firmware images with the --firmware-list option ๐Ÿ‘€

the ID you give is a UNIQUE identifier for the firmware ๐Ÿ†”


โœจ SIGNAL OPTIONS โœจ

all signal options require --modem or -m ๐Ÿ“ถ

  • --signal-setup=[Rate] โ€” sets up extended signal quality information retrieval at the specified rate (in seconds) โฒ๏ธ

by default this is disabled, meaning the rate is set to 0 ๐Ÿ™ˆ

  • --signal-get โ€” retrieves the last extended signal quality information that got loaded ๐Ÿ“ˆ

โœจ OMA OPTIONS โœจ

all OMA options require --modem or -m ๐ŸŽ€

  • --oma-status โ€” shows the status of the OMA device management subsystem ๐Ÿง‘โ€๐Ÿ’ป
  • --oma-start-client-initiated-session=[SESSION TYPE] โ€” requests to start a client initiated session ๐Ÿšฆ

the session type has to be one of these:

  • 'client-initiated-device-configure'
  • 'client-initiated-prl-update'
  • 'client-initiated-hands-free-activation'
  • --oma-accept-network-initiated-session=[SESSION ID] โ€” requests to accept a network initiated session โœ…
  • --oma-reject-network-initiated-session=[SESSION ID] โ€” requests to reject a network initiated session โŒ
  • --oma-cancel-session โ€” requests to cancel the current OMA session, if there is one ๐Ÿซ 

โœจ SIM OPTIONS โœจ

okay so these are all about your SIM card ๐Ÿ’ณ and yes it's giving security guard energy ๐Ÿ”

  • --pin=PIN โ€” sends your PIN code over to a given SIM card ๐Ÿ”‘
  • --puk=PUK โ€” sends the PUK code to a given SIM card ๐Ÿ†˜ this one has to be used WITH --pin or it won't work ๐Ÿ™ˆ
  • --enable-pin โ€” turns on the PIN request for a given SIM card ๐Ÿ”’ must be used WITH --pin too
  • --disable-pin โ€” turns the PIN request off for a given SIM card ๐Ÿ”“ must be used WITH --pin as well
  • --change-pin=PIN โ€” changes the PIN on a given SIM card so it becomes PIN ๐Ÿ’… this must be used WITH --pin so you can pass in the old PIN number

๐Ÿซง BEARER OPTIONS ๐Ÿซง

bestie, all bearer options need the --bearer or -b option first ๐Ÿ’–

  • -c, --connect โ€” connects to a given bearer ๐Ÿ”Œ
  • -x, --disconnect โ€” disconnects from a given bearer ๐Ÿ‘‹

๐Ÿ’Œ SMS OPTIONS ๐Ÿ’Œ

all SMS options need the --sms or -s option, no cap ๐Ÿซถ

  • --send โ€” sends an SMS ๐Ÿ“จ
  • --store โ€” this one stores the SMS in the default storage the modem uses, which could be either modem-memory or SMS-memory ๐Ÿง  to check what the current default storage is, look at the --messaging-status option
  • --store-in-storage=STORAGE โ€” this picks which STORAGE to use for SMS messages โœจ the possible values are:
    • 'sm' โ€” the SIM card storage area ๐Ÿ’ณ
    • 'me' โ€” the mobile equipment storage area ๐Ÿ“ฑ
    • 'mt' โ€” the sum of SIM and mobile equipment storages ๐Ÿงฎ
    • 'sr' โ€” the status report message storage area ๐Ÿ“Š
    • 'bm' โ€” the broadcast message storage area ๐Ÿ“ข
    • 'ta' โ€” the terminal adaptor message storage area ๐Ÿ”Œ
  • --create-file-with-data=PATH โ€” this takes an SMS that has DATA (not TEXT) and creates a local file at PATH, then saves the content of the SMS in there ๐Ÿ“

๐Ÿ“ž CALL OPTIONS ๐Ÿ“ž

the call options, lowkey the most iconic part of this whole page ๐Ÿฆ‹

  • --start โ€” starts an outgoing call ๐Ÿ“ฒ
  • --accept โ€” accepts an incoming call ๐Ÿฅฐ
  • --hangup โ€” rejects an incoming call, or hangs up an ongoing one ๐Ÿ“ด
  • --send-dtmf=[0-9A-D*#] โ€” sends a DTMF sequence through an ongoing call ๐ŸŽน

๐ŸŒˆ APPLICATION OPTIONS ๐ŸŒˆ

these are the general app vibes that work across everything ๐Ÿงš

  • -J, --output-json โ€” runs the action with machine-friendly JSON output ๐Ÿค– this is perfect for shell scripts that rely on mmcli operations ๐Ÿ“
  • -K, --output-keyvalue โ€” runs the action with machine-friendly key-value output ๐Ÿ”‘ also for shell scripts that rely on mmcli operations ๐Ÿ’œ
  • -v, --verbose โ€” performs actions with more details reported and/or logged ๐Ÿ”
  • -V, --version โ€” returns the version of this program ๐Ÿท๏ธ
  • -a, --async โ€” uses asynchronous methods ๐ŸŒ€ > this is purely a development tool and has no practical benefit to most user operations, so don't stress about it ๐Ÿ’€
  • --timeout=SECONDS โ€” uses SECONDS for the timeout when performing operations with this command โฐ this is super useful for long running operations, like --3gpp-scan ๐Ÿข

๐Ÿ“ก CELL BROADCAST OPTIONS ๐Ÿ“ก

all cell broadcast options must be used with the --modem or -m option ๐Ÿ’…

  • --cell-broadcast-status โ€” shows the status of the cell broadcast support ๐Ÿ“ถ
  • --cell-broadcast-list-cbm โ€” lists the cell broadcast messages available on a given modem ๐Ÿ“‹
  • --cell-broadcast-delete-cbm=[PATH|INDEX] โ€” deletes the cell broadcast message at the given path or index ๐Ÿ—‘๏ธ
  • --cell-broadcast-set-channels=[CHANNELS] โ€” sets the list of channels that cell broadcasts get received on ๐ŸŽ€ for example 5370,5371-5372 โœจ

โœจ EXAMPLES โœจ

๐Ÿ“ฑ Send the PIN to the SIM card

okay so first things first, you need to figure out the proper path/index for the SIM in your modem bestie ๐Ÿซถ grab it with this:

$ mmcli -m 0 -K | grep "modem.generic.sim" | awk -F ": " '{ print $2
}'
/org/freedesktop/ModemManager1/SIM/0

and once you've got that, you can just use the SIM index ๐Ÿ’…

$ sudo mmcli -i 0 --pin=1234
successfully sent PIN code to the SIM

๐Ÿ”Œ Simple connect and disconnect

the simple connection process is giving effortless โœจ

$ sudo mmcli -m 0 --simple-connect="pin=1234,apn=internet"
successfully connected the modem

and when you're done, disconnect like this ๐Ÿฆ‹

$ sudo mmcli -m 0 --simple-disconnect
successfully disconnected all bearers in the modem

๐Ÿ“ก 3GPP network scan

ngl scanning for 3GPP networks can take forever ๐Ÿ˜ญ so you have to give it a specific timeout:

$ sudo mmcli -m 0 --3gpp-scan --timeout=300
  ---------------------
  3GPP scan | networks: 21403 - Orange SP (gprs, unknown)
            |           21407 - Movistar (gprs, unknown)
            |           21404 - YOIGO (gprs, unknown)
            |           21401 - vodafone ES (gprs, unknown)

๐Ÿ’Œ Creating a new SMS message & storing it

using the "sm" (SIM) storage, you can do this ๐ŸŽ€

$ sudo mmcli -m 0 --messaging-create-sms="text='Hello
world',number='+1234567890'"
Successfully created new SMS:
    /org/freedesktop/ModemManager1/SMS/21 (unknown)

$ sudo mmcli -s 21 --store-in-storage="sm"
successfully stored the SMS

$ sudo mmcli -s 21
  -------------------------------
  General    |         dbus path:
/org/freedesktop/ModemManager1/SMS/21
  -------------------------------
  Content    |            number: +1234567890
             |              text: Hello world
  -------------------------------
  Properties |          PDU type: submit
             |             state: stored
             |              smsc: unknown
             |          validity: 0
             |             class: 0
             |           storage: sm
             |   delivery report: not requested
             | message reference: 0

$ sudo mmcli -m 0 --messaging-status
  ----------------------------
  Messaging | supported storages: sm, me
            |    default storage: me

๐Ÿ“ฆ Sending binary SMS messages from files

so the main stars here are --messaging-create-sms-with-data and the PATH you hand it ๐ŸŒˆ

$ sudo mmcli -m 0 \
       --messaging-create-sms="number='+1234567890'" \
       --messaging-create-sms-with-data=/path/to/your/file
Successfully created new SMS:
    /org/freedesktop/ModemManager1/SMS/22 (unknown)

$ sudo mmcli -s 22 --send
successfully sent the SMS

๐Ÿ“ฅ Listing SMS messages

once the receiver has every single part of the message, they can get the file back with another mmcli command on their own ModemManager setup ๐Ÿงš

$> sudo mmcli -m 0 --messaging-list-sms
    /org/freedesktop/ModemManager1/SMS/0 (received)

$> sudo mmcli -s 0 --create-file-with-data=/path/to/the/output/file

๐Ÿ›ฐ๏ธ GPS location status

first things first, check whether the modem even has GPS-specific location capabilities ๐Ÿ‘€ we're assuming the modem is index 0 here, so if you have more than one modem, use --list-modems to find the right index:

$ mmcli -m 0 --location-status
  ----------------------------
  Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
           |      enabled: none
           |      signals: no

so the output says the modem supports 3GPP Location area code/Cell ID, GPS raw and GPS-NMEA location sources โœจ nothing is enabled yet because we haven't enabled the modem, which you can fix with:

$ sudo mmcli -m 0 --enable
successfully enabled the modem

$ mmcli -m 0 --location-status
  ----------------------------
  Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
           |      enabled: 3gpp-lac-ci
           |      signals: no

๐Ÿงญ GPS location technology enabling

you can start the GPS engine by enabling the RAW or NMEA GPS location sources ๐Ÿ”ฅ

$ sudo mmcli -m 0 \
             --location-enable-gps-raw \
             --location-enable-gps-nmea
successfully setup location gathering

and if you check the status again, the GPS-specific locations should now be enabled ๐Ÿ’–

$ mmcli -m 0 --location-status
  --------------------------------
  Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
           |      enabled: 3gpp-lac-ci, gps-raw, gps-nmea
           |      signals: no

๐Ÿ—บ๏ธ GPS location retrieval

you can grab all the location info in one go with a single command ๐Ÿซถ if any of the specific outputs isn't available, that section just gets left out of the output.

$ sudo mmcli -m 0 --location-get
  -------------------------
  3GPP location   | Mobile country code: 214
                  | Mobile network code: 3
                  |  Location area code: 21071
                  |             Cell ID: 7033737
  -------------------------
  GPS NMEA traces | $GPGGA,,,,,,0,,,,,,,,*66
                  | $GPRMC,,V,,,,,,,,,,N*53
                  | $GPGSA,A,1,,,,,,,,,,,,,,,*1E
                  | $GPGSV,4,1,16,24,,,,29,,,,05,,,,18,,,*7A
                  | $GPGSV,4,2,16,22,,,,14,,,,11,,,,17,,,*7B
                  | $GPGSV,4,3,16,03,,,,12,,,,30,,,,13,,,*78
                  | $GPGSV,4,4,16,23,,,,15,,,,27,,,,07,,,*79
                  | $GPVTG,,T,,M,,N,,K,N*2C

๐Ÿ›œ A-GPS support

if A-GPS is enabled before you start the GPS engine, and the modem has a data connection, the configured SUPL servers can be used to get a faster first position fix ๐Ÿš€

heads up though: the GPS engine won't start when only the A-GPS capability is enabled. you need an explicit output (RAW or NMEA) enabled to actually start it ๐Ÿ™ˆ

$ mmcli -m 0 --location-status
  --------------------------------
  Location |      capabilities: 3gpp-lac-ci, gps-raw, gps-nmea,
agps-msa, agps-msb
           |           enabled: 3gpp-lac-ci
           |           signals: no
  -----------------------------
  GPS      |      refresh rate: 30 seconds
           | a-gps supl server: supl.google.com:7276

$ sudo mmcli -m 0 --location-enable-agps-msa
successfully setup location gathering

$ sudo mmcli -m 0 --location-enable-gps-nmea
successfully setup location gathering

$ sudo mmcli -m 0 --location-enable-gps-raw
successfully setup location gathering

๐Ÿ“ถ Injecting assistance data

okay this one is lowkey clever ๐Ÿง  if the modem has no ongoing connection (like no mobile network coverage) but your system can reach the Internet some other way (like WiFi), you may be able to download location assistance data and inject it into the modem yourself.

for example, if the device supports XTRA assistance data, you can download it from one of the servers ModemManager lists and inject it manually afterwards. the XTRA assistance data is usually valid for several days โญ

$ mmcli -m 0 --location-status
  --------------------------------
  Location |         capabilities: 3gpp-lac-ci, gps-raw, gps-nmea,
agps-msa, agps-msb
           |              enabled: 3gpp-lac-ci
           |              signals: no
  --------------------------------
  GPS      |         refresh rate: 30 seconds
           |    a-gps supl server: supl.google.com:7276
           | supported assistance: xtra
           |   assistance servers:
https://xtrapath3.izatcloud.net/xtra3grcej.bin
           |
https://xtrapath1.izatcloud.net/xtra3grcej.bin
           |
https://xtrapath2.izatcloud.net/xtra3grcej.bin

$ wget -q https://xtrapath3.izatcloud.net/xtra3grcej.bin

$ sudo mmcli -m 0 --location-inject-assistance-data=./xtra3grcej.bin
successfully injected assistance data

$ sudo mmcli -m 0 --location-enable-gps-nmea
successfully setup location gathering

$ sudo mmcli -m 0 --location-enable-gps-raw
successfully setup location gathering

๐Ÿ“ป Setting the Cell Broadcast channel list

the channel list can be a comma separated list of channels or channel intervals ๐ŸŽถ

$ sudo mmcli -m 0 \
             --cell-broadcast-set-channels=5370,5371,5373-5000
successfully set channels in the modem

๐Ÿงพ Key-Value output

if you're writing shell scripts that poke the modem with mmcli, --output-keyvalue is your best friend ๐Ÿ’œ you can grab all the main status info in one call and then parse out the fields you want, like so:

$ STATUS=$(mmcli -m 0 --output-keyvalue)
$ echo "${STATUS}" | grep "modem.generic.state " | awk -F ": " '{
print $2 }'
failed
$ echo "${STATUS}" | grep "modem.generic.state-failed-reason " | awk
-F ": " '{ print $2 }'
sim-missing

โœจ AUTHORS โœจ

written by Martyn Russell <martyn@lanedo.com> and Aleksander Morgado <aleksander@aleksander.es> ๐ŸŒธ


๐Ÿ”— SEE ALSO ๐Ÿ”—

ModemManager(8), NetworkManager(8) ๐Ÿ’–

AT (http://en.wikipedia.org/wiki/AT_commands) ๐Ÿ“–

3GPP (http://en.wikipedia.org/wiki/3GPP) ๐Ÿ“–

MCCMNC (http://en.wikipedia.org/wiki/Mobile_Network_Code) ๐Ÿ“–

USSD (http://en.wikipedia.org/wiki/Unstructured_Supplementary_Service_Data) ๐Ÿ“–

CDMA (http://en.wikipedia.org/wiki/Code_division_multiple_access) ๐Ÿ“–

OTA (http://en.wikipedia.org/wiki/Over-the-air_programming) ๐Ÿ“–

GPS (http://en.wikipedia.org/wiki/Global_Positioning_System) ๐Ÿ“–

NMEA (http://en.wikipedia.org/wiki/NMEA_0183) ๐Ÿ“–


bestie that's the whole page ๐Ÿ˜ญ๐ŸŽ€ you're officially a mmcli main character now ๐Ÿ‘‘ this one's from GNU, October 2012, and it's the mmcli(1) page ๐ŸŒˆ๐Ÿ’