Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018 
<== Date ==> <== Thread ==>

Subject: RE: Linux USB serial questions
From: Mark Rivers <rivers@cars.uchicago.edu>
To: "J. Lewis Muir" <jlmuir@imca-cat.org>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Thu, 18 Apr 2013 20:15:03 +0000
> With no /dev/ttyUSB* device files, what happens if the second device is
> plugged in first?  

Without unplugging the devices I can unload the driver

Colorado:motor/iocBoot/iocWithAsyn>sudo modprobe -r -v ftdi_sio
rmmod /lib/modules/2.6.35.10-74.fc14.x86_64/kernel/drivers/usb/serial/ftdi_sio.ko
rmmod /lib/modules/2.6.35.10-74.fc14.x86_64/kernel/drivers/usb/serial/usbserial.ko

At this point there are no /dev/ttyUSB devices:
Colorado:motor/iocBoot/iocWithAsyn>ls -l /dev/ttyUSB*
ls: No match.

Now I load the driver for model 3006
Colorado:motor/iocBoot/iocWithAsyn>sudo modprobe -v ftdi_sio vendor=0x104d product=0x3006 debug
insmod /lib/modules/2.6.35.10-74.fc14.x86_64/kernel/drivers/usb/serial/usbserial.ko 
insmod /lib/modules/2.6.35.10-74.fc14.x86_64/kernel/drivers/usb/serial/ftdi_sio.ko vendor=0x104d product=0x3006 debug

It works, and ttyUSB0 exists:
Colorado:motor/iocBoot/iocWithAsyn>ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Apr 18 15:09 /dev/ttyUSB0

Now I unload the driver again:
Colorado:motor/iocBoot/iocWithAsyn>sudo modprobe -r -v ftdi_sio
rmmod /lib/modules/2.6.35.10-74.fc14.x86_64/kernel/drivers/usb/serial/ftdi_sio.ko
rmmod /lib/modules/2.6.35.10-74.fc14.x86_64/kernel/drivers/usb/serial/usbserial.ko

No /dev/ttyUSB devices:
Colorado:motor/iocBoot/iocWithAsyn>ls -l /dev/ttyUSB*
ls: No match.

Now I load the driver but for model 3000 this time:
Colorado:motor/iocBoot/iocWithAsyn>sudo modprobe -v ftdi_sio vendor=0x104d product=0x3000 debug
insmod /lib/modules/2.6.35.10-74.fc14.x86_64/kernel/drivers/usb/serial/usbserial.ko 
insmod /lib/modules/2.6.35.10-74.fc14.x86_64/kernel/drivers/usb/serial/ftdi_sio.ko vendor=0x104d product=0x3000 debug
Colorado:motor/iocBoot/iocWithAsyn>ls -l /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Apr 18 15:09 /dev/ttyUSB0

So it works.  But I don't know how to also have it recognize the second device.  As Andrew said, loading the driver again does nothing:
Colorado:motor/iocBoot/iocWithAsyn>sudo modprobe -v ftdi_sio vendor=0x104d product=0x3006 debug
Colorado:motor/iocBoot/iocWithAsyn>ls -l /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Apr 18 15:09 /dev/ttyUSB0

I'll look into udev.

Thanks,
Mark


________________________________________
From: J. Lewis Muir [jlmuir@imca-cat.org]
Sent: Thursday, April 18, 2013 2:17 PM
To: Mark Rivers
Cc: tech-talk@aps.anl.gov
Subject: Re: Linux USB serial questions

On 4/18/13 1:21 PM, Mark Rivers wrote:
> Thanks for all the replies I've received so far.  I am still reading and understanding them.
>
> But now I have a more fundamental question, there is something I am not understanding about modprobe I think.
>
> I now have 2 different USB ftdi_sio devices.  Both are manufactured by Newport but they are different models.
>
> This is what lsusb shows for these devices:
>
> Colorado:motor/iocBoot/iocWithAsyn>/usr/sbin/lsusb
> Bus 004 Device 007: ID 104d:3006 Newport Corporation
> Bus 002 Device 004: ID 104d:3000 Newport Corporation
>
> Initially I plugged in the device with model=3006.  I then did modprobe to load the ftdi_sio driver for that vendor and model, and it created /dev/ttyUSB0.  It works fine, I can control it with no problems.
>
> Now I plugged in the second device with model=3000, leaving the first device also plugged in.  The new device shows up with lsusb, as seen above.  However, it did not create a /dev/ttyUSBn for that device.
>
> I then tried to run modprobe for the new device:
>
>> sudo modprobe ftdi_sio vendor=0x104d product=0x3000
>
> There is no error message.  However, it did not create a new /dev/ttyUSBn device:
>
>> ls -l /dev/ttyUSB*
> crw-rw-rw- 1 root dialout 188, 0 Apr 18 13:10 /dev/ttyUSB0
>
> There is still only device ttyUSB0, not a new ttyUSB1.
>
> What am I doing wrong?

Hi, Mark.

With no /dev/ttyUSB* device files, what happens if the second device is
plugged in first?  Does it get assigned /dev/ttyUSB0?

Another thing to try would be to add the "debug" keyword to the end of
the modprobe command, and see if you get anything helpful in dmesg (or a
log file).

Lewis


Replies:
Re: Linux USB serial questions Jennings Guy
Re: Linux USB serial questions J. Lewis Muir
References:
Linux USB serial questions Mark Rivers
RE: Linux USB serial questions Mark Rivers
Re: Linux USB serial questions J. Lewis Muir

Navigate by Date:
Prev: Re: Linux USB serial questions Andrew Johnson
Next: Re: Linux USB serial questions Jennings Guy
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018 
Navigate by Thread:
Prev: Re: Linux USB serial questions J. Lewis Muir
Next: Re: Linux USB serial questions Jennings Guy
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·