Hi Martin,

On Thu, Aug 10, 2017 at 03:22:19PM +0200, Martin Patzak (GMX) wrote:

[...]

> Only so much, the working rule now looks like (at the moment, might change
> soon ;-) ):
> 
>     SUBSYSTEMS=="usb", DRIVERS=="usb", ATTRS{manufacturer}=="FTDI",
> ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A800bXHr", GROUP="owsrv",
> MODE="0664"
> 
> This rule results in a node residing in /dev/bus/usb/<n>/<m> which is read
> and writeable by the group owsrv , in my case it looks at the moment like
> 
> /    ls -al /dev/bus/usb/003///
> //    ...//
> //    crw-rw-r-- 1 root owsrv 189, 261 Aug 10 15:07 006/
> 
> owserver then accessess this node without sudo, in ftdi addressing scheme to
> use direct communication.
> 
> 
> BUT more good news, and contrary to my previous statement: "One 'S' too
> little can make or brake the rule...", it DOES work without all the S's too!
> 
>     SUBSYSTEM=="usb", DRIVER=="usb", ATTR{manufacturer}=="FTDI",
> ATTR{product}=="FT232R USB UART", ATTR{serial}=="A800bXHr", GROUP="owsrv",
> MODE="0664"

A small enhancement that you can add and use is to have udevd create
a predictable symlink for the device. This way if you plug in more
USB devices, or plug things in a different order so they get assigned
the same /dev/ node that your LinkUSB currently has, your owserver or
whatever programs use your LinkUSB will still be able to find it.

As an example, here's what I have on my
/etc/udev/rules.d/50-local-usb-serial.rules file:

----------------------------------------------------------------------
#
# From 
http://marc.merlins.org/perso/linuxha/2010-06.html#Dealing-with-many-USB-to-Serial-Port-Converters-on-linux-and-device-naming
#
# After making a change 'udevadm trigger' will update symlinks.
#

# http://www.reactivated.net/writing_udev_rules.html#udevinfo
# was udevinfo -a -p /class/tty/ttyUSB0
# now udevadm info --attribute-walk -p /class/tty/ttyUSB0
# (used to determine product ID, serial number, etc. to be used
# in the declarations below)

SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", 
ATTRS{serial}=="A5008b6u", SYMLINK+="plm"
SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", 
ATTRS{serial}=="A400bXjP", SYMLINK+="1wire-master0"
SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", 
ATTRS{serial}=="A800eIPR", SYMLINK+="1wire-master1"
SUBSYSTEMS=="usb", ATTRS{product}=="FT231X USB UART", 
ATTRS{serial}=="DC00HJ03", SYMLINK+="moteino-usb"
----------------------------------------------------------------------

These rules will create the symlinks /dev/plm, /dev/1wire-master0,
/dev/1wire-master1, and /dev/moteino-usb for the FTDI serial-to-USB
chips with those serial numbers. Applications (like owserver) then
use the symlinks instead of the actual /dev/bus/usb/<n>/<m> path. For
example, my /etc/owfs.conf contains this:

server: device = /dev/1wire-master0

Cheers,

Eloy Paris.-


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to