On Tue, Sep 5, 2017 at 1:59 PM, Dan Williams <d...@redhat.com> wrote: > On Tue, 2017-09-05 at 12:32 -0700, Tim Harvey wrote: >> On Tue, Sep 5, 2017 at 9:53 AM, Dan Williams <d...@redhat.com> wrote: >> > On Tue, 2017-09-05 at 09:38 -0700, Tim Harvey wrote: >> > > On Fri, Sep 1, 2017 at 1:22 PM, Dan Williams <d...@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' >> > >> > nmcli con mod <connection name> gsm.device-id \ >> > 6909b49a4d44867387a2b09b8095c579e031874c >> > >> > Or yeah, drop: >> > >> > device-id=6909b49a4d44867387a2b09b8095c579e031874c >> > >> > into the [gsm] section of the keyfile in >> > /etc/NetworkManager/system- >> > connections. >> > >> >> Using 'device-id' does not appear to not work, at least not in NM >> 1.2.6: > > 1.2.6 should have the right support. Perhaps I didn't quite understand > what you were asking though. > > device-id is useful if you have multiple modems on a system, or if you > swap modems between systems and want a connection to apply to a > specific device.
or if you have a modem where the primary interface mm detects can't make up it's mind between tty's which is my case. > > But your original question was about device naming, and ACM0 vs. ACM2. > For some modems, it shouldn't matter what the interface name is. So in > your case, you wouldn't do anything to "configured NetworkManager to > use /dev/ttyACM0", you'd simply set the device-id and then use the NM > connection name to start/stop things. You wouldn't hardcode "nmcli dev > connect ttyACM0" or anything like that. > > Instead you'd "nmcli con up Verizon" and the device-id would tell NM to > use the right device, no matter whether ACM0, ACM2, or USB3 or > whatever. > > Basically, you don't want to hardcode tty device names ever, because > they can and do change. So if you're doing that somewhere, I'd > recommend instead using the NM connection name, and device-id to make > sure the connection always applies to that specific modem. > I understood what you meant, but it wasn't working. I found that in order to use 'device-id' you must also remove the 'interface-name' param from the '[connection]' section as well. Thanks - it works like a charm now! Tim _______________________________________________ ModemManager-devel mailing list ModemManager-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel