libftdi Archives

Subject: Re: open from device string

From: Ryan Tennill <rtennill@xxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 10 Jun 2014 10:37:35 -0500




On Tue, 2014-06-10 at 14:19 +0000, Axelrod, Ben wrote:
I see a number of functions to open the ftdi interface based on various things.  How would I go about opening the ftdi interface based on a user input string such as “/dev/ttyUSB0” or similar alias?  I only need to do this on Linux, specifically Ubuntu. 

 

If I can’t do this directly through the ftdi interface, what is the easiest way to use other tools to convert “/dev/ttyUSB0” into “0403:6001” through code?

 

Thanks,

Ben

 

Ben Axelrod

Sr. Robotics Software Engineer

iRobot Corporation

8 Crosby Drive, M/S 8-1

Bedford, MA 01730

(781) 430-3315

baxelrod@xxxxxxxxxx

 







libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx



If it's available on your system I would actually recommend /dev/serial/by-id:


$ tree /dev/serial/by-id/
/dev/serial/by-id/
├── usb-FTDI_FT232R_USB_UART_A101E3RD-if00-port0 -> ../../ttyUSB4
├── usb-FTDI_FT232R_USB_UART_AM01MJHY-if00-port0 -> ../../ttyUSB2
├── usb-FTDI_FT232R_USB_UART_AM01MJJ0-if00-port0 -> ../../ttyUSB1
├── usb-FTDI_FT232R_USB_UART_AM01MJJ5-if00-port0 -> ../../ttyUSB3
└── usb-FTDI_FT232R_USB_UART_AM01MJJ7-if00-port0 -> ../../ttyUSB0

Ryan

Distant Focus Corporation
Champaign, IL 61822
217-351-2655 x126
http://distantfocus.com/projects/


libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx


Current Thread