Skip to content

Commit

Permalink
added family to LINK to clearify LINK in the scope of the manual is N…
Browse files Browse the repository at this point in the history
…OT LinkUSB

added sidenotes in the FTDI section

added in beginning of section serial devices that ftdi addressing may be used in any of the serial options as port

added some examples of FTDI addressing

removed "a sidenote" from the two sidenotes, looks weird, so begone...

put the examples in FTDI section to the end

added owusbprobe as a tool to find FTDI related infos in FTDI section

serial number

changed 'serial' into 'serial number' to remove ambiguity with 'serial', the protocol
changed 'serial-number' to 'serial number' since it turns out, I was wrong there is not ever a hyphen in serial number
changed 'SerNo' to 'S/N' for serial number in its abbreviated form

since the serial number is a unique identifier, it will connect to the device with that serial number and not the first device with that serial number ;)

will change this once more...

more info on using lsub to find raw device node

added info for running owserver without superuser privileges using FTDI addressing
  • Loading branch information
agentmnm committed Dec 12, 2017
1 parent 2ba6989 commit 19a3c8e
Showing 1 changed file with 51 additions and 18 deletions.
69 changes: 51 additions & 18 deletions src/man/man1/device.1so
Expand Up @@ -5,7 +5,7 @@
'\" Program manual page for the OWFS -- 1-wire filesystem package
'\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error.
'\"
'\" Free for all use. No waranty. None. Use at your own risk.
'\" Free for all use. No warranty. None. Use at your own risk.
'\" $Id$
'\"
.SH "Device Options (1-wire Bus Master)"
Expand All @@ -19,15 +19,16 @@ Linux and BSD enforce a security policy restricting access to hardware ports. Yo
.I port
specifies a serial port, e.g.
.I /dev/ttyS0
or an USB port accessed as serial port, e.g. \fI/dev/ttyUSB0\fR
.P
If OWFS was built with \fBlibftdi\fR support, you may be able to use the
.I ftdi:
prefix to address a FTDI-based USB device.
prefix in any of the options as \fIport\fR to address a FTDI-based USB device.
.br
For details, see the FTDI ADDRESSING section.
.TP
\fI-d port\fI \fR|\fR \fI--device=port\fI \fB(DS2480B)\fB
DS2480B-based bus master (like the DS9097U or the LINK in emulation mode). If the adapter doesn't respond, a passive type (DS9907E or diode/resistor) circuit will be assumed.
DS2480B-based bus master (like the \fBDS9097U\fR or an adapter of the \fBLINK\fR family in emulation mode). If the adapter doesn't respond, a passive type (DS9907E or diode/resistor) circuit will be assumed.
.TP
.I --serial_flextime | --serial_regulartime \fB(DS2480B)\fB
.br
Expand All @@ -37,17 +38,17 @@ cannot work with
.I flextime.
.TP
\fI--baud=\fI\fR1200|9600|19200|38400|57600|115200\fR \fB(DS2480B,LINK,HA5)\fB
Sets the initial serial port communication speed for all bus masters. Not all serial devices support all speeds. You can change the individual bus master speed for the
Sets the initial serial port communication speed for all bus masters. Not all serial devices support all speeds. You can change the individual bus master speed for a device of the
.B LINK
and
family and
.B DS2880B
in the interface/settings directory. The
.B HA5
speed is set in hardware, so the command line buad rate should match that rate.
speed is set in hardware, so the command line baud rate should match that rate.
.br
Usually the default settings (9600 for
Usually the default settings (9600 for a device of the
.B LINK
and
family and
.B DS2480B
) and 115200 for the
.B HA5
Expand All @@ -61,7 +62,7 @@ Reverse polarity of the DS2480B output transistors? Not needed for the DS9097U,
.I LINK
adapter (all versions) in non-emulation mode. Uses an ascii protocol over serial.
.br
This supports the simplified \fIftdi:\fB<serial>\fR addressing scheme.
This supports the simplified \fIftdi:\fB<serial number>\fR addressing scheme.
.TP
\fI--ha7e=port\fI \fB(HA7E)\fB
.B Embedded Data Systems
Expand Down Expand Up @@ -98,7 +99,7 @@ There are also bus masters based on the serial chip with a USB to serial convers
DS2490 based bus master (like the DS9490R).
.TP
.I \-u2 \fR|\ \fI\-\-usb=2
Use the second USB bus master. (The order isn't predicatble, however, since the operating system does not conssitently order USB devices).
Use the second USB bus master. (The order isn't predicatble, however, since the operating system does not consistently order USB devices).
.TP
.I \-uall \fR|\ \fI\-\-usb=ALL
Use all the USB devices.
Expand Down Expand Up @@ -229,13 +230,15 @@ Timeout for w1 netlink communications. This has a 10 second default and can be c
FTDI is a brand of USB-to-serial chips which are very common. If your serial device is connected via a USB serial dongle based on a FTDI chip, or if your
adapter uses a built-in FTDI USB chip (for example, the LinkUSB), you can use this FTDI addressing.
.P
The main benifit with this mode of access is that we can decrease the communication delay, yielding twice as fast 1-Wire communication in many cases.
The main benefit with this mode of access is that we can decrease the communication delay, yielding twice as fast 1-Wire communication in many cases.
.P
The following values for \fIport\fR can be used to identify a specific FTDI port. Note that this requires that OWFS is built with libftdi support.
The following values for \fIport\fR can be used to identify a specific FTDI port in several of the serial devices options.
.br
Note that this requires that OWFS is built with libftdi support, which might not be the case in standard repositories.
.TP
\fIftdi:d:\fB<devicenode>\fB
\fIftdi:d:\fB<device-node>\fB
path of bus and device-node (e.g. "003/001") within usb device tree
(usually at /proc/bus/usb/)
(usually at /proc/bus/usb/ or /dev/bus/usb/)
.TP
\fIftdi:i:\fI\fB<vendor>:<product>\fB
first device with given vendor and product id, ids can be decimal, octal
Expand All @@ -245,15 +248,45 @@ first device with given vendor and product id, ids can be decimal, octal
as above with index being the number of the device (starting with 0)
if there are more than one
.TP
\fIftdi:s:\fI\fB<vendor>:<product>:<serial>\fB
first device with given vendor id, product id and serial string
\fIftdi:s:\fI\fB<vendor>:<product>:<serial number>\fB
the device with given vendor id, product id and serial number string
.P
The above formats are parsed fully by libftdi (minus the \fIftdi:\fR prefix).
.SS Simplified device \fBserial-only\fB support
An additional format is supported, for certain bus types. This only specifies the USB serial number.
.TP
\fIftdi:\fI\fB<serial>\fB
Identifies a FTDI device by serial only.
\fIftdi:\fI\fB<serial number>\fB
Identifies a FTDI device by serial number only.
Currently, this is only valid for the VID/PID found on the LinkUSB (i.e. --link).
Note that those VID/PID's are the default for any FT232R device, and in no way exclusive
to LinkUSB.
.SS Permsissions
In order to run \fBowserver (1)\fR without root privileges - as you should, you must have sufficient permissions to the raw USB node your adapter is connected to e.g. "003/001" (usually at /proc/bus/usb/ or /dev/bus/usb/).
.P
An easy way to achieve this would be using \fBchown (1)\fR:
.TP
\fBsudo chown :<your user> /dev/bus/usb/003/001
changes the group of the raw USB node "003/001" from default "root" to "<your user>"
.P
You can also write a \fBudev (1)\fR rule for your adapter:
.TP
\fBSUBSYSTEM=="usb", DRIVER=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", ATTR{serial}=="AK0048A0", GROUP="owsrv"\fR
saved as a file e.g. "10-FTDI-LinkUSB.rules" in "/etc/udev/rules.d/", this rule will automate the process of changing the group to "owsrv" of the raw USB node the LinkUSB adapter with S/N:AK0048A0 is connected to.
.SS Serial USB node
Communication in FTDI mode accesses the RAW USB node and NOT the serial USB node your OS might have created automatically e.g. /dev/ttyUSB0.
.br
As a side effect, if existing, the serial USB node e.g. /dev/ttyUSB0 is removed on successful starting of \fBowserver (1)\fR. After it's termination un- and re-plugging the adapter, or un- and reloading of the module ftdi_sio will recreate the serial USB node.
.SS Finding FTDI related information on your USB adapter
\fBowusbprobe\fR is THE tool to find the information needed for direct FTDI addressing
.br
However this tool might not yet be packaged in your version. Alternatively you can also use lsusb to find the usb node your adapter is connected to, and then use lsusb again on this very node:
.TP
\fBsudo lsusb -D /path/to/your/raw/USB/device/node |egrep "idVendor|idProduct|iSerial"
sudo is necessary to get the value of iSerial field, if the permissions are still unchanged
.SS Examples FTDI addressing
.TP
\fBowserver -d ftdi:s:0x0403:0x6001:A800bXHr\fR
starts owserver with a LinkUSB (VID:0x0403,PID:0x6001,S/N:A800bXHr) as bus master in DS2480B-based emulation mode with direct FTDI access
.TP
\fBowserver --link=ftdi:A800bXHr\fR
starts owserver with a LinkUSB (S/N:A800bXHr) as bus master identified by serial number only in native mode with direct FTDI access

0 comments on commit 19a3c8e

Please sign in to comment.