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: Jennings Guy <jennings@anl.gov>
To: Mark Rivers <rivers@cars.uchicago.edu>
Cc: tech-talk@aps.anl.gov
Date: Thu, 18 Apr 2013 15:46:44 -0500
I see that you are using kernel 2.6.35.10…

Kernel 3.8 has the apropriate constants defined in the ftdi driver (at least for the 0x3000 device)

http://lxr.free-electrons.com/ident?i=NEWPORT_VID

and

http://lxr.free-electrons.com/ident?i=NEWPORT_AGILIS_PID

so your 0x3000 device should work out of the box there.  Additionally, you can
pass ONE additional vendor:product id pair to the ftdi_sio module when it loads
so you could recognise both devices.  This should enable the ftdi_sio module to
recognise both devices at the same time.  Note that the thing you load with modprobe
is a 'module', not a driver, and you can only have one instance of it loaded at a time.

The longer term solution would be to get the second device ID into the linux kernel
sources. This article

http://www.sealevel.com/support/article/AA-00524/0/How-to-configure-USB-serial-adapters-in-Linux.html

(written for a different manufacturers product) gives a reasonable level of detail for
what needs to be done.

You can then use udev rules to match serial numbers to device nodes.

Hope this is helpful

Guy Jennings

On Apr 18, 2013, at 3:15 PM, Mark Rivers <rivers@cars.uchicago.edu> wrote:

>> 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
References:
Linux USB serial questions Mark Rivers
RE: Linux USB serial questions Mark Rivers
Re: Linux USB serial questions J. Lewis Muir
RE: Linux USB serial questions Mark Rivers

Navigate by Date:
Prev: RE: Linux USB serial questions Mark Rivers
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 Mark Rivers
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 ·