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

2013-10-24 Thread Aleksander Morgado
On 24/10/13 04:37, Volker Kuhlmann wrote:
  http://cgit.freedesktop.org/ModemManager/ModemManager/tree/src/77-mm-usb-device-blacklist.rules
 Thank you very much Dan, adding ID_MM_DEVICE_IGNORE is trivial once one
 knows that is the trick to use.
 
 Are there *any* modems using any of the FTDI USB/serial converters? Or
 does MM handle the old serial port modems too? Because if not, modem
 manager should perhaps be shipped with a blacklist rule for those
 because it can never do any good with them.
 

MM supports plain RS232 modems (e.g. some Cinterion ones or Iridium
satellite modems).

In MM 0.6.x we had a blacklist for serial devices which are definitely
not modems. In this list we (upstream) didn't include USB-RS232
adapters, although several distributions then added those in the
blacklist when packaging (therefore removing support for RS232 modems
connected via USB-RS232 adapters).

To solve this issue and avoid having distros ship additional blacklist
rules, in MM 1.x we added an additional 'greylist', so that we have:
 * a blacklist for serial devices which are definitely not modems (as we
had in 0.6.x upstream)
 * a greylist for USB-RS232 adapters, as they may have a RS232 modem
behind.

In this setup, MM will never probe the blacklisted ones, and will only
probe the greylisted ones if a manual Scan() is requested (i.e. never
automatically). Setups using MM with a RS232 modem will anyway need a
periodic explicit Scan() to detect whether there is a modem in the
serial port (both with platform ports and for USB-RS232 adapters), so
applying the greylist only for this case is actually appropriate.

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


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

2013-10-23 Thread Volker Kuhlmann
On Sun 20 Oct 2013 08:43:57 NZDT +1300, Dan Williams wrote:

 http://cgit.freedesktop.org/ModemManager/ModemManager/tree/src/77-mm-usb-device-blacklist.rules

Thank you very much Dan, adding ID_MM_DEVICE_IGNORE is trivial once one
knows that is the trick to use.

Are there *any* modems using any of the FTDI USB/serial converters? Or
does MM handle the old serial port modems too? Because if not, modem
manager should perhaps be shipped with a blacklist rule for those
because it can never do any good with them.

 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.

Here's a snag:

I use rules like (1 line)

SUBSYSTEMS==usb, ATTRS{idVendor}==0403, ATTRS{idProduct}==6001,
ATTRS{manufacturer}==FTDI, ATTRS{product}==FT232R USB UART,
ATTRS{serial}==A60x, SYMLINK+=ttyUSB_somename

without any other qualification so I can access my hardware by
ttyUSB_somename without having to care what number the kernel assigned
this time.

Appending ENV{ID_MM_DEVICE_IGNORE}=1 to that keeps MM off.

Bracketing this with

  ACTION!=add|change, GOTO=AVR_FTDI_rules_end

is fine, however, bracketing this with either one of

  SUBSYSTEM!=usb, GOTO=AVR_FTDI_rules_end
  ENV{DEVTYPE}!=usb_device, GOTO=AVR_FTDI_rules_end

causes the symlinks to be created like this:

  crw-rw  /dev/ttyUSB0
  lrwxrwxrwx  /dev/ttyUSB_somename - bus/usb/001/041

which is useless.

What happens exactly if I don't qualify the symlink rule by
SUBSYSTEM==usb, ENV{DEVTYPE}==usb_device? I don't currently have a
modem to try this with.

Thanks again,

Volker

-- 
Volker Kuhlmann
http://volker.dnsalias.net/ Please do not CC list postings to me.
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


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

2013-10-19 Thread Dan Williams
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:

http://cgit.freedesktop.org/ModemManager/ModemManager/tree/src/77-mm-usb-device-blacklist.rules

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.

Dan

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


___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Preventing modem-manager from accessing specific serial ports?

2013-10-18 Thread Volker Kuhlmann
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?

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

Thanks,

Volker

-- 
Volker Kuhlmann
http://volker.dnsalias.net/ Please do not CC list postings to me.
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list