EPICS Controls 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  2020  2021  2022  2023  2024  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  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: AW: Linux USB serial questions
From: "Zumbruch, Peter Dr." <[email protected]>
To: Mark Rivers <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Thu, 18 Apr 2013 11:35:00 +0000

Dear Mark,

just for info.

That’s how we connect several usb devices to an openSuse system

 

http://wiki.gsi.de/Epics/TippsUsbDevDynamicDevSymLinkAndProperAccessRights

 

HTH.

Peter

Dr. rer. nat. Peter W. Zumbruch
EE - department / Controls group
E-Mail: [email protected]
Tel: +49-(6159)-71-1435 / Fax: +49-(6159)-71-2986

GSI Helmholtzzentrum für Schwerionenforschung GmbH

Planckstraße 1 / 64291 Darmstadt / www.gsi.de

Gesellschaft mit beschränkter Haftung

 

Sitz der Gesellschaft: Darmstadt

Handelsregister: Amtsgericht Darmstadt, HRB 1528

Geschäftsführung: Professor Dr. Dr. h.c. mult. Horst Stöcker, Peter Hassenbach

 

Vorsitzende des Aufsichtsrates: Dr. Beatrix Vierkorn-Rudolph

Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt

 

Von: [email protected] [mailto:[email protected]] Im Auftrag von Eric Norum
Gesendet: Mittwoch, 17. April 2013 18:02
An: Mark Rivers
Cc: [email protected]
Betreff: Re: Linux USB serial questions

 

Here's what I have for an FPGA programming dongle.  It runs the script RUN whenever the device is connected (since ACTION="">

 

ATTRS{idVendor}=="1443", MODE="666"

ACTION="" ATTRS{idVendor}=="0403", ATTRS{manufacturer}=="Digilent", MODE="666", RUN+="/usr/local/sbin/dftdrvdtch %s{busnum} %s{devnum}"

 

 

You can have  ATTRS{serial}=="xxxxxxxxx" qualifiers in rules to perform actions for a particular device.  Here's an example I found on the net for a printer:

SUBSYSTEM=="usb", ATTRS{serial}=="L72010011070626380", SYMLINK+="epson_680"

 

Here's the page with the above example -- I found it very helpful

         

 

 

On Apr 17, 2013, at 8:22 AM, Mark Rivers <[email protected]> wrote:



Folks,

I have a couple of questions about how to automatically set up USB serial devices on Linux.  I have a Newport motor controller which is a USB device, but is actually a "serial" device.  I can configure it fine on Linux by plugging it in and executing the following 2 commands as root:

modprobe ftdi_sio vendor=0x104d product=0x3000
chmod o+rw /dev/ttyUSB0

The first command loads the ftdi_sio driver with the vendor and product codes for this device.  Those codes can be determined from the lsusb command:

Colorado:motor/iocBoot/iocWithAsyn>/usr/sbin/lsusb
Bus 002 Device 003: ID 104d:3000 Newport Corporation

The second command sets the permissions on the device so any user can read and write it.

After doing those commands my EPICS IOC can access the device, set the baud rate, data bits, stop bits, etc.  I now have a motor record driver to talk to it.

My question is how to have those 2 commands executed automatically so I don't need to manually do it.  My first thought was to create a udev entry for the device.  I created the following file and put it in /etc/udev/rules.d

Colorado:motor/iocBoot/iocWithAsyn>more ~/81-Agilis.rules
SYSFS{idVendor}=="104d", ATTRS{idProduct}=="3000", MODE="0666"

If this file is present after the Linux system is booted and after I have issued the "modprobe" command then it works correctly.  Each time I unplug the device /dev/ttyUSB0 disappears, and each time I plug it in it reappears with the correct permissions.  If the udev file is not present then when I plug it in the device is missing read/write permission for others.

However, if that udev file is present when the system boots, before I issue the "modprobe" command then the "modprobe" command does not work in the sense that no /dev/ttyUSBn device appears.  I think this could be because the udev file is causing some other driver to load, and so it won't load the ftdi_sio driver.  Is there a way to specify which driver to load in the udev file?

Does anyone know how to do this?

I have a related question.  An EPICS user at NIH has 18 of these devices which he wants to use at the same time.  Is there a way to assign a specific device (based upon its serial number for example) to a  specific /dev/ttyUSBn port?  If not,  how does one figure out which motor is connected to which /dev/ttyUSBn port?

Thanks,
Mark


 

-- 
Eric Norum
[email protected]




 


References:
Linux USB serial questions Mark Rivers
Re: Linux USB serial questions Eric Norum

Navigate by Date:
Prev: Re: Linux USB serial questions Jeong Han Lee
Next: RE: asynAddress, asynPortDriver maxAddr, and addr in setXXXParam Emmanuel Mayssat
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  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Linux USB serial questions Eric Norum
Next: RE: Linux USB serial questions Mark Rivers
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  2020  2021  2022  2023  2024 
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 ·