OWFS SF.net project page New OWFS Website! by Paul H Alfille SourceForge.net Logo
OWFS Design
overview
components
naming
cache
arrays
performance

OWFS Features
cache
statistics

OWFS Software
Install instructions
Bootable CD
Filesystem (owfs)
Web Server (owhttpd)
Backend Server (owserver)
Perl bindings (owperl)
Python bindings (owpython)
PHP bindings (owphp)
Tcl bindings (owtcl)
Download
Daily Configured Package
CVS -- newest
CVS Statistics
FAQ
Examples & Usage
1-wire wireless
1-Wire Hardware
OWFS Project

OWFS and OWHTTPD

1-wire chips
  • Synopsis:

    owfs is a method under linux to allow 1-wire devices to appear like files in a directory. You can then enter a command like "cat */temperature" to have all the temperatures sensors measure and print their data. For instance, the collection of temperature sensors above are all on one bus, individually addressable, and will reconfigure on the fly as items are added or removed. Each device is it's own directory with it's own properties.

    • The host platform is Linux for owfs and POSIX (Linux and BSDs) for owhttpd.
    • The 1-wire bus host adapter can be Serial port (ibuttonlink, DS9097E and DS9097) or USB (DS9490 or PuceBaboon).
    • 1-wire devices supported include temperature sensors, switches, memory, hubs. See Support Table.
    • The filesystem runs in user space, using the FUSE kernel module.
    • The system is multithreaded for improved performance.
    • Performance can be monitored and tuned with real-time statistics.

    owhttpd is the same code, modified to run as a simple web server. FUSE is not required, portablilty should be even better, and all the same capabilities should be supported. See the download section to get owhttpd. The server can be bound to any port, and is secure (only shows 1-wire bus, no local files).

  • Quick start

    Use the bootable Live-CD with OWFS pre-configured.
  • Example:

  • Network with LINK and a DS18S20 (temperature sensors) and DS2406 (2 port switch).

    See the list of supported devices, and the explanation of the uncached directory.
    Also see the explanation of device names.

    OWFS OWHTTPD
    Command Output
    tree -a 1wire
    1wire/
    |-- 10.024446000800
    | |-- address
    | |-- crc8
    | |-- family
    | |-- id
    | |-- present
    | |-- scratchpad
    | |-- temperature
    | `-- type
    |-- 12.C4DF1F000000
    | |-- PIO.A
    | |-- PIO.ALL
    | |-- PIO.B
    | |-- address
    | |-- channels
    | |-- crc8
    | |-- family
    | |-- id
    | |-- memory
    | |-- power
    | |-- present
    | |-- sensed.A
    | |-- sensed.ALL
    | |-- sensed.B
    | `-- type
    \-- DS9097U
    |-- port
    |-- present
    `-- version
    cat 1wire/10*/temperature
    +020.1875
    +019.8125

    22.367A03000000


    address 22367A0300000092
    crc8 92
    family 22
    fasttemp 20.5000
    id 367A03000000
    present YES
    scratchpad
    48014B461FFF0810
    temperature 20.0000
    type DS1822

    12.C4DF1F000000


    PIO.A
    PIO.B
    PIO.ALL
    address 12C4DF1F00000051
    channels 1
    crc8 51
    family 12
    id C4DF1F000000
    memory
    power NO
    present YES
    sensed.A NO
    sensed.B NO
    sensed.ALL 0,0
    type DS2406
    More examples can be seen in the Shell Hints page.

  • Progress

    • Current

      Version 1.x
      Stable and working code. Supports USB, serial, and 80% of the devices. Very solid even under load.
      Weekly progress log.
    •  Future Plans / Wishlist

      • Adapters

        Add support for the parallel port adapter (DS1410E). Its a rather poor adapater, but I'd like to be complete.
        Look into advanced support for the LINKs. (They work well currently, but have some embedded capabilities).
      • Devices

        Add support for the Thermacron and Temperature logger ibuttons.
        Add SHA device support
      • Wrappers

        FTP interface
        Perl interface
        PHP interface - in progress
        Python interface
        TCL interface
        XML interface
      • Documentation

        Document MAISON
        Add more completed example implementations
        FAQ extracted from mailing list.
      • Capabilities

        Alarm directory
        Cache directories
        Preconvert temperatures
        Cache improvements
        ? Family directories
  • Documentation:

  • FUSE filesystem

    FUSE is a kernel module that allows filesystems to be written in user space and linked into the kernel (2.4 and 2.6). It was written by Miklos Szeredi, and confusingly was originally called AVFS. Fuse is actively developed and is available on Sourceforge. It was recently reviewed in Linux Weekly News.

  • 1-wire devices

    1-Wire devices are fascinating little chips. The 1-wire refers to the communication/power protocol. Two wires, ground and data are required. The chips can steal power from the data line to power their functions. Multiple devices can sit on the same wire, each with its unique ID so individually addressable. The chips come in two main forms, standard, and stainless steel cans (ibuttons). Originally made by Dallas Semiconductor, Maxim now is the parent company.

  • Adapters (bus masters):

    • See the adapter list for the full details.
    • Communication can be serial, USB or parallel (though parallel not yet supported by OWFS).
    • Adapters differ in eletrical characteristics (power delivery, overdrive support, tolerance of signal loss and reflections), CPU efficiency, and speed.
    • The logical view of the 1-wire bus is independent of the adapter.
    • Multiple 1-wire busses are allowed with separate invocations of owfs.
  • Download:

    OWFS is undergoing constant development, but it is functional and stable. Current version is 1.0
    OWFS and OWHTTPD and the associated library (libow) are packaged together.

  • Packages
    CVS
    If FUSE is needed, it can be downloaded from Sourceforge download page
    Do the standard:
    ./configure
    make install

    If FUSE is needed, the latest FUSE can be obtained from the Sourceforge CVS repository
    cvs -d:pserver:anonumous@cvs.sourceforge.net:/cvsroot/fuse co fuse
    cd fuse
    ./configure
    make install

    NOTE: There is no need to get the latest FUSE sources. OWFS doesn't track FUSE progress and uses features that have been long stable.
    Released packages can be downloaded from SourceForge download page Latest release can be pulled from the Sourceforge CVS repository.
    cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/owfs  co owfs
    cd owfs
    ./bootstrap
  • Installation:

    More information can be found on the owfs-developers mailing list.

    Unpacking
    Locations
    • RPM binaries:
      rpm -Uvh ow*.i386.rpm
    • RPM sources:
      rpm -Uvh ow*.rpm
      cd ~/owfs
      ./bootstrap
      make install

    • Tarball sources:
      tar -xvzf ow*.tar.gz
      ./configure
      make install

    • RPM binaries: /usr/bin
    • RPM source: /opt/owfs/bin
    • Tarball source: /opt/owfs/bin
  • Starting:

    OWFS OWHTTPD
    • Runs in foreground
    • Needs kernel module fuse.o
    • modprobe fuse
    • ow serial-port mount-point
    • e.g.: ow /dev/ttyS1 /mnt/1wire
    • multiple instances can run, one for each serial device.
    • Runs as daemon (background)
    • owhttpd -p tcp-port -d serial-port
    • e.g.: owhttpd -p 3001 -d /dev/ttyS1
  • Using:

    OWFS OWHTTPD
    • access the mounted directory by shell commands.
    • list devices: ls mount-point
    • show device properties: cat */temperature
    • change device property: echo "1" > PIO
    • Use any web browser.
    • URL: http://machine:tcp-port
    • e.g: http://localhost:3001
    • Follow links in the browser
  • Stopping:

    OWFS OWHTTPD
    • killall owfs
    • shutdown will not be graceful if the mounted directory is in use by another process.
    • killall owhttpd

  • Platform:

    Tested under Linux (SuSE 8.1,9.0 Debian, Redhat -- Kernel 2.4.19-22). Requires FUSE, gcc so should work with any 2.4 or 2.6 Linux system. GPL license.

  • Author:

    Paul H. Alfille

  • Source Code:

    Three modules:

    • owlib -- Major functionality. Includes serial/USB port control, 1-wire bus control, 1-wire device communication, bus listing, caching, and device value parsing.
    • owfs -- filesystem-specific code (command line parsing, mounting, callbacks from fuse system). Requires FUSE.
    • owhttpd -- Web server code -- command line and socket control. Web page presentation.
    Within each module, code is in the src directory (src/c for code, src/include for headers).

    To add support for a new device, modify owlib. Copy an existing device and associated header, making the appropriate changes. Add your device to the list is owfs.c and ow_devices.h as well as including it in the compilation by adding it to src/c/Makefile.am

    The program should be rather self-explanatory: FUSE or the web server call owlib with the full name of the device (e.g. /10.006756500/temperature) which is resolved to the device, and property needed. The context of the call (read or write) will dictate the action performed. Web syntax is similar -- look at the URL as you test the program to understand it better.

  • Links

© 2003 Paul H. Alfille and The owfs Team
$Id: index.html,v 1.48 2006/05/07 05:32:44 d1mag Exp $