Re: Preventing modem-manager from accessing specific serial ports?

On Sat, 2013-10-19 at 09:07 +1300, Volker Kuhlmann wrote:
I have a bunch of Arduino hardware that connects with emulated serial
ports using FTDI chips (there are other possibilities for serial port
emulation too, e.g. CP2102 or microcontroller based ones).

As soon as I plug one of these devices in, modem-manager becomes active
and probes the devices, timing out each time (of course) and retrying
that about 3 times. This interferes with the serial port being used by
Arduino or terminal software.

What is the mechanism to tell modem-manager to keep its hands off
FTDI-based serial ports? I have used udev rules to create
constant-name device symlinks based on the devices USB IDs and serial
number. I realise that modems use emulated serial ports too so there is
always conflict, but I am not sure whether there are modems using
devices for which the device name is /dev/ttyUSBN. I'd be happy to
configure exclusion lists, but how do I do this?

A ton of modems will actually get assigned /dev/ttyUSBx by the kernel;
using device names is also usually a bad idea, because the kernel is
quite happy to renumber them all when you plug a different device in, or
if something goes wrong (driver wedges, etc) and you unplug/replug.
Symlinks aren't a solution here either, because the kernel will still
assign the same device name (eg ttyUSBx) to the devices.

So, you blacklist the entire USB device by whatever attributes you want
to use (often VID/PID, but could be anything else sysfs exposes), not
just the specific serial ports, because many devices expose multiple
serial ports.  The default examples are here:

copy that file, change it as appropriate, and put it
into /etc/udev/rules.d.  Note the match on "usb_device", which is the
key part here that applies the tag to the usb device object instead of
the TTYs that hang off it.


There also seems to be a difference between desktop and laptop
computers. Modem-manager activates only on the laptop.



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