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

FAQ


  1. What does owfs do?
    1. 1-Wire
      One-wire is a very simple (at least in hardware) communication scheme developed by Dallas Semiconductor (now part of Maxim). It requires one a communication wire (and ground). Power can be stolen from the communication wire, and the 1`-wire devices can uniquely identify and select themselves. 1-wire devices are cheap, and have a variety of properties: identity, memory, encryption, temperature, voltage, current sensing, and time keeping and switching capabilities. Unfortunately the intricasies of each device are a little arcane, and require carefule perusa; of the datasheet. Thats where OWFS comes in. OWFS is a simple approach to the 1-wir devices. All their properties are there, but presented in an intuitive way. It will take one a few minutes to get a temperature reading, for instance!
    2. What's the differnce between -wire and iButton.
      iButtons are 1-wire devices specially packaged in a steel can (think coin battery) direct use. The rast of the 1-wire devices are standard integrated components in a variety of chip sizes and configurations. The iButtons have some limitations, for instance they can't have more than two electrical onnections, but they are robust, and can hold a battery for persistent staorage and opartion.
    3. File system model
    4. user-mode
  2. How do I get OWFS?
    1. Complete instructions
    2. Packages
      The Software is packaged all together as "owfs" which includes source to build:
      owfs -- the filesystem interface using fuse
      owhttpd -- the web server
      owperl -- the OW perl package that makes a simple interface to the 1wire bus
      owpython -- the OW Python package that makes a pythonic interface to the 1wire bus
      libow.so -- the dynamic library that actually talks to the bus
    3. CVS
      The newest version can be pulled from the Sourceforge CVS server.
    4. Daily configured packages.
      Only needs "./configure" and "make install" -- avoids automake difficulties.
    5. Other components
  3. Installation problems
    1. USB
      1. USB is a little tricky. Communication is done using libusb -- a popular user-mode usb library (current version 0.18, though 0.17 is known to work).
      2. Newer kernels (2.6.8+) have a conflicting module ds9094r which Peter Kropf found must be disabled prior to running owfs (ow owhttpd, etc):
        rmmod ds9490r
        /opt/owfs/bin/owfs -u .......
  4. Getting owfs running
    1. Where is it?
      The usual place for owfs installation is in the /opt/owfs directory. /opt/owfs/bin holds the programs, and /opt/owfs/lib holds the library.
      Thus to invoke owfs, you would enter
      /opt/owfs/bin/owfs
      and to start the web server
      /opt/owfs/bin/owhttpd
    2. command line
    3. Startup scripts
      1. Debian
        Peter Kropf posted his startup scripts
      2. Redhat
        Serg Oskin's approach.
    4. inittab
      See the cellar example for an inittab script that starts (and restarts) the logging script.
  5. Tested platforms
    1. Major distributions:
      1. Debian Woody, Sid
        Woody only works with daily packages, not cvs pull. (automake problem).
      2. Fedora Core 1, 2 3
      3. Gentoo 1.3, 2004.2 2004.0 (from Stuart Grimshaw)
        Gentoo/OWFS Minit-Howto.

        Make sure you have all the owfs dependencies installed, owfs was one
        of the first things I installed on my Gentoo server after initial
        setup was complete, so you may already have these installed.

        emerge -v =sys-fs/fuse-1.4
        you only need the latest stable (1.4 at the time
        of writing.) Once you have emerged fuse, create /etc/fuse.conf and add
        the line

        user_allow_other

        This lets you specify that other users can access the mounted owfs.

        Next I had to emerge swig, but only if you want to build the wrapper
        libraries for Perl, Python etc. If you don't want them, you can tell
        ./configure that you don't want them, and in that case you don't need
        to emerge swig.

        Now Install owfs as per the normal instructions.

        I havn't figured out what permissions are needed on the various
        devices to allow me to owfs as non-root.


      4. SuSE 8.0, 8.1, 8.2, 9.0 9.1 9.2*
        * -- rmmod ds9094r (autodetected 1-wire module)
    2. Embedded systems
      1. MIPS Linksys Wireless Router
      2. Motorola Coldfire board
    3. Macintosh
      1. libusb is supported under OS X
      2. Serial ports under OSX follow the same design (POSIX compliance) as Linux. See this or this.
      3. FUSE is not supported, so owfs cannot be run (though owhttpd, etc will work).
    4. C libraries
      1. glibc
      2. uClibc
  6. File system access
    1. What is FUSE?
      A little digression to talk about FUSE.
      Linux (and unix) model many parts of the operating system as a filesystem. Not only are regular disk portions files, but so are serial ports, console screens, digital cameras, etc. One unusual type of file is a "virtual" file, which gets constructed on the fly from information in memory. All the entries in the /proc and /sys directories are like that.
      Fuse is somewhere in between. a program is registered with fuse, and any file operations to the directory it is mounted on are sent to the fuse program.
    2. NFS
      1. 2.4 Kernel
        Fuse cannot be re-exported using the NFS under the 2.4 series of kernels. Update your system. Or use a user-space NFS. Or Samba.
      2. 2.6 Kernal
        Fuse (and thus owfs) can be exported under NFS.
    3. SAMBA
      OWFS can be exported under Samba (the windows network file system). This means that Windows machines, and other SMB-compatible machines can mount the 1-wire network remotely.
  7. Security
  8. Web server
    The owfs webserver, owhttpd, is a relatively simple process. It responds to the specified port, and interprets URLs very similar to owfs file system names.
    1. Runs with other web servers?
      Yes, as long a different port is specified.
    2. Security?
      Should be good. Only apropriate URLs are accepted. The filesystem is not actually read or written.
    3. Does it reque FUSE?
      No.
    4. Does it require Linux?
      Probably not. BSD and Mac OSX should work.
    5. Can it run simultaneously with owfs?
      Unwise at present. They will step on each other. If you don't actually do anything at the same time, it will be ok, but wait for the socket model.
    6. Can I run APACHE (ROXEN, ..)
      Yes and no. You should use the owfs file-system interface and either read and manipulate the file-system directly, or through a cgi script.
  9. FTP
    Under developement. The idea is for an anonymous ftp server. Although any ftp server could work with a fuse-mounted filesystem (owfs), the idea of owftpd would be to avoid fuse and thus be possible on non 2.4 and 2.6 kernels (older linux and BSD-derived).
  10. perl
    1. Package owperl. An interface to OWFS created with swig.
    2. Module name: OW
    3. configure with "./configure --enable-owperl" which is the default
    4. Four functions:
      1. OW::init("device")
        device is either the name of the serial port e.g. "/dev/ttyS0"
        or "u" for USB
        or (later) the TCP address:port of owserver
      2. OW::get("path")
        path follows the same syntax as owfs
        path looks like a file directory e.g. /uncached/10.0123112112/temperature
        uncached, alarm, simultaneous all supported
        Return is the value, comma separated value list, or comma separated directory elements
        Returned directory elements will have a "/" at the end
      3. OW::put("path","value")
        Path follows the same syntax as OW::get
        put will not work for directories and read-only properties
        put of non-writable paths is not an error, just ineffective
      4. OW::finish()
        Probably optional
    5. Example -- Full tree listing
      #!/usr/bin/perl -w

      # OWFS test program
      # See owfs.sourceforge.net for details
      # {copyright} 2004 Paul H. Alfille
      # GPL license

      use OW ;

      die (
           "OWFS 1-wire tree perl program\n"
          ."  by Paul Alfille 2004 see http://owfs.sourceforge.net\n"
          ."Syntax:\n"
          ."\t$0 1wire-port\n"
          ."  1wire-port (required):\n"
          ."\t'u' for USB -or-\n"
          ."\t/dev/ttyS0 (or whatever) serial port\n"
          ) if ( $#ARGV != 0 ) ;

      OW::init($ARGV[0]) or die "Cannot open 1wire port $ARGV[0]" ;

      sub treelevel {
          my $lev = shift ;
          my $path = shift ;
          my $res = OW::get($path) or return ;
          for (split(',',$res)) {
              for (1..$lev) { print("\t") } ;
              print $_ ;
              if ( m{/$} ) {
                  print "\n" ;
                  treelevel($lev+1,$path.$_) ;
              } else {
                  my $r = OW::get($path.$_) ;
                  print ": $r" if defined($r) ;
                  print "\n" ;
              }
          }
      }

      treelevel(0,"/") ;
      OW::finish() ;
    6. Example -- one liners:
      1. Show the 1-wire bus (USB adapter)
        perl -MOW -e "OW::init('u');print OW::get('/');"
      2. Show all the temperatures (serial bus)
        perl -MOW -e"OW::init('/dev/ttyS1');my \$x;for \$x (split(',',OW::get('/'))) { print OW::get(\$x.temperature) if \$x=~m/^10/ };"

  11. Python
    1. Package owpython. An interface to OWFS created with swig.
    2. Module name: ow
    3. configure with "./configure --enable-owpython" which is the default
    4. Four functions:
      1. ow.init( "device" )
        device is either the name of the serial port e.g. "/dev/ttyS0"
        or "u" for USB
        or (later) the TCP address:port of owserver
      2. ow.finish()
        Probably optional
      3. ow.Sensor( "path" )
        Repersents a sensor on the 1-wire network. path follows the same syntax as owfs
        path looks like a file directory e.g. /uncached/10.0123112112/temperature
        uncached, alarm, simultaneous all supported
    5. Example -- Full tree listing

      #! /usr/bin/env python
      """
      OWFS test program
      See owfs.sourceforge.net for details
      {copyright} 2005 Peter Kropf
      GPL license
      """

      import sys
      import ow

      def tree( sensor ):
      print '%7s - %s' % ( sensor._type, sensor._path )
      for next in sensor.sensors( ):
      if next._type in [ 'DS2409', ]:
      tree( next )
      else:
      print '%7s - %s' % ( next._type, next._path )

      if __name__ == "__main__":
      if len( sys.argv ) == 1:
      print 'usage: tree.py u|serial_port_path'
      sys.exit( 1 )
      else:
      ow.init( sys.argv[ 1 ] )
      tree( ow.Sensor( '/' ) )


  12. Hardware resources
  13. Software resources
  14. Alternatives to OWFS
© 2003 Paul H. Alfille and The owfs Team
$Id: faq.html,v 1.8 2005/02/13 04:58:27 alfille Exp $