There are several kinds of software available to work with 1wire technology, I'll be detailing those I know. Please feel free to add or edit what you see.

Introduction

1wire technology gives you the chance to read temperatures, humidities, even detect rain and count door closures at great distances. Some of the software available for Linux makes controlling these things so simple as to nearly be trivial. And like always, there's choice and style.

OWFS

OWFS is a set of tools for reading/writing to the 1wire network. It's primary and IMO most clever one is OWFS itself: it reads the network and creates a directory of all that it sees. Reading a temperature becomes trivial.

Here's how I turn on the exhaust fan in my trailer:

echo "1" > /var/1wire/1F.38C704000000/main/05.62E531000000/PIO

Here's how I turn it off:

echo "0" > /var/1wire/1F.38C704000000/main/05.62E531000000/PIO

Did I leave the fan on, or off?

cat /var/1wire/1F.38C704000000/main/05.62E531000000/PIO
0

No, it's off. Good thing, too- might rain.

The project's located at: http://owfs.sourceforge.net/

owhttpd

  • This part of the package listens on port 81 like a web server, allowing you to 'walk around' the net and read values, setting some too.

(screenshot)

owserver

  • This part lets you summarize the activity on one machine that actually connects to the 1wire network, and remotely control it from across the globe.

owperl

  • A module that integrates nicely into Perl for working with the network.

owpython

  • A module that integrates nicely into Python.

owphp

  • A set of bindings for PHP

owtcl

  • TCL bindings.

Building under Dapper

Note: Since Precise there is an official owfs package.

OWFS sure takes the work out of dealing with the network, and it provides a lot of options for other languages and protocols. Hey, let's build on on Dapper, shall we?

What follows is largely based on Tomasz' Howto at http://tomasz.korwel.net/2006/07/02/owfs-instalation-on-ubuntu-606/

Install required software

The Universe repository is required to get fuse-utils.

 apt-get install automake autoconf autotools-dev gcc g++ \
      libtool libusb-dev fuse-utils libfuse-dev swig \
       python-dev tcl8.4-dev php5-dev

Get OWFS: Notice the version number will change.

cd /usr/src
wget http://umn.dl.sourceforge.net/sourceforge/owfs/owfs-2.8p7.tar.gz
or using current sourceforge redirections:
http://downloads.sourceforge.net/project/owfs/owfs/2.8p7/owfs-2.8p7.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fowfs%2F&ts=1299793513&use_mirror=ignum

Extract the file:

tar zxpf owfs-2.8p7.tar.gz

Compile and install:

cd owfs-2.8p7
./configure
make && make install

Mount the 1wire filesystem:

mkdir /var/lib/1wire
modprobe fuse
/opt/owfs/bin/owfs -d /dev/ttyS0 -m /var/lib/1wire
Add the flag --allow_other to allow other uses apart from root to access the 1-wire devices.

See if it's there:

ls /var/1wire
09.CF9EC8010000
10.64502F000800
alarm
bus.0
simultaneous
statistics
structure
system
uncached

The 1F.XXXXXXXXXXXX devices there are hubs, that have other devices 'behind' them. The 10.64502F000800 above is a device for reading temperature. If you see something that looks similar, it's done.

Several options are available, too; things specific to hardware, as well as whether to build the other packages, etc at the OWFS site.

Other Software

I've not used anything else, though I know there are alternatives, even alternatives for Windows, if you're so afflicted. Smile :)

An Example: CounterMoon.org

I'm working on a trailer that uses Ubuntu, OWFS, and 1Wire technology. Come see what it looks like: 1wireAppCountermoon.org

Back to the Meta 1wire


1wireSoftware (last edited 2012-08-28 11:25:42 by 84)