Owfs Installation on Debian

How I installed OWFS on my debian box (my version is the DS9490 USB)

All stuff source is grabbed from here but just in case it dissapears one day I add to my wiki

Get OWFS package from official site

Install dependency for compilation

apt-get install libusb-dev libfuse-dev fuse-utils

install dir will be /usr/local/bin/ (that's what I choosed for my debian)

configure for compilation and usb use

./configure --enable-debian --prefix=/usr/local --enable-usb
make
make install

Note that I also compiled the package on my ReadyNas and after installed compile tools the syntax needed was
./configure --build=sparc-linux target=sparc-linux --enable-debian --prefix=/usr/local --enable-usb

Add to /etc/modprobe.d/blacklist (not sure it's needed but it's working)

blacklist ds9490r
blacklist ds2490
blacklist wire

create file /mnt/owfs for mounting owfs file system

mkdir /mnt/owfs

I'm using owfs as a owserver (the one that hosts the USB device) and one ore more owfs client (the one that hosts the usb device and one ore more linux box). the owserver is running on port 3001 in usb mode

One day I needed to write some c code with owcapi but after link it was unable to find the shared library. So I checked that /usr/local/lib was referenced into /etc/ld.co.conf.d/libc.conf then issued a

ldconfig

Then I created the start/stop daemon for owserver (only used on the owserver host)

/etc/init.d/owserver

#! /bin/sh

case "$1" in
  start)
        /usr/local/bin/owserver -u -p 3001
        ;;
  stop)
        killall owserver
        ;;
  *)
        echo "Usage: $N {start|stop}" >&2
        exit 1
        ;;
esac
exit 0

and, I created the start/stop daemon for owfs (to be created on each owfs clients)

/etc/init.d/owfs

#! /bin/sh
case "$1" in
  start)
        # remember to put your owserver server hostname here 
        /usr/local/bin/owfs -s servername:3001 -m /mnt/owfs
        ;;
  stop)
        killall owfs
        ;;
  *)
        echo "Usage: $N {start|stop}" >&2
        exit 1
        ;;
esac
exit 0

now enable owserver boot time issue a (on the owserver server)

cd /etc/init.d
update-rc.d owserver defaults

to enable owfs client on a host at boot time issue a (on the client)

cd /etc/init.d
update-rc.d owfs defaults

to remove owfs or owserver at boot time issue a

cd /etc/init.d
update-rc.d owserver remove
update-rc.d owfs remove

To start or stop one of the service issue a (for example)

/etc/init.d/owfs stop
/etc/init.d/owserver start

Created some usefull aliases in by .bashrc

alias ls1w='grep . /mnt/owfs/uncached/*/type'
alias ls1wpio='grep . /mnt/owfs/uncached/*/PIO.A /mnt/owfs/uncached/*/PIO.B'
alias ls1wtemp='grep . /mnt/owfs/uncached/*/temperature'

check it out ?

root@eeebox:~# ls1w
/mnt/owfs/uncached/12.0AB668000000/type:DS2406
/mnt/owfs/uncached/12.A97F68000000/type:DS2406
/mnt/owfs/uncached/12.FEB568000000/type:DS2406
/mnt/owfs/uncached/28.1775C7010000/type:DS18B20
/mnt/owfs/uncached/81.C0E221000000/type:DS1420
root@eeebox:~# ssh debianslug
root@debianslug:~# ls1wtemp
     19.6875
root@debianslug:~# ls1wpio
/mnt/owfs/uncached/12.0AB668000000/PIO.A:1
/mnt/owfs/uncached/12.A97F68000000/PIO.A:1
/mnt/owfs/uncached/12.FEB568000000/PIO.A:1
/mnt/owfs/uncached/12.0AB668000000/PIO.B:1
/mnt/owfs/uncached/12.A97F68000000/PIO.B:1
/mnt/owfs/uncached/12.FEB568000000/PIO.B:1
root@debianslug:~# echo 0 >/mnt/owfs/12.0AB668000000/PIO.B
root@debianslug:~# logout
Connection to debianslug closed.
root@eeebox:~# ls1wpio
/mnt/owfs/uncached/12.0AB668000000/PIO.A:1
/mnt/owfs/uncached/12.A97F68000000/PIO.A:1
/mnt/owfs/uncached/12.FEB568000000/PIO.A:1
/mnt/owfs/uncached/12.0AB668000000/PIO.B:0
/mnt/owfs/uncached/12.A97F68000000/PIO.B:1
/mnt/owfs/uncached/12.FEB568000000/PIO.B:1
root@eeebox:~#

So cool no ? I love this system

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License