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  2019  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  2019 
<== Date ==> <== Thread ==>

Subject: RE: Linux USB serial questions
From: "Jim Chen" <jim.chen@hytec-electronics.co.uk>
To: "'Andrew Gomella'" <andrewgomella@gmail.com>, "'J. Lewis Muir'" <jlmuir@imca-cat.org>
Cc: tech-talk@aps.anl.gov
Date: Fri, 19 Apr 2013 11:05:48 +0100

Mark and Andrew,

 

Guy is correct. Yet Mark’s case is slight different from Andrew’s.

 

As Guy mentioned, ftdi_sio has the capability of adding ONE extra unlisted vendor device (the developer was farsighted but not generous enough). That's why you can still load the driver and use it for one of the Newport devices although it is not listed before version 3.8. But you can only load one type at a time as you experienced unless you rebuild the module by adding the vendor:product pairs in. Alternatively you need to use 3.8 which already has the 104d:3000 built in and then add the other one (104d:3006) by using modprobe.

 

In Andrew’s case, it could be much easier since you have the same type of devices. Each device should have a unique serial number (can be found out by command below) especially for massive production although this is not mandatory by the spec. The installation guide for your reference is illustrated below.

 

The kernel you are using I think you meant 3.6.32. That’s fine.

 

1. use modprobe to register the Newport device as Mark did after Linux boot. You can literally put this in the startup script (.bash_profile for Redhat for e.g) so that it loads it during the boot time.

 

sudo modprobe ftdi_sio vendor=0x104d product=0x3006

 

Once the driver is loaded, any device plugged in will be identified and added a node as /dev/ttyUSB*. Yet this ttyUSB* is not you are going to use. Use the symbolic link defined in the rules’ file later.

 

2. now plug in one of those devices (one at a time) and issue command

 

                […]# lsusb -v -d104d: 3006

 

This will list all the descriptors of that device. Looking for iSerial or iSerialNumber. Its value has two parts. The first number is the index of the string descriptors for the serial number. The second part is the serial number itself, say XXXXX01

 

3. build a rules’ file similar to what Mark did, 81-Agilis.rules for e.g. in folder /etc/udev/rules.d and add one entry something like:

 

SUBSYSTEM=="tty", ATTRS{idVendor}=="104d", ATTRS{idProduct}=="3006", ATTRS{serial}==" XXXXX01", SYMLINK+="myusb01"

 

The last SYMLINK ‘myusb01’ is the one you are going to use by drvAsynSerialPortConfigure or minicom. This symbolic link will persist whatever you unplug/plugin or in different slot.

 

4. unplug the first device and plug in the second one and repeat 2,3,4 until all 18 devices have been added to the rules.

 

Next time when boot or any time when you plug in, it should populate all devices as you defined.  

 

If the manufacturer DIDN’T put a serial number for each device, that could be awkward. The only way is as Guy suggested: plugin all of them and don’t change. This will certainly have lots of maintenance issues.

 

HTH.

Jim

 

 

 

From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-bounces@aps.anl.gov] On Behalf Of Andrew Gomella
Sent: 19 April 2013 00:41
To: J. Lewis Muir
Cc: tech-talk@aps.anl.gov Talk
Subject: Re: Linux USB serial questions

 

Thanks all for the help with figuring this out. 

 

I should be able to actually test having multiple devices attached to one Linux system within the next few days. I do believe all of our devices will be the 3006 variety.

 

To answer Andrew (Johnson)'s question, it seems it does provide a serial number attribute. When I run the "usb-devices" command I see a serial number show up for the controller. So I guess it will be feasible to have a persistent device mapping to each controller. 

 

For the record I am currently testing with kernel 3.2.32 

 

Andrew Gomella

 

 

On Thu, Apr 18, 2013 at 6:20 PM, J. Lewis Muir <jlmuir@imca-cat.org> wrote:

On 4/18/13 5:07 PM, Mark Rivers wrote:
> Yes, it does work for me to use modprobe with the 3006 device.  I can use either the 3000 or 3006, but not both at the same time.
>
> But if he wanted to use a mix of the 3000 and 3006 devices it would not work?

Hopefully Guy will chime in, but, without modifying the kernel, I think
a mix would require a 3.8 kernel (or newer) since the kernel would know
about the 0x104D vendor and the 0x3000 product, but would not know about
the 0x3006 product.  You could use the one available vendor-product
modprobe pair to tell the ftdi_sio module about the 0x3006 product it
doesn't know about, thus achieving the desired result of the kernel
knowing about the 0x3000 and 0x3006 devices.

Or, you could modify the kernel to tell it about the vendor and product
IDs, and then a mix should work, again assuming the ftdi_sio module at
least knows about the chip type.

Lewis

 


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

Navigate by Date:
Prev: Re: autosave limitation? Tim Mooney
Next: Calling ca_context_create(1) too late michael.abbott
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  2019 
Navigate by Thread:
Prev: Re: Linux USB serial questions Andrew Gomella
Next: Re: Linux USB serial questions Andrew Johnson
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  2019 
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 ·