Serial ports ttyUSB{0..9} - Ubuntu

This is a discussion on Serial ports ttyUSB{0..9} - Ubuntu ; I have two devices that look like serial over USB: 1) My "wireless broadband modem" that lets my laptop connect to Internet while traveling using Sprint cell phone network 2) DeLuo GPS dongle. The problem is that they both look ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Serial ports ttyUSB{0..9}

  1. Serial ports ttyUSB{0..9}

    I have two devices that look like serial over USB:

    1) My "wireless broadband modem" that lets my laptop connect to
    Internet while traveling using Sprint cell phone network

    2) DeLuo GPS dongle.

    The problem is that they both look like /dev/ttyUSB0 or /dev/ttyUSB1
    depending on some whimsical factors like what was inserted first. They
    are not numbered consistently. Which I sort of understand.

    Is there some way to find (from scripts) which is which. That is,
    answer a question what /dev/ttyUSB I should use for my modem
    connection etc.

    --
    Due to extreme spam originating from Google Groups, and their inattention
    to spammers, I and many others block all articles originating
    from Google Groups. If you want your postings to be seen by
    more readers you will need to find a different means of
    posting on Usenet.
    http://improve-usenet.org/

  2. Re: Serial ports ttyUSB{0..9}

    > The problem is that they both look like /dev/ttyUSB0 or /dev/ttyUSB1
    > depending on some whimsical factors like what was inserted first. They
    > are not numbered consistently. Which I sort of understand.
    >
    > Is there some way to find (from scripts) which is which. That is,
    > answer a question what /dev/ttyUSB I should use for my modem
    > connection etc.


    There is a command "lsusb" if you install the USB utilities.

    --
    @~@ Might, Courage, Vision, SINCERITY.
    / v \ Simplicity is Beauty! May the Force and Farce be with you!
    /( _ )\ (Xubuntu 8.04) Linux 2.6.25.7
    ^ ^ 17:15:01 up 1 day 22:45 3 users load average: 1.03 1.35 1.25
    (CSSA):
    http://www.swd.gov.hk/tc/index/site_...ub_addressesa/

  3. Re: Serial ports ttyUSB{0..9}

    On 2008-06-18, Ignoramus22839 wrote:

    > I have two devices that look like serial over USB:
    >
    > 1) My "wireless broadband modem" that lets my laptop connect to
    > Internet while traveling using Sprint cell phone network
    >
    > 2) DeLuo GPS dongle.
    >
    > The problem is that they both look like /dev/ttyUSB0 or /dev/ttyUSB1
    > depending on some whimsical factors like what was inserted first. They
    > are not numbered consistently. Which I sort of understand.
    >
    > Is there some way to find (from scripts) which is which.


    Yes, but that's not how one sovles this problem on Linux

    > That is, answer a question what /dev/ttyUSB I should use for
    > my modem connection etc.


    The answer is don't use /dev/ttyUSBn. Set up udev rules so
    that the devices are named consistently regardless of the order
    they're plugged. You should set it up so that the devices are
    named something meaningful like /dev/ttyUSBmodem or /dev/ttyUSBgps.

    $ man udev

    http://www.kernel.org/pub/linux/util...plug/udev.html
    http://reactivated.net/writing_udev_rules.html
    http://gentoo-wiki.com/HOWTO_Customizing_UDEV
    http://www.gentoo.org/doc/en/udev-guide.xml
    http://www.enterprisenetworkingplane...le.php/3635686

    --
    Grant Edwards grante Yow! Everybody gets free
    at BORSCHT!
    visi.com

  4. Re: Serial ports ttyUSB{0..9}

    In article ,
    Ignoramus22839 wrote:
    :I have two devices that look like serial over USB:
    :
    :1) My "wireless broadband modem" that lets my laptop connect to
    :Internet while traveling using Sprint cell phone network
    :
    :2) DeLuo GPS dongle.
    :
    :The problem is that they both look like /dev/ttyUSB0 or /dev/ttyUSB1
    :depending on some whimsical factors like what was inserted first. They
    :are not numbered consistently. Which I sort of understand.
    :
    :Is there some way to find (from scripts) which is which. That is,
    :answer a question what /dev/ttyUSB I should use for my modem
    :connection etc.

    What you need is a local udev rule to create a /dev entry based on
    the Vendor and Product codes read from each device. For example,
    I have a file /etc/udev/rules.d/97-local.rules containing the line

    kernel=="ttyUSB*", SYSFS{idVendor}=="067b", SYSFS{idProduct}=="2303", SYMLINK="UPS"

    This creates a symlink /dev/UPS for the USB serial adapter that connects
    to my UPS, regardless of where that adapter happens to be plugged in on
    my system. The vendor and product codes can be found in the output from
    /sbin/lsusb, e.g.:

    Bus 001 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

    For writing udev rules, you can find more information than you probably
    care to know at

    http://www.reactivated.net/writing_udev_rules.html

    A version of that page might be stored on your system under
    /usr/share/doc/udev* .

    --
    Bob Nichols AT comcast.net I am "RNichols42"


+ Reply to Thread