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
Table of Contents

Name

Owtcl - OWFS library access commands for Tcl

Synopsis

package require ow

::OW::init interface ?interface ...? ?options?
::OW::finish
::OW::get ?path?
::OW::put path ?value?
::OW::isdirectory path

::OW::isdir path

Description

owtcl is a Tcl extension that provides an interface to OWFS. OWFS is a family of programs that manipulate the Dallas/Maxim 1-wire bus -- a low power, low speed, system of smart memory chips and sensors. Each item on the bus is uniquely numbered and addressable. Bus elements can be added and subtracted at will.

There is optional data caching. Which can speed repeated access to the same 1wire properties (but is potentially confusing). Use the uncached links to see immediate values.

The underlying interface to the 1-wire bus is identical to owfs (filesystem view) and owhttpd web server interface. Only the top layer has been modified to return native Tcl data. Development here, and support for new devices, will progress with those projects.

Low-level Commands

The following low-level commands are possible:
::OW::init interface ?interface ...? ?options?
Connect to 1-wire adapter or owserver. interface defines a way of connection to the 1-wire bus. Possible values:
usb | usbN | u | uN
Direct connection to the 1-wire interface on the USB port -- DS9490. N - optional number for multiple usb adapters.
/dev/ttySx
Direct connection to a 1-wire interface on the serial port -- DS9097U or DS9097.
:port | host:port | socket:/local/socket/path
Location of an owserver daemon that connects to the 1-wire bus. Multiple owtcl as well as owfs and owhttpd programs can access the owserver process simultaneously. In fact, this will probably be the prefered mode of access to OWFS for owtcl except in trivial applications.

options allow to set additional parameters of operation with 1-wire bus. Possible options:
-format value
presentation format of names 1-wire devices. Possible formats:
f.i
XX.YYYYYYYYYYYY (default)
fi
XXYYYYYYYYYYYY
f.i.c
XX.YYYYYYYYYYYY.ZZ
f.ic
XX.YYYYYYYYYYYYZZ
fi.c
XXYYYYYYYYYYYY.ZZ
fic
XXYYYYYYYYYYYYZZ
-cache value
cache timeout (in seconds)
-celsius | -fahrenheit | -kelvin | -rankine
temperature scale. Default Celsius.
-readonly
only allow reading of 1-wire devices
-error-print
Where information/error messages are printed
  • default mixed destination: stderr foreground / syslog background
  • syslog only
  • stderr only
  • dev/null (supress all).
  • -error-level
    What kind of information is printed
  • default errors only
  • connections/disconnections
  • all high level calls
  • data summary for each call

    ::OW::finish
    Close connection to 1-wire bus or owserver.

    ::OW::get ?path?
    Returns contents of OWFS directory as the list if path contains name OWFS directory. If path is name of OWFS file, returns of contents of this file. For files *.ALL returns a values list. If path is not defined, contents of root OWFS directory come back.

    ::OW::put path ?value?
    Puts value in OWFS file indicated in path. For files *.ALL use a value list. If /fIvalue is not defined, puts a empty string.

    ::OW::isdirectory path
    If path is the directory - return 1. Otherwise return 0.

    ::OW::isdir path
    Synonym

    of ::OW::isdirectory

    Author

    Serg Oskin (serg@oskin.ru)


    Table of Contents

    © 2003-4 Paul H. Alfille and The owfs Team
    $Id: owtcl.n.html,v 1.8 2006/06/17 22:04:11 alfille Exp $