How to check periodically if the modem can do outbound calls

Yesterday I faced again that outgoing calls are not working: after dial there is just silence and I could stop the call in the dialer app. The call were visible in the SQL database as, the first three not working:

918|xxxxxxxx49228|0|2025-04-22T15:19:40.561197Z||2025-04-22T15:20:03.900593Z|tel
(silent)
919|xxxxxxxx228|0|2025-04-22T15:22:01.742353Z||2025-04-22T15:22:39.753515Z|tel
(silent)
920|xxxxxxxx319|0|2025-04-22T17:46:02.575883Z||2025-04-22T17:46:28.380309Z|tel
(silent)

Then I toggled the modem’s HKS and all was fine again:

921|xxxxxxxx319|0|2025-04-22T17:48:42.444703Z||2025-04-22T17:48:45.422714Z|tel
(fine)

The last time, when the modem was working fine, was around 7:40 hours before: I received a SMS from my mobile provider about the payment.

That’s bad, that a modem silently does not work and you detect this only when an outgoing call does not work. How man calls could I’ve got lost in these 7 hours and 40 minutes!

This let me think in some automated and frequently check to detect, if so modem is still working for calls and SMS.

The first question is: How this could be done without doing a real call or SMS? May be with AT cmd to check the serial communication with the modem and the signal quality at the moment… Any other ideas?

3 Likes

How about these: AT Commands: Router setup and Connectivity tests ?

1 Like

I think you are going to have to reproduce the failure and then you can compare the state of the modem with the correctly operating state as far as any checks that you can make.

I don’t think the AT command interface is actually used by the phone’s software so even if the AT interface fell over, you might still be able to make calls. (The only way that I know of getting the signal quality directly from the modem is via the AT interface.)

What about accessing the internet via the modem? If that doesn’t work but it normally would then that may indicate a problem. But the assumption is that whatever the problem is, it affects both data and calls.

In my country, the numbering plan sets aside ranges of numbers or specific numbers that will never be allocated. They might be safe to call i.e. as a real call, provided that the details of the failure can distinguish between the expected failure (unallocated number) and the unexpected failure (something else wrong, whatever is the situation that you are trying to detect).

1 Like

One should investigate next time the situation with commands like:

sudo mmcli -m any
  -----------------------------------
  General  |                    path: /org/freedesktop/ModemManager1/Modem/1
           |               device id: 3102154d67c2624503a491a3d13d3c700090bebe
  -----------------------------------
  Hardware |            manufacturer: QUALCOMM INCORPORATED
  ...

sudo mmcli -m any --time
  -------------------
  Time     | current: 2025-04-23T12:12:57+02:00
  -------------------
  Timezone | current: 120

sudo mmcli -m any --voice-create-call='number=+491704527211'
    Successfully created new call: /org/freedesktop/ModemManager1/Call/9


not yet tested:

sudo mmcli -m any -r
    Resets the modem to the settings it had when it was power cycled

sudo mmcli -m any --command='AT+GMM'
    Cannot send AT command to modem: operation only allowed in debug mode'
...
1 Like

As the error message says, you would have to enable debug mode permanently for this command to be useful as a means of comparing the working state with the non-working state.

Tip (at least for the benefit of others): Tips & Tricks Ā· Wiki Ā· Librem5 / Librem 5 Community Wiki Ā· GitLab

1 Like

I now, I also read this in man mmcli. I’m trying to figure out how to use this, as man ModemMangager says among other things::

       --debug
              Runs ModemManager with "DEBUG" log level and  without  daemoniz‐
              ing.  This  is useful for debugging, as it directs log output to
              the controlling terminal in addition to syslog.

i.e. it will not go to background if I overload the service:

cat /usr/lib/systemd/system/ModemManager.service.d/quick-resume.conf
[Service]
ExecStart=
ExecStart=/usr/sbin/ModemManager --test-quick-suspend-resume

Something to figure out in the future if the mmcli calls do not show results.

1 Like

If you can’t work it out then the tip link that I posted gives you ā€œMethod Bā€ for executing AT commands. I mostly use Method B and it works for me.

1 Like

I know Method B, but with kermit, see here:

2 Likes

I have here the output of the mmcli --modem any. Is there a detailed
description of the printed values? For example, what does mean:

