NetworkManager fails to start gsm connection

Posted on

Problem :

I am trying to configure a gsm modem connection in linux using NetworkManager.

The details of the modem are as follows:

# mmcli -m 0

/org/freedesktop/ModemManager1/Modem/0 (device id 'f45005b4e117e9572228e3e57af4ead9cc620063')
  -------------------------
  Hardware |   manufacturer: 'Sierra Wireless, Incorporated'
           |          model: 'MC7304'
           |       revision: 'SWI9X15C_05.05.58.00 r27038 carmd-fwbuild1 2015/03/04 21:30:23'
           |      supported: 'gsm-umts
           |                  lte
           |                  gsm-umts, lte'
           |        current: 'gsm-umts, lte'
           |   equipment id: '356853056005343'
  -------------------------
  System   |         device: '/sys/devices/platform/ocp/47400000.usb/47401400.usb/musb-hdrc.0.auto/usb1/1-1'
           |        drivers: 'option1, qmi_wwan'
           |         plugin: 'Generic'
           |   primary port: 'cdc-wdm0'
           |          ports: 'ttyUSB0 (qcdm), ttyUSB2 (at), cdc-wdm0 (qmi), wwan0 (net)'
  -------------------------
  Numbers  |           own : 'unknown'
  -------------------------
  Status   |           lock: 'sim-pin'
           | unlock retries: 'sim-pin (3), sim-pin2 (0), sim-puk (10), sim-puk2 (10)'
           |          state: 'locked'
           |    power state: 'on'
           |    access tech: 'unknown'
           | signal quality: '0' (cached)
  -------------------------
  Modes    |      supported: 'allowed: 2g, 3g, 4g; preferred: none'
           |        current: 'allowed: 2g, 3g, 4g; preferred: none'
  -------------------------
  Bands    |      supported: 'cdma-bc15-aws, dcs, egsm, pcs, g850, u2100, u1900, u800, u850, u900, eutran-i, eutran-iii, eutran-vii, eutran-viii, eutran-xx'
           |        current: 'cdma-bc15-aws, dcs, egsm, pcs, g850, u2100, u1900, u850, u900, eutran-i, eutran-iii, eutran-vii, eutran-viii, eutran-xx'
  -------------------------
  IP       |      supported: 'ipv4, ipv6, ipv4v6'
  -------------------------
  SIM      |           path: '/org/freedesktop/ModemManager1/SIM/0'

  -------------------------
  Bearers  |          paths: 'none'

I then try to add the connection as follows:

# nmcli c add save yes type gsm ifname cdc-wdm0 con-name gsm autoconnect yes apn gprs.swisscom.ch user gprs password gprs
Connection 'gsm' (7acbdf27-9854-4f5a-a5d4-dbfde55e79a3) successfully added.
# nmcli c modify gsm gsm.pin ****

I then verify that the connection has been registered:

# nmcli con
NAME                UUID                                  TYPE            DEVICE
gsm                 7acbdf27-9854-4f5a-a5d4-dbfde55e79a3  gsm             --
Wired connection 2  5059a1aa-9674-4e9f-8a6d-5ef5c5fb4389  802-3-ethernet  --
Wired connection 1  76533211-9c38-411d-8e73-c0e2d58a267a  802-3-ethernet  eth0

Then I try and connect:

# nmcli c up gsm
Error: Connection activation failed: Connection 'gsm' is not available on the device cdc-wdm0 at this time.

Here are the resulting log entries:

Feb 27 15:27:29 amg NetworkManager[286]: <info> Auto-activating connection 'gsm'.
Feb 27 15:27:29 amg NetworkManager[286]: <info> Activation (cdc-wdm0) starting connection 'gsm'
Feb 27 15:27:29 amg NetworkManager[286]: <info> Activation (cdc-wdm0) Stage 1 of 5 (Device Prepare) scheduled...
Feb 27 15:27:29 amg NetworkManager[286]: <info> Activation (cdc-wdm0) Stage 1 of 5 (Device Prepare) started...
Feb 27 15:27:29 amg NetworkManager[286]: <info> (cdc-wdm0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Feb 27 15:27:29 amg NetworkManager[286]: <info> (cdc-wdm0): device state change: prepare -> need-auth (reason 'none') [40 60 0]
Feb 27 15:27:29 amg NetworkManager[286]: <info> Activation (cdc-wdm0) Stage 1 of 5 (Device Prepare) complete.
Feb 27 15:27:29 amg NetworkManager[286]: <warn> No agents were available for this request.
Feb 27 15:27:29 amg NetworkManager[286]: <info> (cdc-wdm0): device state change: need-auth -> failed (reason 'no-secrets') [60 120 7]
Feb 27 15:27:29 amg NetworkManager[286]: <warn> Activation (cdc-wdm0) failed for connection 'gsm'
Feb 27 15:27:29 amg NetworkManager[286]: ** (NetworkManager:286): CRITICAL **: mm_modem_simple_disconnect: assertion 'MM_IS_MODEM_SIMPLE (self)' failed
Feb 27 15:27:29 amg NetworkManager[286]: <info> (cdc-wdm0): device state change: failed -> disconnected (reason 'none') [120 30 0]
Feb 27 15:27:29 amg NetworkManager[286]: <info> (cdc-wdm0): deactivating device (reason 'none') [0]
Feb 27 15:28:05 amg NetworkManager[286]: <warn> Failed to activate 'gsm': Connection 'gsm' is not available on the device cdc-wdm0 at this time.

What is going wrong? Did I misconfigure something? Or is there an additional step? How can I investigate further as to what is going wrong?

It seems that a clue is this line: ** (NetworkManager:286): CRITICAL **: mm_modem_simple_disconnect: assertion 'MM_IS_MODEM_SIMPLE (self)' failed, but I’m unsure what this means.

Any help would be greatly appreciated.

Solution :

I’m late for the party here (troubleshooting a related issue), but it seems that the SIM card is locked in the above printout:

Status   |           lock: 'sim-pin'
         | unlock retries: 'sim-pin (3), sim-pin2 (0), sim-puk (10), sim-puk2 (10)'
         |          state: 'locked' <-- there
         |    power state: 'on'
         |    access tech: 'unknown'
         | signal quality: '0' (cached)

One way to fix it is to have network manager send the PIN automatically to the modem/SIM. Below is an example from this site but you should get the idea:

nmcli c add type gsm ifname <interface> con-name <name> apn <operator_apn> username <user> password <password> pin <PIN>

I’ve edited the connection file in my /etc/NetworkManager/system-connections/ to something like this:

# This is from the middle of the file, and contains data relevant to my ISP
[gsm]
apn=online.telia.se
number=*99#
pin=1234

Leave a Reply

Your email address will not be published. Required fields are marked *