Trying to connect using a GSM modem without SIM card is not reported to user

Bug #1113703 reported by Marius B. Kotsbak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ModemManager
Fix Released
Medium
NetworkManager
Confirmed
Wishlist
gnome-shell (Ubuntu)
Invalid
Undecided
Unassigned
modemmanager (Ubuntu)
New
Undecided
Unassigned
network-manager (Ubuntu)
New
Undecided
Unassigned
network-manager-applet (Ubuntu)
New
Undecided
Unassigned
networkmanagement (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

When the user tries to connect using a GSM modem that lacks a SIM card, NM just gives the user a general connection failure message; it does not give any hint about the missing SIM card. This can fool the user into thinking something other is wrong than the fact that he forgot to insert the SIM card, or inserted it improperly.

Latest modemmanager master branch gives in log:

Feb 2 20:21:24 marius-T1005 ModemManager[1105]: <warn> Modem couldn't be initialized: Couldn't check unlock status: SIM failure

but there is no indication to the user (nm-applet behaves as if mobile broadband is unavailable).

Seems I get (from "src/mm-error-helpers.c"):

    { MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE, "simfailure", "SIM failure" },

but should have got:

{ MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED, "simnotinserted", "SIM not inserted" }

Anyway (any of them should be enough hint to the user), it seems like the error state is not propagated (src/mm-broadband-modem.c):

static void
iface_modem_initialize_ready (MMBroadbandModem *self,
                              GAsyncResult *result,
                              InitializeContext *ctx)
{
    GError *error = NULL;

    /* If the modem interface fails to get initialized, we will move the modem
     * to a FAILED state. Note that in this case we still export the interface. */
    if (!mm_iface_modem_initialize_finish (MM_IFACE_MODEM (self), result, &error)) {
        /* Report the new FAILED state */
        mm_warn ("Modem couldn't be initialized: %s", error->message);
        g_error_free (error);

        mm_iface_modem_update_state (MM_IFACE_MODEM (self),
                                     MM_MODEM_STATE_FAILED,
                                     MM_MODEM_STATE_CHANGE_REASON_UNKNOWN);

        /* Jump to the firmware step. We allow firmware switching even in failed
         * state */
        ctx->step = INITIALIZE_STEP_IFACE_FIRMWARE;
        initialize_step (ctx);
        return;
    }

Network Manager logs:

20:21:24 marius-T1005 NetworkManager[1128]: <warn> (ttyUSB2): unusable modem detected

description: updated
description: updated
description: updated
Changed in network-manager:
importance: Unknown → Wishlist
status: Unknown → Confirmed
Revision history for this message
Aleksander Morgado (aleksander-m) wrote :

The first step is to let MM say why it is in Failed state; then the UI can pick that up and show the proper message to the user.

See https://bugzilla.gnome.org/show_bug.cgi?id=691778

Revision history for this message
Marius B. Kotsbak (mariusko) wrote :

Japp, that is what I was about to propose for the case above. Is the error saved to that just an API extension is needed?

I think for MM 0.6.x or for some other modem models, the modem is initialized fine, but it fails during connecting. Those cases are probably easier to fix, since there is a call to MM when the user connects that could contain the right error return code to display to the user.

We probably don't want to spam the user at every init if the modem has no SIM and the user doesn't want to insert any (integrated modem but not currently in use).

Revision history for this message
Aleksander Morgado (aleksander-m) wrote :

In the case of errors in call management; those are already passed back to NetworkManager, but they get lost in there without getting to the UI probably.

And for the case of the no SIM errors, you're right, the UI may not want to spam the user with notifications about the missing SIM; but it may just show the modem item with the error string in either the NM applet or the Shell Indicator.

Changed in modemmanager:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Marius B. Kotsbak (mariusko) wrote :

It seems like some important details are lost between MM and NM too, see log at https://bugzilla.gnome.org/show_bug.cgi?id=559488.

Thomas Hood (jdthood)
Changed in gnome-shell (Ubuntu):
status: New → Invalid
description: updated
Changed in networkmanagement (Ubuntu):
status: New → Invalid
Revision history for this message
Marius B. Kotsbak (mariusko) wrote :

Why tve above changes? It is quite likely that the NM clients needs to be updated to handle the errors properly.

Changed in modemmanager:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.