[PLUG] USB Serial Port Adapters

Tim Wescott tim at wescottdesign.com
Mon Jun 20 20:33:13 UTC 2011


Thanks.  This is exactly the guidance I was looking for.  My preferred 
terminal program doesn't seem to understand links to devices, but I'll cope.

On 06/18/2011 09:49 AM, Jason Barnett wrote:
> Here is a link that gives an example of this exact situation.  The example
> shows using a FTDI chip and having the UDEV rule compare against the serial
> number of the device so it should work for specific devices.
>
> https://wiki.archlinux.org/index.php/Bus_pirate
>
> Jason
>
> On Fri, Jun 17, 2011 at 8:45 PM, Fred James<fredjame at fredjame.cnc.net>wrote:
>
>> Jackman wrote:
>>> Why can't udev rules be applied here?
>>>
>>> On Fri, Jun 17, 2011 at 6:48 PM, Fred James<fredjame at fredjame.cnc.net>
>> wrote:
>>>> Tim Wescott wrote:
>>>>
>>>>> (omissions for brevity)
>>>>>    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
>>>> Thought 1:  If you can use CLI (command line interface) to determine
>>>> what you need to know, then a (BASH) script can be written to do that.
>>>> Thought 2:  If a device can be identified (example: ttyUSB1 is the
>>>> debugger), then it can be mounted to a directory (example: ~/debugger)
>>>> Thought 3:  If 1 and if 2, then the two can be written together in a
>> script.
>>>> Does any of that help?
>>>> Regards
>>>> Fred James
>>>>
>> Jackman
>> According to<http://reactivated.net/writing_udev_rules.html#about>, it
>> can ...
>> "
>>
>> udev rules are flexible and very powerful. Here are some of the things
>> you can use rules to achieve:
>>
>>     * Rename a device node from the default name to something else
>>     * Provide an alternative/persistent name for a device node by
>>       creating a symbolic link to the default device node
>>     * Name a device node based on the output of a program
>>     * Change permissions and ownership of a device node
>>     * Launch a script when a device node is created or deleted
>>       (typically when a device is attached or unplugged)
>>     * Rename network interfaces
>>
>> "
>> Regards
>> Fred James
>>
>> _______________________________________________
>> PLUG mailing list
>> PLUG at lists.pdxlinux.org
>> http://lists.pdxlinux.org/mailman/listinfo/plug
>>
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>


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





More information about the PLUG mailing list