Multiple USB serial ports - Setup

This is a discussion on Multiple USB serial ports - Setup ; I've got a system with several USB serial devices. It's used to collect data. I'd like to be able to add new devices without fixing all my stuff to reflect the new device/file names. Is there any simple way to ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Multiple USB serial ports

  1. Multiple USB serial ports

    I've got a system with several USB serial devices. It's used to
    collect data. I'd like to be able to add new devices without
    fixing all my stuff to reflect the new device/file names.

    Is there any simple way to keep track of USB devices? This seems
    like something that somebody would have written a web page about.

    With old/normal serial ports, you can put a sticker on each
    connector like /dev/tty3, and it won't change when you reboot.

    With USB ports, the tty number depends upon the order that you
    plug them in. If I start with 2 of them, I have /dev/ttyUSB0
    and /dev/ttyUSB1. If I plug in another, I get /dev/ttyUSB2.
    If I reboot, they may come back as 0, 2, and 1 rather than 0, 1, 2,
    depending upon which slot I plugged the new one into.

    --
    These are my opinions, not necessarily my employer's. I hate spam.


  2. Re: Multiple USB serial ports

    On Sun, 21 Sep 2008 12:04:34 -0400, Hal Murray wrote:

    > Is there any simple way to keep track of USB devices? This seems
    > like something that somebody would have written a web page about.


    I'm currently running Mandriva 2008.1. For removable usb storage devices,
    udev and haldaemon generate a mount point based on the label in the
    file system. For example, I have a usb storage device, with one fat32
    filesystem on it, with a label of USBDrive256. When I connect the
    device, it's automatically mounted as /mnt/USBDrive256, so it doesn't
    matter if the device is /dev/sda, or /dev/sdb.

    For ethernet devices, udev keeps track of which mac address has been
    assigned to which ethernet device, in ...
    $ cat /etc/udev/rules.d/61-net_config.rules
    # udev persistent rules for net subsystem
    # Generated by Mandriva udev rules
    # See /etc/udev/rules.d/62-create_persistent.rules

    SUBSYSTEM=="net", ACTION=="add", ENV{INTERFACE}!="*.*", SYSFS{address}=="00:11:5b:c2:bb:e9", NAME="eth0", ENV{MDV_CONFIGURED}="yes"

    While it would take some digging into the haldaemon .fdi files, and the
    udev scripts, I expect something similar could be done for the usb
    serial devices.

    Regards, Dave Hodgins

    --
    Change nomail.afraid.org to ody.ca to reply by email.
    (nomail.afraid.org has been set up specifically for
    use in usenet. Feel free to use it yourself.)

  3. Re: Multiple USB serial ports

    Hal Murray wrote:
    > I've got a system with several USB serial devices. It's used to
    > collect data. I'd like to be able to add new devices without
    > fixing all my stuff to reflect the new device/file names.
    > Is there any simple way to keep track of USB devices? This seems
    > like something that somebody would have written a web page about.
    > With old/normal serial ports, you can put a sticker on each
    > connector like /dev/tty3, and it won't change when you reboot.
    > With USB ports, the tty number depends upon the order that you
    > plug them in. If I start with 2 of them, I have /dev/ttyUSB0
    > and /dev/ttyUSB1. If I plug in another, I get /dev/ttyUSB2.
    > If I reboot, they may come back as 0, 2, and 1 rather than 0, 1, 2,
    > depending upon which slot I plugged the new one into.


    There is no good solution and these apply only to the Fedora series.

    http://www/giwersworld.org/computers...sb-drives.html

    The problem is the most recent method currently on this page for Fedora 9
    stopped working with the only difference being some yum upgrades. After a
    recent dumbness on my part (linux is not mature enough for use by experienced
    users) I made a clean install of Fedora 9 and booted the system with drives
    attached to see what happened. It mostly took care of installation at the same
    mount points with the same name.

    The page discusses creating mount points. Without adding any directories to
    /media something in the boot process mounted the drives on a directory which
    has the same name as the hard drive label. So if the label is DRIVE1 you can
    write scripts using the path /media/DRIVE1. The problems are as follows.

    If a drive was formatted as either /dev/sdb (nor recommended) or /dev/sdb1
    (recommended) and is labeled DRIVE1 then it mounts as /media/DRIVE1. That is
    what I want it to do.

    However if there are two partitions on the drive and is labeled DRIVE1 you
    will find three directories created in /media. /media/DRIVE1 will have nothing
    mounted on it. /media/DRIVE1_ will have the first partition and
    /media/DRIVE1__ will have the second partition. Note the key is the number of
    underscores _ or __, one or two, is the difference.

    I am up to six drives now after nearly two years and the changes to the
    Fedora series have made it easier only AFTER I realize the change is for the
    better. My problem has been the improvements conflict with my work-arounds as
    described in the body of that web page. As I have no idea what is changing I
    cannot say if these have been Redhat changes or changes everyone is using.

    --
    If you mean biblical Israel don't tell me about a hilltop warlord.
    I don't like bait and switch.
    -- The Iron Webmaster, 4052
    http://www.giwersworld.org/israel/bombings.phtml a5

  4. Re: Multiple USB serial ports

    I'm interested in serial ports rather than storage devices or
    ethernets, so anything that uses data on the disk (label) or
    the host-ID won't work.

    I managed to do what I wanted with something like this in
    a udev rule file:

    ID=="1-4.1:1.0", MODE="0666", SYMLINK+="gpsusb3", OPTIONS="last_rule"

    I got the magic ID text by watching /var/log/messages while plugging
    a device in. (There is a hub in there on an extender cable.)

    --
    These are my opinions, not necessarily my employer's. I hate spam.


+ Reply to Thread