ts-7000
[Top] [All Lists]

Re: [ts-7000] Multiple FTDI USB-to-Serial ports?

To:
Subject: Re: [ts-7000] Multiple FTDI USB-to-Serial ports?
From: Larry W Howell <>
Date: Fri, 07 Aug 2009 09:39:18 -0400
bburtan65 wrote:
> Anyone know how to deal with multiple FTDI USB-to-Serial port converter 
> devices?  If you plug two in, do you get separate /dev entries and if so, how 
> do you determine which one you're talking to?
> 

The device name is dynamically assigned when the converter is plugged in. 
I've been told by some people that marking the converters and always plugging 
then in the same order gives the same device name.  However, I prefer to use 
the converter serial number and a rules file to persistently determine the 
device name.  To find a converter's serial number, plug them in one at a time 
and run "cat /proc/bus/usb/devices" and check the output for the FTDI serial 
number.  On my Debian host I get:

T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=01 Dev#= 12 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0403 ProdID=6001 Rev= 6.00
S:  Manufacturer=FTDI
S:  Product=US232R
S:  SerialNumber=FTCW148K
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=ftdi_sio
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

and

T:  Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#= 11 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0403 ProdID=6001 Rev= 6.00
S:  Manufacturer=FTDI
S:  Product=US232R
S:  SerialNumber=FTCW14BL
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=ftdi_sio
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

Once you know the serial numbers, you create something like this
/etc/udev/rules.d/ttyFTDI.rules file:

# Rules for persistent naming for FTDI based USB to RS-232 adapters,
# based on serial numbers.
#
# 2008-04-24 LWH Updated for Debian 4
#                   grammar changed
#                      == is comparison
#                      =  is for assignment
#                      += is for additional assignment
#                         (particularly for SYMLINKs)
#                   permissions can be handled here (don't need separate file)
# 2008-04-24 LWH

# Make all regular COM ports in my group
KERNEL=="tty[A-Z]*",            GROUP="lwh"

# Make all FTDI based USB to RS-232 adapters in lwh group (redundant)
BUS=="usb", SYSFS{idProduct}=="6001", SYSFS{idVendor}=="0403", GROUP="lwh"

# This is for the adapters owned by me.
BUS=="usb", SYSFS{idProduct}=="6001", SYSFS{idVendor}=="0403", 
SYSFS{serial}=="FTCW148K", SYMLINK+="ttyLWH0"
BUS=="usb", SYSFS{idProduct}=="6001", SYSFS{idVendor}=="0403", 
SYSFS{serial}=="FTCW148L", SYMLINK+="ttyLWH1"

I mark the converters with the last char of their SN, 'K' and 'L', and can 
plug then in in any order knowing the device name that will be assigned.

Several years ago a friend first suggested this approach to me.  Thanks Jim!

BTW, the /proc/bus/usb/devices file isn't populated on all distros.  I know 
Ubuntu doesn't have it, but Debian and Red Hat does.  YMMV.

Larry


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU