OWFTPD(1)
okay so bestie π welcome to the owftpd page β that's OWFTPD(1), the One-Wire File System's anonymous FTP server, and yes it's a whole saga. Grab a snack, we're doing this in parts. π
π NAME π
owftpd β Anoymous FTP server for 1-wire access
not me leaving the typo exactly as written because it's in the source, it's canon, it's heritage π
π SYNOPSIS π
owftpd [ -c config ] -d serialport | -u | -s [host:]port [ -p host:tcp-port ]
β¨ DESCRIPTION β¨
π¦ 1-Wire π¦
So, 1-wire is a wiring protocol and a whole family of devices, designed and manufactured by Dallas Semiconductor, Inc. π The bus itself is low-power, low-speed, and low-connector β and the slay of it is that the data line also provides power. One wire doing two jobs? main character energy fr. π
Every single device gets uniquely and unalterably numbered during manufacture. You do not get to change it. It's her number, it's forever. π
The device lineup is wide: memory, sensors (humidity, temperature, voltage, contact, current), switches, timers, and data loggers. And if that's not enough, you can build more complex devices β like thermocouple sensors β out of these basic ones. There are also 1-wire devices with encryption baked in π.
The scheme is one bus master and multiple slaves on the same wire. The bus master initiates all communication β no side conversations. The slaves get individually discovered and addressed using their unique ID. π«Ά
Bus masters come in a bunch of different configurations, including serial, parallel, i2c, network or USB adapters.
πΈ OWFS design πΈ
OWFS is a suite of programs designed to make the 1-wire bus and its devices easily accessible. The underlying principle: build a virtual filesystem, where the unique ID is the directory, and each individual property of the device is a simple file you can read and write. πβ¨
All the messy details of the individual slave or master design stay hidden behind a consistent interface. The goal is to hand a software designer an easy set of tools for building monitoring or control applications. There are performance enhancements in the implementation too β data caching, parallel access to bus masters, and aggregation of device communication. But the fundamental goal has always been ease of use, flexibility and correctness, rather than speed. βοΈ
π owftpd π
owhttpd (1) is an anonymous ftp (file-transfer-protocol) server that shows the Dallas/Maxim 1-Wire bus attached to a computer. The main directory shows the devices found, and you can then navigate to individual devices, view and set their properties.
owftpd (1) uses the same naming convention as owfs (1) and owhppt (1), where the URL corresponds to the filename.
The ftp server is a modified version of oftpd by Shane Kerr. It serves no files from the disk β only virtual files from the 1-wire bus. So security should therefore be good. Only the 1-wire bus is at risk. π‘οΈ
π₯ Device Options (1-wire Bus Master) π₯
These options specify the device (bus master) that connects your computer to the 1-wire bus. The 1-wire slaves hang off the 1-wire bus, and the bus master plugs into a port on the computer and controls the 1-wire bus. The bus master is either an actual physical device, the kernel w1 module, or an owserver (1).
At least one device option is required. There is no default. π¨
More than one device can be listed, and all of them will be used. (It's a logical union, unless you go exploring the /bus.n/ directories. π)
Linux and BSD enforce a security policy restricting access to hardware ports. You must have sufficient rights to access the given port, or access will silently fail. π No error, no nothing, it just won't work. You've been warned.
β Serial devices β
port specifies a serial port, e.g. /dev/ttyS0, or a USB port accessed as a serial port, e.g. /dev/ttyUSB0.
If OWFS was built with libftdi support, you may be able to use the ftdi: prefix in any of the options as port to address a FTDI-based USB device. For details, see the FTDI ADDRESSING section.
-d port|--device=port<small>(DS2480B)</small> β DS2480B-based bus master (like the DS9097U or an adapter of the LINK family in emulation mode). If the adapter doesn't respond, a passive type (DS9907E or diode/resistor) circuit will be assumed.--serial_flextime|--serial_regulartime<small>(DS2480B)</small> β Changes details of bus timing (see DS2480B datasheet). Some devices, like the Swart LCD, cannot work with flextime.--baud=1200|9600|19200|38400|57600|115200<small>(DS2480B, LINK, HA5)</small> β 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 LINK family and DS2880B in theinterface/settingsdirectory. The HA5 speed is set in hardware, so the command line baud rate should match that rate. Usually the default settings (9600 for a device of the LINK family and DS2480B) and 115200 for the HA5 are sane and shouldn't be changed. π«Ά--straight_polarity|--reverse_polarity<small>(DS2480B)</small> β Reverse polarity of the DS2480B output transistors? Not needed for the DS9097U, but required for some other designs.--link=port<small>(LINK)</small> β iButtonLink LINK adapter (all versions) in non-emulation mode. Uses an ascii protocol over serial. This supports the simplifiedftdi:<serial number>addressing scheme.--ha7e=port<small>(HA7E)</small> β Embedded Data Systems HA7E adapter (and HA7S) in native ascii mode.--ha5=port|--ha5=port:a|--ha5=port:acg<small>(HA5)</small> β Embedded Data Systems HA5 mutidrop adapter in native ascii mode. Up to 26 adapters can share the same port, each with an assigned letter. If no letter specified, the program will scan for the first response (which may be slow π’).--checksum|--no_checksum<small>(HA5)</small> β Turn on (default) or off the checksum feature of the HA5 communication.--passive=port|--ha2=port|--ha3=port|--ha4b=port<small>(Passive)</small> β Passive 1-wire adapters. Powered off the serial port and using passive electrical components (resitors and diodes).--8bit|--6bit<small>(Passive)</small> β Synthesize the 1-wire waveforme using a 6-bit (default) serial word, or an 8-bit word. Not all UART devices support 6 bit operation.--timeout_serial=5β Timeout (in seconds) for all serial communications. 5 second default. Can be altered dynamically under/settings/timeout/serial.
π§ USB devices π§
The only supported true USB bus masters are based on the DS2490 chip. The most common is the DS9490R, which has an included 1-wire ID slave with family code 81.
There are also bus masters based on the serial chip with a USB to serial conversion built in. Those are supported by the serial bus master protocol.
-u|--usbβ DS2490 based bus master (like the DS9490R).-u2|--usb=2β Use the second USB bus master. (The order isn't predicatble, however, since the operating system does not consistently order USB devices. π)-uall|--usb=ALLβ Use all the USB devices.--usb_flextime|--usb_regulartimeβ Changes the details of 1-wire waveform timing for certain network configurations.--altusbβ Willy Robion's alternative USB timing.--timeout_usb=5β Timeout for USB communications. This has a 5 second default and can be changed dynamically under/settings/timeout/usb.
π I2C devices π
I2C is a 2 wire protocol used for chip-to-chip communication. The bus masters: DS2482-100, DS2482-101 and DS2482-800 can specify (via pin voltages) a subset of addresses on the i2c bus. Those choices are:
i2c_address
0,1,2,3β0x18,0x19,0x1A,0x1B4,5,6,7β0x1C,0x1D,0x1E,0x1F(DS2482-800 only)
port for i2c masters has the form /dev/i2c-0, /dev/i2c-1, ...
-d port|--device=portβ This simple form only permits a specific port and the first availablei2c_address.--i2c=port|--i2c=port:i2c_address|--i2c=port:ALLβ Specific i2c port and the i2c_address is either the first, specific, or all or them. The i2c_address is0,1,2,...--i2c|--i2c=:|--i2c=ALL:ALLβ Search the available i2c buses for either the first, the first, or every i2c adapter.
The DS2482-800 masters 8 1-wire buses and so will generate 8 /bus.n entries. Eight. Busy girl. π
π«Ά Network devices π«Ά
These bus masters communicate via the tcp/ip network protocol and so can be located anywhere on the network. The network_address is of the form tcp_address:port.
E.g. 192.168.0.1:3000 or localhost:3000
--link=network_addressβ LinkHubE network LINK adapter by iButtonLink.--ha7net=network_address|--ha7netβ HA7Net network 1-wire adapter with specified tcp address or discovered by udp multicast. By Embedded Data Systems.--timeout_ha7=60specific timeout for HA7Net communications (60 second default).--etherweather=network_addressβ Etherweather adapter.-s network_address|--server=network_addressβ Location of anowserver (1)program that talks to the 1-wire bus. The default port is4304.--timeout_network=5β Timeout for network bus master communications. This has a 1 second default and can be changed dynamically under/settings/timeout/network.
π Simulated devices π
Used for testing and development. No actual hardware is needed. Useful for separating the hardware development from the rest of the software design. π§ͺ
devices is a list of comma-separated 1-wire devices in the following formats. Note that a valid CRC8 code is created automatically. β¨
10,05,21β Hexadecimal family codes (the DS18S20, DS2405 and DS1921 in this example).10.12AB23431211β A more complete hexadecimal unique address. Useful when an actual hardware device should be simulated.DS2408,DS2489β The 1-wire device name. (Full ID cannot be speciifed in this format).
And the options:
--fake=devicesβ Random address and random values for each read. The device ID is also random (unless specified).--temperature_low=12--temperature_high=44β Specify the temperature limits for the fake adapter simulation. These should be in the same temperature scale that is specified in the command line. It is possible to change the limits dynamically for each adapter under/bus.x/interface/settings/simulated/[temperature_low|temperature_high]--tester=devicesβ Predictable address and predictable values for each read. (See the website for the algorithm).
okay that's a LOT of hardware options and we're only getting started π more of this page is coming β do not scroll away π
π¦ w1 kernel module π¦
ok so this one is linux-specific β it lets OWFS ride on access to bus masters that the operating system already gives you. π
Two things you need to know up front: root access is required, and ngl the implementation was still in progress as of owfs v2.7p12 and linux 2.6.30. So, like, it works but it's giving "under construction" energy. π§
Bus masters get recognized and added dynamically β the details of the physical bus master aren't accessible, but they include USB, i2c, and a bunch of GPIO designs on embedded boards. π«Ά
Access is restricted to superuser because of the netlink broadcast protocol that w1 uses. Also, multitasking has to be configured (threads) at compilation time β no threads, no w1 vibes. π§΅
--w1β use the linux kernelw1virtual bus master. π§β¨--timeout_w1=10β timeout for w1 netlink communications. It's got a 10 second default, and you can change it on the fly at/settings/timeout/w1. β±οΈ
π FTDI ADDRESSING π
So FTDI is a brand of USB-to-serial chips and bestie they are everywhere. π If your serial device is hooked up through a USB serial dongle based on an FTDI chip, or your adapter has a built-in FTDI USB chip (hi, LinkUSB π), you get to use this FTDI addressing mode.
And why would you want that?? The main benefit is that we can decrease the communication delay, which gives you twice as fast 1-Wire communication in a lot of cases. literally ate. π₯
The following values for port can be used to identify a specific FTDI port in several of the serial device options. π
Heads up bestie: this requires that OWFS is built with libftdi support, which might not be the case in standard repositories. π
ftdi:d:<device-node>β path of bus and device-node (like"003/001") inside the usb device tree (usually at/proc/bus/usb/or/dev/bus/usb/). πftdi:i:<vendor>:<product>β first device with the given vendor and product id; ids can be decimal, octal (preceded by"0") or hex (preceded by"0x"). π’ftdi:i:<vendor>:<product>:<index>β same as above, but with index being the number of the device (starting with0) if there's more than one. 1οΈβ£ftdi:s:<vendor>:<product>:<serial number>β the device with the given vendor id, product id and serial number string. π
The above formats are parsed fully by libftdi (minus the ftdi: prefix). β¨
πΈ Simplified device serial-only support πΈ
There's an extra format supported, for certain bus types. This one only specifies the USB serial number. π€
ftdi:<serial number>β identifies a FTDI device by serial number only. Currently this is only valid for the VID/PID found on theLinkUSB(i.e.--link). β οΈ Note that those VID/PID's are the default for anyFT232Rdevice, and they are in no way exclusive to LinkUSB. iykyk.
π Permsissions π
(this is the original's spelling bestie, I'm not fixing it, it's iconic π)
So in order to run owserver (1) 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/). π
An easy way to achieve this would be using chown (1):
sudo chown :<your user> /dev/bus/usb/003/001
that changes the group of the raw USB node"003/001"from the default"root"to"<your user>"π«Ά
You can also write a udev (1) rule for your adapter:
SUBSYSTEM=="usb", DRIVER=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", ATTR{serial}=="AK0048A0", GROUP="owsrv"
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:AK0048A0is connected to. π§
π Serial USB node π
Okay important thing: 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. π³
As a side effect, if it exists, the serial USB node e.g. /dev/ttyUSB0 is removed on successful starting of owserver (1). After it's terminated, un- and re-plugging the adapter, or un- and reloading of the module ftdi_sio, will recreate the serial USB node. π
π¦ Finding FTDI related information on your USB adapter π¦
owusbprobe is THE tool to find the information needed for direct FTDI addressing. π
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:
sudo lsusb -D /path/to/your/raw/USB/device/node |egrep "idVendor|idProduct|iSerial"
sudois necessary to get the value of theiSerialfield, if the permissions are still unchanged. π
π Examples FTDI addressing π
owserver -d ftdi:s:0x0403:0x6001:A800bXHr
starts owserver with a LinkUSB (VID:0x0403,PID:0x6001,S/N:A800bXHr) as bus master in DS2480B-based emulation mode with direct FTDI access. π₯
owserver --link=ftdi:A800bXHr
starts owserver with a LinkUSB (S/N:A800bXHr) as bus master identified by serial number only in native mode with direct FTDI access. π
β¨ SPECIFIC OPTIONS β¨
π -p host:portnum π
(Optional) Sets the tcp port the ftp server runs on. Access it with the URL ftp://anonymous@servernameoripaddress:portnum. π
The well known ftp port, 21, will be used by default. And since this port number is in the restricted range, special permission is usually required. π
π‘οΈ TEMPERATURE SCALE OPTIONS π‘οΈ
-C,--Celsiusβ Celsius, bb. π₯Ά-F,--Fahrenheitβ Fahrenheit. πΊπΈ-K,--Kelvinβ Kelvin. π¬-R,--Rankineβ Rankine. π
Temperature scale used for data output. Celsius is the default. π
Can also be changed within the program at /settings/units/temperature_scale. β¨
π«§ PRESSURE SCALE OPTIONS π«§
--mbarβ millibar, (default) β--atmβ atmospheres. π--mmHgβ millimeters of mercury. π©Ί--inHgβ inches of mercury. π--psiβ pounds per square inch. πͺ--Paβ pascals. π§ͺ
Pressure scale used for data output. Millibar is the default. π
Can also be changed within the program at /settings/units/pressure_scale. β¨
π€ FORMAT OPTIONS π€
Choose the representation of the 1-wire unique identifiers. OWFS uses these identifiers as unique directory names. π
Although several display formats are selectable, all must be in family-id-crc8 form β unlike some other programs and the labelling on iButtons, which are crc8-id-family form. π
π -f, --format="f[.]i[[.]c]" π
Display format for the 1-wire devices. Each device has a 8byte address, consisting of:
fβ family code, 1 byteiβ ID number, 6 bytescβ CRC checksum, 1 byte
Possible formats are f.i (default, 01.A1B2C3D4E5F6), fi fic f.ic f.i.c and fi.c. π₯
All formats are accepted as input, but the output will be in the specified format. π
The address elements can be retrieved from a device entry in owfs by the family, id and crc8 properties, and as a whole with address. The reversed id and address can be retrieved as r_id and r_address. π«Ά
ποΈ JOB CONTROL OPTIONS ποΈ
π -r, --readonly / -w, --write π
Do we allow writing to the 1-wire bus (writing memory, setting switches, limits, PIOs)? π The write option is available for symmetry β it's the default. βοΈ
π -P, --pid-file filename π
Places the PID β the process ID of owfs β into the specified filename. Useful for startup scripts control. π
π --background | --foreground π
Whether the program releases the console and runs in the background after evaluating command line options. background is the default. π
π --error_print=0|1|2|3 π
=0β default mixed destination: stderr foreground / syslog background. π=1β syslog only. π=2β stderr only. π»=3β/dev/null(quiet mode). π€«
π --error_level=0..9 π
=0β default errors only. π¨=1β connections/disconnections. π=2β all high level calls. π=3β data summary for each call. π§Ύ=4β details level. π>4β debugging chaff. πΎ
--error_level=9 produces a lot of output. π
π CONFIGURATION FILE π
π -c file | --configuration file π
Name of an owfs (5) configuration file with more command line parameters. πβ¨
π HELP OPTIONS π
See also this man page and the web site http://www.owfs.org. π
π -h, --help=[device|cache|program|job|temperature] π
Shows a basic summary of options. π«Ά
deviceβ 1-wire bus master options. πcacheβ cache and communication size and timing. β±οΈprogramβ mountpoint or TCP server settings. π₯οΈjobβ control and debugging options. πtemperatureβ Unique ID display format and temperature scale. π‘οΈ
π -V, --version π
Version of this program and related libraries. ππ
β° TIME OPTIONS β°
Timeouts for the bus masters were previously listed in Device options. Timeouts for the cache affect the time that data stays in memory. Default values are shown. π§
--timeout_volatile=15β seconds until a volatile property expires in the cache. Volatile properties are those (like temperature) that change on their own. π‘οΈ Can be changed dynamically at/settings/timeout/volatile. β¨--timeout_stable=300β seconds until a stable property expires in the cache. Stable properties are those that shouldn't change unless explicitly changed. Memory contents for example. πΎ Can be changed dynamically at/settings/timeout/stable. β¨--timeout_directory=60β seconds until a directory listing expires in the cache. Directory lists are the 1-wire devices found on the bus. π Can be changed dynamically at/settings/timeout/directory. β¨--timeout_presence=120β seconds until the presence and bus location of a 1-wire device expires in the cache. π Can be changed dynamically at/settings/timeout/presence. β¨
There are also timeouts for specific program responses: π
--timeout_server=5β seconds until the expected response from theowserver(1) is deemed tardy. π΄ Can be changed dynamically at/settings/timeout/server. β¨--timeout_ftp=900β seconds that an ftp session is kept alive. π‘ Can be changed dynamically at/settings/timeout/ftp. β¨
π EXAMPLE π
owftpd -d /dev/ttyS0
Ftp server runs on default tcp port 21, serial adapter at ttyS0. π
owftpd -s littlehost:4304 --error_level=3
Ftp server on default port 21, from owserver (1) process on host "littlehost", extensive error messages. π’
π«Ά AVAILABILITY π«Ά
http://www.owfs.org π
π SEE ALSO π
π Programs π
owfs (1) owhttpd (1) owftpd (1) owserver (1) owdir (1) owread (1) owwrite (1) owpresent (1) owtap (1)
π Configuration and testing π
owfs (5) owtap (1) owmon (1)
π Language bindings π
owtcl (3) owperl (3) owcapi (3)
π Clocks π
DS1427 (3) DS1904(3) DS1994 (3) DS2404 (3) DS2404S (3) DS2415 (3) DS2417 (3)
π ID π
DS2401 (3) DS2411 (3) DS1990A (3)
π Memory π
DS1982 (3) DS1985 (3) DS1986 (3) DS1991 (3) DS1992 (3) DS1993 (3) DS1995 (3) DS1996 (3) DS2430A (3) DS2431 (3) DS2433 (3) DS2502 (3) DS2506 (3) DS28E04 (3) DS28EC20 (3)
π Switches π
DS2405 (3) DS2406 (3) DS2408 (3) DS2409 (3) DS2413 (3) DS28EA00 (3)
π Temperature π
DS1822 (3) DS1825 (3) DS1820 (3) DS18B20 (3) DS18S20 (3) DS1920 (3) DS1921 (3) DS1821 (3) DS28EA00 (3) DS28E04 (3)
π Humidity π
DS1922 (3)
π Voltage π
DS2450 (3)
π Resistance π
DS2890 (3)
π Multifunction (current, voltage, temperature) π
DS2436 (3) DS2437 (3) DS2438 (3) DS2751 (3) DS2755 (3) DS2756 (3) DS2760 (3) DS2770 (3) DS2780 (3) DS2781 (3) DS2788 (3) DS2784 (3)
π Counter π
DS2423 (3)
π LCD Screen π
LCD (3) DS2408 (3)
π Crypto π
DS1977 (3)
π Pressure π
DS2406 (3) β TAI8570
π AUTHOR π
This whole thing was built by Paul Alfille π β yes, the Paul Alfille, the one whose name is basically stitched into the fabric of this entire project. If you ever need to slide into his inbox (respectfully!! bestie behaviour only π«Ά), it's paul.alfille@gmail.com.
Not me being obsessed with the fact that one person is out here gifting the world a whole filesystem, fr fr. π
And that's a wrap on OWFTPD(1), my love πΈ β every option, every flag, every last byte of it. This page comes to you from the OWFS Manpage, dated 2004, living in section OWFTPD(1). Go forth and FTP responsibly, bestie π
β¨
byeeee π¦π
π¦ where this page comes from
- debian bookworm: owftpd 3.2p4+dfsg1-4.1+b1 Β· GPL-2.0-only
- debian trixie: owftpd 3.2p4+dfsg1-6 Β· GPL-2.0-only
- ubuntu jammy: owftpd 3.2p4+dfsg1-4build5 Β· GPL-2.0-only
- ubuntu noble: owftpd 3.2p4+dfsg1-4.3build2 Β· GPL-2.0-only
- ubuntu questing: owftpd 3.2p4+dfsg1-6
- ubuntu resolute: owftpd 3.2p4+dfsg1-7 Β· GPL-2.0-only
- ubuntu stonking: owftpd 3.2p4+dfsg1-7build1 Β· GPL-2.0-only
- Copyright (c) 2003-2006 Paul H Alfille, MD
- Copyright (c) 2003-2004 Paul H Alfille, MD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms