sorry, forgot to hit 'reply all'...

-------- Forwarded Message --------
Subject: Re: [Owfs-developers] Problem starting owserver on a LinkUSB with option ftdi addressing without sudo
Date:   Thu, 10 Aug 2017 19:01:07 +0200
From:   Martin Patzak (GMX) <martin.pat...@gmx.de>
To:     Eloy Paris <pe...@chapus.net>





On 10.08.2017 18:06, Eloy Paris wrote:
Hi Martin,

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

[...]


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:

----------------------------------------------------------------------
#
# 
Fromhttp://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.-
Hello Eloy,

thanks for your suggestion. I had a rule just like yours, but it was linked to the usb-serial device /dev/ttyUSB<n> and not /dev/bus/usb/<n>/<m>.
Can you please check, where your symlink actually points to?

But regardless, I recently learned, that in order to get direct ftdi communication in owserver, on has to address the device in a special way: ftdi:..., in my case, a LinkUSB, it looks like:

/owserver --link=ftdi:s:0x0403:0x6001:A800bXHr/

so i cannot use a symlink as address. But this way of addressing is also unique, because the serial number is also given, when using the option 's:' (for serial number)

If you address the serial usb device, you only get native serial communication, like so

/owserver --link=/dev/ttyUSB<n>

/this is what I did in the beginning, and here you could use your symlink, but you won't get the speed advantage of direct communication, as Johan explained to me.

My problem then was, that I could only start owserver in direct communication mode, when I used 'sudo'. I did not know which node I have change the permission on in order to get owserver started. Matthias pointed out, that I have to talk to the raw usb device, which I then found resides in /dev/bus/usb/<n>/<m>, which is created by udev. Well there is a corresponding raw device created by SYSFS in /sys/platform/bla/bla/bla/deep/down/there, which also Matthias pointed out, but you don't have to bother with that.

Cheers,

Martin
------------------------------------------------------------------------------
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