Today I was thinking that it would be great if the L5 could use dial codes like *#*#INFO#*#*
to retrieve mobile network and modem info, just like Android phones. (It can’t at the moment.)
I had learned from skilled users here in the forum about the mmcli
command. So I ran “mmcli -L” to get the identifier associated with my modem (“0”), then ran mmcli --modem=0
for a status report, which is somewhat similar to the output from the Android code. (Enter mmcli -h
in the L5’s terminal to see all the other options.)
Then I recalled how @spaetz had created an automated quick-dial application a while back, and I wondered if I could use it as a guide to make a shortcut to the modem status information.
So I found a suitable icon from the GNOME Characters app and saved it as “satellite.png” in .local/share/icons
:
Then I created the quick-dial/shortcut button in .local/share/applications
, naming it ModemInfo.desktop
.
Next I copied Spaetz’s content into ModemInfo.desktop
and started adapting it and experimenting, attempting to make it open the terminal and execute mmcli --modem=0
automatically. After a little bit of research and some trial and error, I arrived at this:
[Desktop Entry]
Name=ModemInfo
Exec=gnome-terminal -x bash -c “mmcli --modem=0 | tee modeminfo.txt; exec bash”
StartupNotify=true
Terminal=false
Type=Application
Categories=Utilities;
Icon=/home/purism/.local/share/icons/satellite.png
…And it works!
Tapping my ModemInfo
icon from the app grid opens the terminal, runs the command, displays the output in the terminal, and also saves it as modeminfo.txt in the home folder for easy viewing (landscape view works best…or view on a larger screen). The saved file will be written over every time with the command as written, but you can use different parameters if you don’t want to overwrite.
The modeminfo.txt output (redacted with “xxxxxx”):
----------------------------------
General | path: /org/freedesktop/ModemManager1/Modem/0
| device id: xxxxxxx
----------------------------------
Hardware | manufacturer: QUALCOMM INCORPORATED
| model: 0
| firmware revision: MPSS.JO.2.0.2.c1.1-00032-9607_GENNS_PACK-1 1 [Feb 25 2019 01:00:00]
| carrier config: default
| h/w revision: 10000
| supported: gsm-umts, lte
| current: gsm-umts, lte
| equipment id: xxxxxxx
----------------------------------
System | device: /sys/devices/platform/soc@0/38200000.usb/xhci-hcd.4.auto/usb1/1-1/1-1.2
| drivers: qmi_wwan, option
| plugin: broadmobi
| primary port: cdc-wdm0
| ports: cdc-wdm0 (qmi), ttyUSB0 (qcdm), ttyUSB1 (at), ttyUSB2 (at),
| ttyUSB3 (at), wwan0 (net)
----------------------------------
Status | lock: sim-pin2
| unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
| state: e[32mconnectede[0m
| power state: on
| access tech: lte
| signal quality: 60% (cached)
----------------------------------
Modes | supported: allowed: 2g; preferred: none
| allowed: 3g; preferred: none
| allowed: 4g; preferred: none
| allowed: 2g, 3g; preferred: 3g
| allowed: 2g, 3g; preferred: 2g
| allowed: 2g, 4g; preferred: 4g
| allowed: 2g, 4g; preferred: 2g
| allowed: 3g, 4g; preferred: 4g
| allowed: 3g, 4g; preferred: 3g
| allowed: 2g, 3g, 4g; preferred: 4g
| allowed: 2g, 3g, 4g; preferred: 3g
| allowed: 2g, 3g, 4g; preferred: 2g
| current: allowed: 2g, 3g, 4g; preferred: 4g
----------------------------------
Bands | supported: pcs, g850, utran-4, utran-5, utran-2, eutran-2, eutran-3,
| eutran-4, eutran-5, eutran-12, eutran-13, eutran-17, eutran-25,
| eutran-26, eutran-41, eutran-66
| current: pcs, g850, utran-4, utran-5, utran-2, eutran-2, eutran-3,
| eutran-4, eutran-5, eutran-12, eutran-13, eutran-17, eutran-25,
| eutran-26, eutran-41, eutran-66
----------------------------------
IP | supported: ipv4, ipv6, ipv4v6
----------------------------------
3GPP | imei: xxxxxxx
| enabled locks: fixed-dialing
| operator id: 310410
| operator name: Truphone
| registration: home
----------------------------------
3GPP EPS | ue mode of operation: csps-1
| initial bearer path: /org/freedesktop/ModemManager1/Bearer/2
| initial bearer ip type: ipv4v6
----------------------------------
SIM | primary sim path: /org/freedesktop/ModemManager1/SIM/0
----------------------------------
Bearer | paths: /org/freedesktop/ModemManager1/Bearer/0
Take that, Android!