mmcli "--timeout=[SECONDS]" does not work with --simple-connect

Amol Lad Amol.Lad at 4rf.com
Tue Jan 17 04:18:54 UTC 2023


Hi Aleksander,

I think the reason is the "60" seconds timeouts configured in register_in_3gpp_or_cdma_network() in mm-iface-modem-simple.c.

Now, how do we handle scenarios where network takes more than 60 seconds to register? --simple-connect will always timeout..

Please advise.

Amol

-----

static void
register_in_3gpp_or_cdma_network (MMIfaceModemSimple *self,
                                 const gchar *operator_id,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data)
{
    RegisterInNetworkContext *ctx;
    GTask *task;

    ctx = g_new0 (RegisterInNetworkContext, 1);
    ctx->operator_id = g_strdup (operator_id);

    /* 3GPP-only modems... */
    if (mm_iface_modem_is_3gpp_only (MM_IFACE_MODEM (self))) {
        ctx->max_try_time = 60;
        ctx->remaining_tries_cdma = 0;
        ctx->remaining_tries_3gpp = 1;
    }
    /* CDMA-only modems... */
    else if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (self))) {
        ctx->max_try_time = 60;
        ctx->remaining_tries_cdma = 1;
        ctx->remaining_tries_3gpp = 0;
    }
    /* Mixed 3GPP+CDMA modems... */
    else  {
        ctx->max_try_time = 10;
        ctx->remaining_tries_cdma = 6;
        ctx->remaining_tries_3gpp = 6;
    }

From: Amol Lad
Sent: Monday, 16 January 2023 10:30 AM
To: ModemManager (development) <modemmanager-devel at lists.freedesktop.org>
Subject: mmcli "--timeout=[SECONDS]" does not work with --simple-connect

Hi Aleksander,

I've tried with MM 1.20.4 and also 1.18.8 but it seems the timeout is always "60 seconds" even if a larger --timeout is provided to mmcli --simple-connect

Any suggestion will really help. I landed into this issue because here a network on roaming is taking around 90 seconds to register and I found mmcli --simple-connect is returning after 60 seconds wait even though I've provided --timeout=175

# time mmcli -m 0 --timeout=175 --simple-connect="apn=vi" -v
[16 Jan 2023, 04:15:43] [Debug] Forcing request to be run asynchronously
[16 Jan 2023, 04:15:43] [Debug] Assuming '0' is the modem index
[16 Jan 2023, 04:15:43] [Debug] ModemManager process found at ':1.1765'
[16 Jan 2023, 04:15:43] [Debug] Modem found at '/org/freedesktop/ModemManager1/Modem/0'

[16 Jan 2023, 04:15:43] [Debug] Asynchronously connecting the modem...
error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.MobileEquipment.NetworkTimeout: Network timeout'
Command exited with non-zero status 1
real    1m 0.82s
user    0m 0.01s
sys     0m 0.00s

Thanks
Amol

-------------- next part --------------
Hi Aleksander,

I think the reason is the "60" seconds timeouts configured in register_in_3gpp_or_cdma_network() in mm-iface-modem-simple.c.

Now, how do we handle scenarios where network takes more than 60 seconds to register? --simple-connect will always timeout..

Please advise.

Amol

-----

static void
register_in_3gpp_or_cdma_network (MMIfaceModemSimple *self,
                                 const gchar *operator_id,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data)
{
    RegisterInNetworkContext *ctx;
    GTask *task;

    ctx = g_new0 (RegisterInNetworkContext, 1);
    ctx->operator_id = g_strdup (operator_id);

    /* 3GPP-only modems... */
    if (mm_iface_modem_is_3gpp_only (MM_IFACE_MODEM (self))) {
        ctx->max_try_time = 60;
        ctx->remaining_tries_cdma = 0;
        ctx->remaining_tries_3gpp = 1;
    }
    /* CDMA-only modems... */
    else if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (self))) {
        ctx->max_try_time = 60;
        ctx->remaining_tries_cdma = 1;
        ctx->remaining_tries_3gpp = 0;
    }
    /* Mixed 3GPP+CDMA modems... */
    else  {
        ctx->max_try_time = 10;
        ctx->remaining_tries_cdma = 6;
        ctx->remaining_tries_3gpp = 6;
    }

From: Amol Lad
Sent: Monday, 16 January 2023 10:30 AM
To: ModemManager (development) <modemmanager-devel at lists.freedesktop.org>
Subject: mmcli "--timeout=[SECONDS]" does not work with --simple-connect

Hi Aleksander,

I've tried with MM 1.20.4 and also 1.18.8 but it seems the timeout is always "60 seconds" even if a larger --timeout is provided to mmcli --simple-connect

Any suggestion will really help. I landed into this issue because here a network on roaming is taking around 90 seconds to register and I found mmcli --simple-connect is returning after 60 seconds wait even though I've provided --timeout=175

# time mmcli -m 0 --timeout=175 --simple-connect="apn=vi" -v
[16 Jan 2023, 04:15:43] [Debug] Forcing request to be run asynchronously
[16 Jan 2023, 04:15:43] [Debug] Assuming '0' is the modem index
[16 Jan 2023, 04:15:43] [Debug] ModemManager process found at ':1.1765'
[16 Jan 2023, 04:15:43] [Debug] Modem found at '/org/freedesktop/ModemManager1/Modem/0'

[16 Jan 2023, 04:15:43] [Debug] Asynchronously connecting the modem...
error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.MobileEquipment.NetworkTimeout: Network timeout'
Command exited with non-zero status 1
real    1m 0.82s
user    0m 0.01s
sys     0m 0.00s

Thanks
Amol



More information about the ModemManager-devel mailing list