1
2mmcli(1) User Commands mmcli(1)
3
4
5
7 mmcli - Control and monitor the ModemManager
8
9
11 mmcli [OPTION...]
12
13
15 ModemManager is a DBus-powered Linux daemon which provides a unified
16 high level API for communicating with (mobile broadband) modems. It
17 acts as a standard RIL (Radio Interface Layer) and may be used by dif‐
18 ferent connection managers, like NetworkManager. Thanks to the built-in
19 plugin architecture, ModemManager talks to very different kinds of
20 modems with very different kinds of ports. In addition to the standard
21 AT serial ports, Qualcomm-based QCDM and QMI ports are also supported.
22
23
25 -h, --help
26 Show summary of options by group.
27
28 --help-all
29 Show all groups and options.
30
31 --help-manager
32 Show manager specific options.
33
34 --help-common
35 Show common options. These are used for defining the device an
36 option operates on. For example, modems, bearers, SIMs, SMS',
37 etc.
38
39 --help-modem
40 Show modem specific options.
41
42 --help-3gpp
43 Show 3GPP specific options.
44
45 --help-cdma
46 Show CDMA specific options.
47
48 --help-simple
49 Show simple options. These are useful for getting connected or
50 disconnected and understanding the state of things as fast as
51 possible without worrying so much about the details.
52
53 --help-location
54 Show location or positioning specific options.
55
56 --help-messaging
57 Show messaging specific options. See also --help-sms which is
58 related.
59
60 --help-time
61 Show time specific options.
62
63 --help-firmware
64 Show firmware specific options.
65
66 --help-oma
67 Show OMA specific options.
68
69 --help-sim
70 Show SIM card specific options.
71
72 --help-bearer
73 Show bearer specific options.
74
75 --help-sms
76 Show SMS specific options. See also --help-messaging which is
77 related.
78
79
81 -B, --get-daemon-version
82 Retrieve the version of the currently running ModemManager dae‐
83 mon.
84
85 -G, --set-logging=[ERR|WARN|INFO|DEBUG]
86 Set the logging level in ModemManager daemon. For debugging
87 information you can supply DEBUG. Each value above DEBUG pro‐
88 vides less detail. In most cases ERR (for displaying errors) are
89 the important messages.
90
91 The default mode is ERR.
92
93 -L, --list-modems
94 List available modems.
95
96 -M, --monitor-modems
97 List available modems and monitor modems added or removed.
98
99 -S, --scan-modems
100 Scan for any potential new modems. This is only useful when
101 expecting pure RS232 modems, as they are not notified automati‐
102 cally by the kernel.
103
104 -I, --inhibit-device=[UID]
105 Inhibit the specific device from being used by ModemManager. The
106 UID that should be given is the value of the Device property
107 exposed by a given modem (i.e. equal to the ID_MM_PHYSDEV_UID if
108 one set, or otherwise equal to the full device sysfs path).
109
110 This command will not exit right away, as that would implicitly
111 remove the inhibition. The user must make sure to stop the mmcli
112 process hitting Ctrl+C in order to un-inhibit the device.
113
114 When a device is inhibited via this method, ModemManager will
115 disable the modem (therefore stopping any ongoing connection)
116 and will no longer use it until it is uninhibited.
117
118 --report-kernel-event=['KEY1=VALUE1,KEY2=VALUE2,...']
119 Manually report kernel events, instead of relying on udev (e.g.
120 if the daemon is running with --no-auto-scan or if the system
121 was built without udev support).
122
123 The supported KEYs are:
124
125 'action'
126 Action to report, one of 'add' or 'remove'. Required.
127
128 'subsystem'
129 Subsystem of the specific port being reported, e.g.
130 'tty' (for serial ports),
131
132 'name' Name of the port being reported, e.g. 'ttyACM0',
133 'wwan0' or 'cdc-wdm0'.
134
135 'uid' The specific UID of the device, equivalent to the
136 ID_MM_PHYSDEV_UID udev tag. All ports reported with the
137 same 'UID' value will be considered part of the same
138 device, which may be useful for e.g. modems with multi‐
139 ple platform TTYs.
140
141
142 --report-kernel-event-auto-scan
143 When built with udev support but the daemon is running with
144 --no-auto-scan, this method may be used to automatically report
145 kernel events based on udev.
146
147 This command will not exit right away. The user must make sure
148 to stop the mmcli process hitting Ctrl+C in order to stopping
149 monitoring for new events.
150
151
153 All options below take a PATH or INDEX argument. If no action is pro‐
154 vided, the default information about the modem, bearer, etc. is shown
155 instead.
156
157 The PATH and INDEX are created automatically when the modem is plugged
158 in. They can be found using mmcli -L. This produces something like (for
159 modems only):
160
161 Found 1 modems:
162 /org/freedesktop/ModemManager1/Modem/4
163
164 In this case, the INDEX is 4 and the PATH is the entire string above.
165
166 However, for the bearers, SIMs and SMS cases, the PATH is slightly dif‐
167 ferent. The Modem is replaced with the object name in use, like Bearer.
168 For example:
169
170 /org/freedesktop/ModemManager1/Bearer/4
171
172
173 -m, --modem=[PATH|INDEX]
174 Specify a modem.
175
176 -b, --bearer=[PATH|INDEX]
177 Specify a bearer.
178
179 -i, --sim=[PATH|INDEX]
180 Specify a SIM card.
181
182 -s, --sms=[PATH|INDEX]
183 Specify an SMS.
184
185
187 All of the modem options below make use of the --modem or -m switch to
188 specify the modem to act on.
189
190 Some operations require a MODE. MODE can be any combination of the
191 modes actually supported by the modem. In the perfect case, the follow‐
192 ing are possible:
193
194 '2G' - 2G technologies, e.g. EDGE, CDMA1x
195 '3G' - 3G technologies, e.g. HSPA, EV-DO
196 '4G' - 4G technologies, e.g. LTE
197 'ANY' - for all supported modes.
198
199 -w, --monitor-state
200 Monitor the state of a given modem.
201
202 -e, --enable
203 Enable a given modem.
204
205 This powers the antenna, starts the automatic registration
206 process and in general prepares the modem to be connected.
207
208 -d, --disable
209 Disable a given modem.
210
211 This disconnects the existing connection(s) for the modem and
212 puts it into a low power mode.
213
214 -r, --reset
215 Resets the modem to the settings it had when it was power
216 cycled.
217
218 --factory-reset=CODE
219 Resets the modem to its original factory default settings.
220
221 The CODE provided is vendor specific. Without the correct vendor
222 code, it's unlikely this operation will succeed. This is not a
223 common user action.
224
225 --command=COMMAND
226 Send an AT COMMAND to the given modem. For example, COMMAND
227 could be 'AT+GMM' to probe for phone model information. This
228 operation is only available when ModemManager is run in debug
229 mode.
230
231 --list-bearers
232 List packet data bearers that are available for the given modem.
233
234 --create-bearer=['KEY1=VALUE1,KEY2=VALUE2,...']
235 Create a new packet data bearer for a given modem. The KEYs and
236 some VALUEs are listed below:
237
238 'apn' Access Point Name. Required in 3GPP.
239
240 'ip-type'
241 Addressing type. Given as a MMBearerIpFamily value
242 (e.g. 'ipv4', 'ipv6', 'ipv4v6'). Optional in 3GPP and
243 CDMA.
244
245 'allowed-auth'
246 Authentication method to use. Given as a MMBearerAl‐
247 lowedAuth value (e.g.
248 'none|pap|chap|mschap|mschapv2|eap'). Optional in 3GPP.
249
250 'user' User name (if any) required by the network. Optional in
251 3GPP.
252
253 'password'
254 Password (if any) required by the network. Optional in
255 3GPP.
256
257 'allow-roaming'
258 Flag to tell whether connection is allowed during roam‐
259 ing, given as a boolean value (i.e 'yes' or 'no').
260 Optional in 3GPP.
261
262 'rm-protocol'
263 Protocol of the Rm interface, given as a MMModemCdmaRm‐
264 Protocol value (e.g. 'async', 'packet-relay', 'packet-
265 network-ppp', 'packet-network-slip', 'stu-iii').
266 Optional in CDMA.
267
268 'number'
269 Telephone number to dial. Required in POTS.
270
271 --delete-bearer=[PATH|INDEX]
272 Delete bearer from a given modem.
273
274 --set-allowed-modes=[MODE1|MODE2|...]
275 Set allowed modes for a given modem. For possible modes, see the
276 beginning of this section.
277
278 --set-preferred-mode=MODE
279 Set the preferred MODE for the given modem. The MODE MUST be one
280 of the allowed modes as set with the --set-allowed-modes option.
281 Possible MODE arguments are detailed at the beginning of this
282 section.
283
284 --set-current-bands=[BAND1|BAND2|...]
285 Set bands to be used for a given modem. These are frequency
286 ranges the modem should use. There are quite a number of sup‐
287 ported bands and listing them all here would be quite extensive.
288 For details, see the MMModemBand documentation.
289
290 An example would be: 'egsm|dcs|pcs|g850' to select all the GSM
291 frequency bands.
292
293 --inhibit
294 Inhibit the specific modem from being used by ModemManager. This
295 method is completely equivalent to --inhibit-device, with the
296 only difference being that in this case, the modem must be man‐
297 aged by the daemon at the time the inhibition is requested.
298
299 This command will not exit right away, as that would implicitly
300 remove the inhibition. The user must make sure to stop the mmcli
301 process hitting Ctrl+C in order to un-inhibit the device.
302
303 When a device is inhibited via this method, ModemManager will
304 disable the modem (therefore stopping any ongoing connection)
305 and will no longer use it until it is uninhibited.
306
307
309 The 3rd Generation Partnership Project (3GPP) is a collaboration
310 between groups of telecommunications associations. These options per‐
311 tain to devices which support 3GPP.
312
313 Included are options to control USSD (Unstructured Supplementary Ser‐
314 vice Data) sessions.
315
316 All of the 3GPP options below make use of the --modem or -m switch to
317 specify the modem to act on.
318
319 --3gpp-scan
320 Scan for available 3GPP networks.
321
322 --3gpp-register-home
323 Request a given modem to register in its home network.
324
325 This registers with the default network(s) specified by the
326 modem,
327
328 --3gpp-register-in-operator=MCCMNC
329 Request a given modem to register on the network of the given
330 MCCMNC (Mobile Country Code, Mobile Network Code) based opera‐
331 tor. This code is used for GSM/LTE, CDMA, iDEN, TETRA and UMTS
332 public land mobile networks and some satellite mobile networks.
333 The ITU-T Recommendation E.212 defines mobile country codes.
334
335 --3gpp-ussd-status
336 Request the status of ANY ongoing USSD session.
337
338 --3gpp-ussd-initiate=COMMAND
339 Request the given modem to initiate a USSD session with COMMAND.
340
341 For example, COMMAND could be '*101#' to give your current pre-
342 pay balance.
343
344 --3gpp-ussd-respond=RESPONSE
345 When initiating an USSD session, a RESPONSE may be needed by a
346 network-originated request. This option allows for that.
347
348 --3gpp-ussd-cancel
349 Cancel an ongoing USSD session for a given modem.
350
351
353 All CDMA (Code Division Multiple Access) options require the --modem or
354 -m option.
355
356
357 --cdma-activate=CARRIER
358 Activate the given modem using OTA (Over the Air) settings. The
359 CARRIER is a code provided by the network for the default set‐
360 tings they provide.
361
362
364 All simple options must be used with --modem or -m.
365
366
367 --simple-connect=['KEY1=VALUE1,KEY2=VALUE2,...']
368 Run a full connection sequence using KEY / VALUE pairs. You can
369 use the --create-bearer options, plus any of the following ones:
370
371 'pin' SIM-PIN unlock code.
372
373 'operator-id'
374 ETSI MCC-MNC of a network to force registration.
375
376 --simple-disconnect
377 Disconnect ALL connected bearers for a given modem.
378
379
381 These options detail how to discover your location using Global Posi‐
382 tioning System (GPS) or directly from your mobile network infrastruc‐
383 ture (either 3GPP or 3GPP2).
384
385 All location options must be used with --modem or -m.
386
387
388 --location-status
389 Show the current status for discovering our location.
390
391 --location-get
392 Show all location information available.
393
394 --location-enable-3gpp
395 Enable location discovery using the 3GPP network.
396
397 --location-disable-3gpp
398 Disable location discovery using the 3GPP network.
399
400 --location-enable-agps-msa
401 Enable A-GPS (MSA) support. This command does not implicitly
402 start the GPS engine, it just specifies that A-GPS should be
403 enabled when the engine is started. Therefore, the user should
404 request enabling A-GPS before the raw or NMEA outputs are
405 enabled with --location-enable-gps-raw or --loca‐
406 tion-enable-gps-nmea.
407
408 --location-disable-agps-msa
409 Disable A-GPS (MSA) support.
410
411 --location-enable-agps-msb
412 Enable A-GPS (MSB) support. This command does not implicitly
413 start the GPS engine, it just specifies that A-GPS should be
414 enabled when the engine is started. Therefore, the user should
415 request enabling A-GPS before the raw or NMEA outputs are
416 enabled with --location-enable-gps-raw or --loca‐
417 tion-enable-gps-nmea.
418
419 --location-disable-agps-msb
420 Disable A-GPS (MSB) support.
421
422 --location-enable-gps-nmea
423 Enable location discovery using GPS and reported with NMEA
424 traces.
425
426 This command will start the GPS engine, if it isn't started
427 already.
428
429 --location-disable-gps-nmea
430 Disable location discovery using GPS and NMEA traces.
431
432 If the raw output is not enabled at the same time, the GPS
433 engine will be stopped.
434
435 --location-enable-gps-raw
436 Enable location discovery using GPS and reported with raw (i.e.
437 longitude/latitude) values.
438
439 This command will start the GPS engine, if it isn't started
440 already.
441
442 --location-disable-gps-raw
443 Disable location discovery using GPS and raw values.
444
445 If the NMEA output is not enabled at the same time, the GPS
446 engine will be stopped.
447
448 --location-enable-cdma-bs
449 Enable location discovery using the 3GPP2 network.
450
451 --location-disable-cdma-bs
452 Disable location discovery using the 3GPP2 network.
453
454 --location-enable-gps-unmanaged
455 Enable location discovery using GPS but without taking control
456 of the NMEA tty port. This allows other programs, e.g. gpsd, to
457 use the NMEA tty once the GPS engine has been enabled.
458
459 --location-disable-gps-unmanaged
460 Disable location discovery using GPS and unmanaged port.
461
462 --location-set-gps-refresh-rate=SEC
463 Set the location refresh rate on the DBus interface to SEC sec‐
464 onds. If set to 0, the new location is published on the DBus
465 interface as soon as ModemManager detects it.
466
467 --location-set-supl-server=[IP:PORT] or --loca‐
468 tion-set-supl-server=[FQDN:PORT]
469 Configure the location of the A-GPS SUPL server, either specify‐
470 ing the IP address (IP:PORT) or specifyng a fully qualified
471 domain name ([FQDN:PORT]).
472
473 --location-inject-assistance-data=[PATH]
474 Inject assistance data into the GNSS module, loaded from a local
475 file at PATH. The assistance data should be in a format expected
476 by the device, e.g. downloaded from the URLs exposed by the
477 'AssistanceDataServers' property.
478
479 --location-set-enable-signal
480 Enable reporting location updates via DBus property signals.
481 This is required if applications rely on listening to 'Location'
482 property updates, instead of explicit queries with the policy-
483 protected 'GetLocation' method.
484
485 This DBus property signal updates are by default disabled.
486
487 --location-set-disable-signal
488 Disable reporting location updates via DBus property signals.
489
490
492 All messaging options must be used with --modem or -m.
493
494
495 --messaging-status
496 Show the status of the messaging support.
497
498 --messaging-list-sms
499 List SMS messages available on a given modem.
500
501 --messaging-create-sms=['KEY1=VALUE1,...']
502 Create a new SMS on a given modem. KEYs can be any of the fol‐
503 lowing:
504
505 'number'
506 Number to which the message is addressed.
507
508 'text' Message text, in UTF-8. When sending, if the text is
509 larger than the limit of the technology or modem, the
510 message will be broken into multiple parts or messages.
511 Note that text and data are never given at the same
512 time.
513
514 'smsc' Indicates the SMS service center number.
515
516 'validity'
517 Specifies when the SMS expires in the SMSC.
518
519 'class'
520 3GPP message class (0..3).
521
522 'delivery-report-request'
523 Specifies whether delivery report is requested when
524 sending the SMS ('yes' or 'no')
525
526 'storage'
527 Specifies the storage where this message is kept. Stor‐
528 ages may be 'sm', 'me', 'mt', 'sr', 'bm', 'ta'.
529
530 --messaging-create-sms-with-data=PATH
531 Use PATH to a filename as the data to create a new SMS.
532
533 --messaging-delete-sms=[PATH|INDEX]
534 Delete an SMS from a given modem.
535
536
538 All time operations require the --modem or -m option.
539
540
541 --time Display the current network time from the operator. This
542 includes the timezone which is usually of importance.
543
544
546 All voice operations require the --modem or -m option.
547
548
549 --voice-list-calls
550 List calls managed (initiated, received, ongoing) on a given
551 modem.
552
553 --voice-create-call=['KEY1=VALUE1,...']
554 Create a new outgoing call on a given modem. KEYs can be any of
555 the following:
556
557 'number'
558 Number to call.
559
560 --voice-delete-call=[PATH|INDEX]
561 Delete a call from a given modem.
562
563
565 All firmware options require the --modem or -m option.
566
567
568 --firmware-status
569 Show firmware update specific details and properties.
570
571 --firmware-list
572 List all the firmware images installed on a given modem.
573
574 --firmware-select=ID
575 Select a firmware image from those installed on a given modem. A
576 list of available firmware images can be seen using the
577 --firmware-list option.
578
579 The ID provided is a UNIQUE identifier for the firmware.
580
581
583 All signal options require the --modem or -m option.
584
585
586 --signal-setup=[Rate]
587 Setup extended signal quality information retrieval at the spec‐
588 ified rate (in seconds).
589
590 By default this is disabled (rate set to 0).
591
592 --signal-get
593 Retrieve the last extended signal quality information loaded.
594
595
597 All OMA options require the --modem or -m option.
598
599
600 --oma-status
601 Show the status of the OMA device management subsystem.
602
603 --oma-start-client-initiated-session=[SESSION TYPE]
604 Request to start a client initiated session.
605
606 The given session type must be one of:
607 'client-initiated-device-configure'
608 'client-initiated-prl-update'
609 'client-initiated-hands-free-activation'
610
611 --oma-accept-network-initiated-session=[SESSION ID]
612 Request to accept a network initiated session.
613
614 --oma-reject-network-initiated-session=[SESSION ID]
615 Request to reject a network initiated session.
616
617 --oma-cancel-session
618 Request to cancel current OMA session, if any.
619
620
622 --pin=PIN
623 Send PIN code to a given SIM card.
624
625 --puk=PUK
626 Send PUK code to a given SIM card. This must be used WITH --pin.
627
628 --enable-pin
629 Enable PIN request for a given SIM card. This must be used WITH
630 --pin.
631
632 --disable-pin
633 Disable PIN request for a given SIM card. This must be used WITH
634 --pin.
635
636 --change-pin=PIN
637 Change the PIN for a given SIM card. It will be set to PIN. This
638 must be used WITH --pin to supply the old PIN number.
639
640
642 All bearer options require the --bearer or -b option.
643
644
645 -c, --connect
646 Connect to a given bearer.
647
648 -x, --disconnect
649 Disconnect from a given bearer.
650
651
653 All SMS options require the --sms or -s option.
654
655
656 --send Send an SMS.
657
658 --store
659 This option will store the SMS in the default storage defined by
660 the modem, which may be either modem-memory or SMS-memory. To
661 know what the existing default storage is, see the --messag‐
662 ing-status option.
663
664
665 --store-in-storage=STORAGE
666 This option states which STORAGE to use for SMS messages. Pos‐
667 sible values for STORAGE include:
668
669 'sm' SIM card storage area.
670
671 'me' Mobile equipment storage area.
672
673 'mt' Sum of SIM and Mobile equipment storages
674
675 'sr' Status report message storage area.
676
677 'bm' Broadcast message storage area.
678
679 'ta' Terminal adaptor message storage area.
680
681 --create-file-with-data=PATH
682 This option takes an SMS that has DATA (not TEXT) and will cre‐
683 ate a local file described by PATH and store the content of the
684 SMS there.
685
686
688 --start
689 Initiate an outgoing call.
690
691 --accept
692 Accept an incoming call.
693
694 --hangup
695 Reject an incoming call or hangup an ongoing one.
696
697 --send-dtmf=[0-9A-D*#]
698 Send a DTMF sequence through an ongoing call.
699
700
702 -K, --output-keyvalue
703 Run action with machine-friendly key-value output, to be used
704 e.g. by shell scripts that rely on mmcli operations.
705
706 -v, --verbose
707 Perform actions with more details reported and/or logged.
708
709 -V, --version
710 Returns the version of this program.
711
712 -a, --async
713 Use asynchronous methods. This is purely a development tool and
714 has no practical benefit to most user operations.
715
716 --timeout=SECONDS
717 Use SECONDS for the timeout when performing operations with this
718 command. This option is useful when executing long running oper‐
719 ations, like --3gpp-scan.
720
721
723 Send the PIN to the SIM card
724 You'll need first to know which the proper path/index is for the SIM in
725 your modem:
726 $ mmcli -m 0 -K | grep "modem.generic.sim" | awk -F ": " '{ print
727 $2 }'
728 /org/freedesktop/ModemManager1/SIM/0
729
730 And after that, you can just use the SIM index:
731 $ sudo mmcli -i 0 --pin=1234
732 successfully sent PIN code to the SIM
733
734
735 Simple connect and disconnect
736 You can launch the simple connection process like:
737 $ sudo mmcli -m 0 --simple-connect="pin=1234,apn=internet"
738 successfully connected the modem
739
740 Then, you can disconnect it like:
741 $ sudo mmcli -m 0 --simple-disconnect
742 successfully disconnected all bearers in the modem
743
744
745 3GPP network scan
746 Scanning for 3GPP networks may really take a long time, so a specific
747 timeout must be given:
748 $ sudo mmcli -m 0 --3gpp-scan --timeout=300
749 ---------------------
750 3GPP scan | networks: 21403 - Orange SP (gprs, unknown)
751 | 21407 - Movistar (gprs, unknown)
752 | 21404 - YOIGO (gprs, unknown)
753 | 21401 - vodafone ES (gprs, unknown)
754
755
756 Creating a new SMS message & storing it
757 Using the “sm” (SIM), you can do this using:
758
759 $ sudo mmcli -m 0 --messaging-create-sms="text='Hello world',num‐
760 ber='+1234567890'"
761 Successfully created new SMS:
762 /org/freedesktop/ModemManager1/SMS/21 (unknown)
763
764 $ sudo mmcli -s 21 --store-in-storage="sm"
765 successfully stored the SMS
766
767 $ sudo mmcli -s 21
768 -------------------------------
769 General | dbus path: /org/freedesktop/ModemMan‐
770 ager1/SMS/21
771 -------------------------------
772 Content | number: +1234567890
773 | text: Hello world
774 -------------------------------
775 Properties | PDU type: submit
776 | state: stored
777 | smsc: unknown
778 | validity: 0
779 | class: 0
780 | storage: sm
781 | delivery report: not requested
782 | message reference: 0
783
784 $ sudo mmcli -m 0 --messaging-status
785 ----------------------------
786 Messaging | supported storages: sm, me
787 | default storage: me
788
789
790 Sending binary SMS messages from files
791 As you can see below, the important part is the --messaging-cre‐
792 ate-sms-with-data and the PATH provided.
793
794 $ sudo mmcli -m 0 \
795 --messaging-create-sms="number='+1234567890'" \
796 --messaging-create-sms-with-data=/path/to/your/file
797 Successfully created new SMS:
798 /org/freedesktop/ModemManager1/SMS/22 (unknown)
799
800 $ sudo mmcli -s 22 --send
801 successfully sent the SMS
802
803
804 Listing SMS messages
805 When the receiver gets all the parts of the message, they can now
806 recover the sent file with another mmcli command in their ModemManager
807 setup:
808
809 $> sudo mmcli -m 0 --messaging-list-sms
810 /org/freedesktop/ModemManager1/SMS/0 (received)
811
812 $> sudo mmcli -s 0 --create-file-with-data=/path/to/the/output/file
813
814
815 GPS location status
816 You first need to check whether the modem has GPS-specific location
817 capabilities. Note that we’ll assume the modem is exposed as index 0;
818 if you have more than one modem, just use --list-modems to check the
819 proper modem index:
820
821 $ mmcli -m 0 --location-status
822 ----------------------------
823 Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
824 | enabled: none
825 | signals: no
826
827 The output says that the modem supports 3GPP Location area code/Cell
828 ID, GPS raw and GPS-NMEA location sources. None is enabled yet, as we
829 didn’t enable the modem, which we can do issuing:
830
831 $ sudo mmcli -m 0 --enable
832 successfully enabled the modem
833
834 $ mmcli -m 0 --location-status
835 ----------------------------
836 Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
837 | enabled: 3gpp-lac-ci
838 | signals: no
839
840
841 GPS location technology enabling
842 We can start the GPS engine by enabling the RAW or NMEA GPS location
843 sources:
844
845 $ sudo mmcli -m 0 \
846 --location-enable-gps-raw \
847 --location-enable-gps-nmea
848 successfully setup location gathering
849
850 If we do check again the status, we’ll see the GPS-specific locations
851 are enabled:
852
853 $ mmcli -m 0 --location-status
854 --------------------------------
855 Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
856 | enabled: 3gpp-lac-ci, gps-raw, gps-nmea
857 | signals: no
858
859
860 GPS location retrieval
861 You can query all location information at the same time with a single
862 command. If any of the specific outputs is not available, the corre‐
863 sponding section will be omitted from the output.
864
865 $ sudo mmcli -m 0 --location-get
866 -------------------------
867 3GPP location | Mobile country code: 214
868 | Mobile network code: 3
869 | Location area code: 21071
870 | Cell ID: 7033737
871 -------------------------
872 GPS NMEA traces | $GPGGA,,,,,,0,,,,,,,,*66
873 | $GPRMC,,V,,,,,,,,,,N*53
874 | $GPGSA,A,1,,,,,,,,,,,,,,,*1E
875 | $GPGSV,4,1,16,24,,,,29,,,,05,,,,18,,,*7A
876 | $GPGSV,4,2,16,22,,,,14,,,,11,,,,17,,,*7B
877 | $GPGSV,4,3,16,03,,,,12,,,,30,,,,13,,,*78
878 | $GPGSV,4,4,16,23,,,,15,,,,27,,,,07,,,*79
879 | $GPVTG,,T,,M,,N,,K,N*2C
880
881
882 A-GPS support
883 If A-GPS is enabled before starting the GPS engine, and if a data con‐
884 nection is available in the modem, the configured SUPL servers may be
885 used to obtain a faster initial position fix.
886
887 Note that the GPS engine will not be started when just A-GPS capability
888 is enabled. An explicit output (RAW or NMEA) is required to be enabled
889 in order to start the GPS engine.
890
891 $ mmcli -m 0 --location-status
892 --------------------------------
893 Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea,
894 agps-msa, agps-msb
895 | enabled: 3gpp-lac-ci
896 | signals: no
897 -----------------------------
898 GPS | refresh rate: 30 seconds
899 | a-gps supl server: supl.google.com:7276
900
901 $ sudo mmcli -m 0 --location-enable-agps-msa
902 successfully setup location gathering
903
904 $ sudo mmcli -m 0 --location-enable-gps-nmea
905 successfully setup location gathering
906
907 $ sudo mmcli -m 0 --location-enable-gps-raw
908 successfully setup location gathering
909
910
911 Injecting assistance data
912 If the modem device does not have an ongoing connection (e.g. no mobile
913 network coverage) but the system has other means to access the Internet
914 (e.g. WiFi), the user may be able to download location assistance data
915 and inject it in the module.
916
917 E.g. If the device supports XTRA assistance data, the user may download
918 it from one of the servers listed by ModemManager and manually inject
919 it afterwards. The XTRA assistance data is usually valid for several
920 days.
921
922 $ mmcli -m 0 --location-status
923 --------------------------------
924 Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea,
925 agps-msa, agps-msb
926 | enabled: 3gpp-lac-ci
927 | signals: no
928 --------------------------------
929 GPS | refresh rate: 30 seconds
930 | a-gps supl server: supl.google.com:7276
931 | supported assistance: xtra
932 | assistance servers: https://xtrapath3.izat‐
933 cloud.net/xtra3grcej.bin
934 | https://xtrapath1.izat‐
935 cloud.net/xtra3grcej.bin
936 | https://xtrapath2.izat‐
937 cloud.net/xtra3grcej.bin
938
939 $ wget -q https://xtrapath3.izatcloud.net/xtra3grcej.bin
940
941 $ sudo mmcli -m 0 --location-inject-assistance-
942 data=./xtra3grcej.bin
943 successfully injected assistance data
944
945 $ sudo mmcli -m 0 --location-enable-gps-nmea
946 successfully setup location gathering
947
948 $ sudo mmcli -m 0 --location-enable-gps-raw
949 successfully setup location gathering
950
951
952 Key-Value output
953 Writing shell scripts that use mmcli to perform operations with the
954 modem is easy when using the --output-keyvalue option. For example, you
955 could gather all the main status information of the modem with a single
956 call and then parse it to read single fields:
957
958 $ STATUS=$(mmcli -m 0 --output-keyvalue)
959 $ echo "${STATUS}" | grep "modem.generic.state " | awk -F ": " '{
960 print $2 }'
961 failed
962 $ echo "${STATUS}" | grep "modem.generic.state-failed-reason " |
963 awk -F ": " '{ print $2 }'
964 sim-missing
965
966
968 Written by Martyn Russell <martyn@lanedo.com> and Aleksander Morgado
969 <aleksander@aleksander.es>
970
971
973 ModemManager(8), NetworkManager(8)
974
975 AT (http://en.wikipedia.org/wiki/AT_commands).
976
977 3GPP (http://en.wikipedia.org/wiki/3GPP).
978
979 MCCMNC (http://en.wikipedia.org/wiki/Mobile_Network_Code).
980
981 USSD (http://en.wikipedia.org/wiki/Unstructured_Supplementary_Ser‐
982 vice_Data).
983
984 CDMA (http://en.wikipedia.org/wiki/Code_division_multiple_access).
985
986 OTA (http://en.wikipedia.org/wiki/Over-the-air_programming).
987
988 GPS (http://en.wikipedia.org/wiki/Global_Positioning_System)
989
990 NMEA (http://en.wikipedia.org/wiki/NMEA_0183)
991
992
993
994GNU October 2012 mmcli(1)