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?

2 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