[PLUG] USB Serial Port Adapters

Tim Wescott tim at wescottdesign.com
Sat Jun 18 00:03:16 UTC 2011


On 06/17/2011 04:46 PM, Rich Shepard wrote:
> On Fri, 17 Jun 2011, Tim Wescott wrote:
>
>> Is there a way to map specific USB serial port adapters to specific device
>> names?
> Tim,
>
>     Yep.
>
>> As far as I know, as I plug USB serial port adapters into the system
>> they'll appear as ttyUSB0, ttyUSB1, etc., in the order that I plug them
>> in.
>     They tend to appear as pairs; e.g., ttyUSB0 and ttyUSB1.
>
>> But I want to have them show up as "ttyUSBcamera", "ttyUSBdata_aq", etc.,
>> or something similar -- so that when I plug in a _specific_ hardware
>> device, it maps to a specific device in the /dev directory.
>     I used to have /dev/pilot defined for syncing my Palm (now Treo 700p), but
> that went away with the advent of udev. However, hardware does show up on
> consistent devices. For example, jpilot is set to connect on /dev/ttyUSB1,
> my thumb drives are defined in /etc/fstab as:
>
> /dev/sdb         /mnt/thumb       vfat        noauto,users,rw  0   0
> /dev/sdc         /mnt/flashdrive  vfat        noauto,users,rw  0   0
>
> which depends on which USB hole I use for it.
I think you misunderstand.  I did an experiment: I started with my Fax 
modem and the board I'm developing plugged in.  I did ls /dev/ttyU*.  
Then I unplugged the development board and did ls again.  Then I plugged 
in a debugger that has its own USB serial port adapter, and did ls 
again.  Here's my results:

tim at servo:~$ ls /dev/ttyU*
/dev/ttyUSB0  /dev/ttyUSB1
tim at servo:~$ ls /dev/ttyU*
/dev/ttyUSB0
tim at servo:~$ ls /dev/ttyU*
/dev/ttyUSB0  /dev/ttyUSB1

What _did_ happen is that at different times the same device -- ttyUSB1 
-- got mapped to different physical devices.  That is what I _do not_ 
want to happen.  What I want to happen is to plug in the development 
board and have /dev/ttyUSBdevelop appear, and to plug in the debugger 
and have /dev/ttyUSBdebug appear (or some similar me-defined mapping).  
Different devices.  Different, _unique_, identifiers.

Otherwise, every time I plug a bunch of stuff in to the machine, I'm 
going to have to do a bunch of hand work to figure out what ports map to 
what devices at the moment.

-- 
Tim Wescott
Wescott Design Services
Voice: 503-631-7815
Cell:  503-349-8432
http://www.wescottdesign.com





More information about the PLUG mailing list