Re: primary device changing from boot to boot



On Fri, Sep 1, 2017 at 1:22 PM, Dan Williams <dcbw redhat com> wrote:
On Fri, 2017-09-01 at 13:01 -0700, Tim Harvey wrote:
Greetings,

I've got a Sierra Wireless HL7588 modem which exposes three ttyACM
devs via the cdc_acm driver. The device appears to work fine with
ModemManager (1.6.8) but occasionally mm detects the primary device
as
ttyACM2 instead of the usuall ttyACM0. In this case (detected primary
AT interface of ttyACM2), if I've already configured NetworkManager
to
use /dev/ttyACM0 I can't bring up the modem.

NM has a "DeviceIdentifier" property on GSM connections partly for this
reason.  You cannot always guarantee that even if MM *did* detect the
first exposed TTY as primary, that it's going to be called ttyACM0.
The kernel is free to name these things whatever it wants, and if
ttyACM0 is already used it'll pick another one.  I've had this happen
when some program holds the TTY open and the modem reboots.

So moral of the story is, don't depend on device names.

Get the MM device identifier from the modem:

dbus-send --print-reply --system --dest=org.freedesktop.ModemManager1
/org/freedesktop/ModemManager1/Modem/0
org.freedesktop.DBus.Properties.Get
string:org.freedesktop.ModemManager1.Modem string:DeviceIdentifier

and then set that string as the DeviceIdentifier in the NetworkManager
connection for the modem.  That connection will then only ever apply to
that specific modem.  You can then do things liek "nmcli con up
<connection mame>" and NM will figure out what device it should use.


Dan,

This makes sense, but how do I configure NetworkManager to use the
device-id? I don't see it as an available option for type gsm, so
perhaps I need to edit the file in
/etc/NetworkManager/system-connections/mymodem and add it to the 'gsm'
section but maybe I've got larger issues because nm seems to not even
like ttyACM0 for the interface:

root@ventana:~# mmcli -m 0

/org/freedesktop/ModemManager1/Modem/0 (device id
'6909b49a4d44867387a2b09b8095c579e031874c')
  -------------------------
  Hardware |   manufacturer: 'Sierra Wireless'
           |          model: 'HL7588'
           |       revision: 'RHL75xx.V.3.7.151600.201702071034.x7160_1'
           |      supported: 'gsm-umts, lte'
           |        current: 'gsm-umts, lte'
           |   equipment id: '014284000070452'
  -------------------------
  System   |         device:
'/sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb2/2-1'
           |        drivers: 'cdc_acm, cdc_ncm'
           |         plugin: 'Generic'
           |   primary port: 'ttyACM0'
           |          ports: 'wwx000011121314 (net), ttyACM0 (at),
wwx000011121316 (net), wwx00001112131a (net), wwx000011121318 (net),
ttyACM2 (at)'
  -------------------------
  Numbers  |           own : '+19529136397'
  -------------------------
  Status   |           lock: 'none'
           | unlock retries: 'unknown'
           |          state: 'enabled'
           |    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: 'unknown'
           |        current: 'unknown'
  -------------------------
  IP       |      supported: 'ipv4, ipv6, ipv4v6'
  -------------------------
  3GPP     |           imei: '014284000070452'
           |  enabled locks: 'none'
           |    operator id: 'unknown'
           |  operator name: 'unknown'
           |   subscription: 'unknown'
           |   registration: 'idle'
  -------------------------
  SIM      |           path: '/org/freedesktop/ModemManager1/SIM/0'

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

root@ventana:~# dbus-send --print-reply --system \
   --dest=org.freedesktop.ModemManager1 \
   /org/freedesktop/ModemManager1/Modem/0 \
   org.freedesktop.DBus.Properties.Get \
   string:org.freedesktop.ModemManager1.Modem string:DeviceIdentifier
method return time=1504629466.392532 sender=:1.3 -> destination=:1.25
serial=31 reply_serial=2
   variant       string "6909b49a4d44867387a2b09b8095c579e031874c"

root@ventana:~# nmcli --version
nmcli tool, version 1.2.6

root@ventana:~# nmcli device status
DEVICE   TYPE      STATE         CONNECTION
eth0     ethernet  disconnected  --
ttyACM0  gsm       unavailable   --
can0     can       unmanaged     --
lo       loopback  unmanaged     --

root@ventana:~# nmcli connection add type gsm ifname ttyACM0 con-name
mymodem apn vzwinternet
Connection 'mymodem' (ce87bf21-f700-4c61-8165-dda4b6c44ea8) successfully added.

nmcli connection add type gsm ifname ttyACM0 con-name mymodem apn vzwinternet

root@ventana:~# nmcli connection up mymodem
Error: Connection activation failed: No suitable device found for this
connection.
^^^^^^ not sure why ttyACM0 isn't acceptable here

Thanks,

Tim


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]