signal quality: 62% (cached)

supported: ipv4, ipv6, ipv4v6

initial bearer …

Bearer …

$ mmcli --modem any

  -----------------------------------
  General  |                    path: /org/freedesktop/ModemManager1/Modem/1
           |               device id: xxxxxxxxxxxx624503a491a3d13d3xxxxxxxxxxxx
  -----------------------------------
  Hardware |            manufacturer: QUALCOMM INCORPORATED
           |                   model: 0
           |       firmware revision: MPSS.JO.2.0.2.c1.1-00032-9607_GENNS_PACK-1.351938.1  1  [Nov 26 2020 02:00:00]
           |          carrier config: ROW_Generic_3GPP
           | carrier config revision: 05010822
           |            h/w revision: 10000
           |               supported: gsm-umts, lte
           |                 current: gsm-umts, lte
           |            equipment id: 8639740xxxxxxxx
  -----------------------------------
  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)
  -----------------------------------
  Numbers  |                     own: 4917600000000
  -----------------------------------
  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: 62% (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: egsm, dcs, pcs, g850, utran-1, utran-5, utran-8, utran-2, 
           |                          eutran-1, eutran-2, eutran-3, eutran-5, eutran-7, eutran-8, 
           |                          eutran-20, eutran-38, eutran-40, eutran-41
           |                 current: egsm, dcs, pcs, g850, utran-1, utran-5, utran-8, utran-2, 
           |                          eutran-1, eutran-2, eutran-3, eutran-5, eutran-7, eutran-8, 
           |                          eutran-20, eutran-38, eutran-40, eutran-41
  -----------------------------------
  IP       |               supported: ipv4, ipv6, ipv4v6
  -----------------------------------
  3GPP     |                    imei: 863974040361976
           |           enabled locks: sim, fixed-dialing
           |             operator id: 26203
           |           operator name: o2 - de
           |            registration: home
  -----------------------------------
  3GPP EPS |    ue mode of operation: csps-1
           |     initial bearer path: /org/freedesktop/ModemManager1/Bearer/13
           |  initial bearer ip type: ipv4v6
  -----------------------------------
  SIM      |        primary sim path: /org/freedesktop/ModemManager1/SIM/1
  -----------------------------------
  Bearer   |                   paths: /org/freedesktop/ModemManager1/Bearer/14
           |                          /org/freedesktop/ModemManager1/Bearer/12
  -------------------
  Time     | current: 2025-04-26T09:40:06+02:00
  -------------------
  Timezone | current: 120
1 Like

From time to time I’m doing calls from another mobile to my L5 and always terminate the call without answering it in the L5.

Observations:

  • one time the call ended in the other moblie, but the L5 kept ringing until I hung up in the L5
  • one time (right now), the UI of calls did not went away; I could SSH into the L5 after bringing up Wifi, tried to kill all proc of ps ax | grep -i call
purism@pureos:~$ ps ax | grep -i call
   1034 ?        Sl     0:00 /usr/bin/callaudiod
   1264 tty7     Sl+    2:14 gnome-calls --daemon
 123283 pts/0    S+     0:00 grep -i call
purism@pureos:~$ kill 1264
purism@pureos:~$ kill 1264
-bash: kill: (1264) - No such process
purism@pureos:~$ kill 1034
purism@pureos:~$ kill 1034
-bash: kill: (1034) - No such process

but at the end only power-button reboot helped.

1 Like

Probably the source code. :wink:

I would guess that the signal quality really means the signal strength and that the signal strength in dBm is somehow converted to a percentage.

It is possible also that it is telling you that it didn’t ask the modem for the current signal strength but instead relied on a cached value - in which case this command would be inappropriate to investigate if you suspected that the signal is dropping out.

AT+CSQ is the magic AT command to get the current signal strength and the first of the two numbers in the output is the one you are interested in and ā€œhigher is betterā€. Note that this command does not get an actual value in dBm but it can be converted directly to such a value.

Means that it supports any one of 1) IPv4 exclusively 2) IPv6 exclusively 3) IPv4/IPv6 dual stack.

IP should be completely unnecessary in order to make and receive phone calls on the mobile network - so this is probably not relevant.

1 Like