Table of Contents

Name

owperl - perl interface for the 1-wire filesystem

Synopsis

OW.pm
use OW ;
OW::init( interface );
OW::get( path );
OW::put( path , value );
OW::finish();

Description

owperl is a perl module 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 perl strings. Development here, and support for new devices, will progress with those projects.

owperl is created by SWIG (www.swig.org) which can be easily modified to support other programming languages.

Functions

OW::init( interface )

interface
Location of the 1-wire bus:
"u"
Direct connection to the 1-wire interface on the USB port -- DS9490
/dev/ttySx
Direct connection to a 1-wire interface on the serial port -- DS9097U or DS9097
port | :port | IPaddress:port
Location of an owserver daemon that connects to the 1-wire bus. Multiple owperl 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 owperl except in trivial applications.

Sets the tcp port the web server runs on. Access with the URL http://servernameoripaddress:portnum

-h --help

Shows this summary of options.

-d --device "deviceport"

Sets the serial port. It should have a LINK, DS9097U or DS9097 (passive adapter) attached. The "-d" is implied if two arguments are supplied. (See examples). The -d and -u options are mutually exclusive.

-u --usb

Use the USB adapter (DS9490) as 1-wire bus master. An optional number 1,2,... specifies which adapter to use if more than one is present.

-t --timeout "seconds"

Set the number of seconds that volitile data (measured values like temperature and voltage) should be cached before requerying the BUS. More stable values will be saved ten times longer (switch settings, memory contents). 10 seconds is the default.

-C --Celsius | -F --Fahrenheit | -K --Kelvin | -R --Rankine

Temperature scale used for data output. Celsius is the default.

-f --format "f[.]i[[.]c]"

Display format for the 1-wire devices. Each device has a 8byte address, consisting of 1byte f amily code, 6 byte I D number, and 1 byte C RC checksum.

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.

--background | --foreground

Whether the program releases the console and runs in the .I background after evaluating command line options. background is the default.

-V --version

Version of this program and related libraries.

Example

owhttpd -p 3001 -d /dev/ttyS0

Notes

See http://owfs.sourceforge.net for the current version.

Author

Paul Alfille (palfille@earthlink.net)


Table of Contents