[GTALUG] Problem with /dev/ttyUSB* serial port

Jim Ruxton jim.ruxton at gmail.com
Thu Oct 31 09:10:19 EDT 2019


Thanks. I tried /dev/serial/by-id and although my python program looks 
like it should work  ie. it accepts

serial_connection = 
Connection(port="/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AL03EO23-if00-port0", 
baudrate=57142)

Its not sending out serial data. This is the same result if I have to 
use /dev/ttyUSB1 . For some reason my python program only works when 
using /dev/ttyUSB0 . For this reason I am not sure if adding a udev rule 
will work though I will give it a try.  If the device shows up as 
/dev/ttyUSB1 and I rename it to /dev/ttyUSB0 this works but then I need 
to remove it manually when unplugging it. I also tried waiting a long 
time between unplugging and plugging the usb device but /dev/ttyUSB0 is 
not restored. It's a strange problem. I am wondering if it has to do 
with the baud rate I am using , maybe /dev/ttyUSB0 works with 
baudrate=57142 but /dev/ttyUSB1 doesn't in python?

Jim

On 2019-10-31 8:16 a.m., Alvin Starr via talk wrote:
> On 10/31/19 2:25 AM, Jim Ruxton via talk wrote:
>> I have a device plugged into an active USB extender that usually 
>> shows up as /dev/ttyUSB0 when I first plug it in (occasionally it 
>> will show up as /dev/ttyUSB1 when first plugging it in) . If it is 
>> /dev/ttyUSB0 when I unplug it and plug it back in it occasionally 
>> changes to /dev/ttyUSB1 . Is there a way that I can always have it 
>> show up as /dev/ttyUSB0 . I'm not sure why /dev/ttyUSB0 isn't being 
>> released and restarted after unplugging and replugging it. If I look 
>> in /dev it does disappear as /dev/ttyUSB0 from there when I unplug it 
>> but like I said it reappears as /dev/ttyUSB1? I am on Ubuntu 18.04.3 
>> LTS .
>>
>> Thanks for any pointers.
>
> Thinking on this some more.
> You could try using /dev/serial/by-path or /dev/serial/by-id
> "ls /dev/serial/by-path/" -> pci-0000:00:12.2-usb-0:3.5:1.0-port0
> "ls /dev/serial/by-id" -> 
> usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
>
> These should stay device and connection tree uinque
>


More information about the talk mailing list