Personal tools
You are here: Home Members gillesgigan Sensor Gateway OWFS support
Document Actions

OWFS support

by Gilles Gigan last modified 2008-02-29 17:33

Guide to installing 1-wire software

Options


There are several options that can be used to access 1-wire sensors form a linux host:
  • kernel driver: as of 2.6.18, the kernel drivers seemed buggy. Three modules can be used: wire, ds2490, and possibly w1_therm. Only wire and ds2490 were loaded automatically. They create a sysfs file hierarchy (in /sys/class/w1_master/*) similar to owfs. However, only a single temperature sensro was detected. Loading w1_therm only made things worse.
  • 1-wire JAVA SDK: as of 26/09/07, this SDK does NOT support the DS9490 USB adapter, only the serial adapter DS9097U is supported.
  • OWFS: this is the only working option as far as I know.

OWFS installation


Make sure the 'ds2490' and 'wire' kernel modules wont be loaded if they exist. Otherwise they will get in the way of OWFS. Move them to the root directory and depmod -ae again.
Make sure  FUSE is either compiled in the kernel or as a module (see kernel compilation).
Install fuser, libfuse & libusb development files, download the owfs source code, unpack and compile:

apt-get install libfuse-dev libusb-dev fuse-utils
wget "http://optusnet.dl.sourceforge.net/sourceforge/owfs/owfs-2.6p7.tar.gz"
tar -zxvf owfs-2.6p7.tar.gz && cd owfs-2.6p7
./configure --disable-owhttpd --disable-owftpd  --disable-owserver --disable-ownet --disable-owtap --disable-owmon --disable-owcapi --disable-swig --disable-owperl --disable-owphp --disable-owpython --disable-owtcl --enable-owfs --enable-cache --disable-zero --enable-usb --disable-parport --disable-profiling --disable-debug --disable-tai8570 --disable-i2c --disable-thermocouple --disable-ha7
make
make install
add "--prefix=/usr/local" to ./configure to have owfs installed in /usr/local instead of /opt/owfs

If fuse is compiled as a module, make sure it is loaded and will be loaded automatically on startup. Create a mount point for owfs
modprobe fuse && echo "fuse" >> /etc/modules; mkdir /mnt/w1
Make sure all the 1-wire adapters are connected to the gateway and check that all is working with:
/opt/owfs/bin/owfs -uall  /mnt/w1 && ls -la /mnt/w1/*
umount /mnt/w1

Setting up permissions


To allow sensor_user to mount and access owfs, create a owfs group, add sensor_user and setup udev (restart udevd only if inotify isnt compile in the kernel)
groupadd owfs && usermod -aG fuse,owfs sensor_user
echo 'ATTRS{idProduct}=="2490", ATTRS{idVendor}=="04fa", OWNER="root", GROUP="owfs", MODE="0660"' >> /etc/udev/rules.d/20-owfs.rules
killall udevd && udevd --daemon
chgrp owfs /mnt/w1
chmod 775 /mnt/w1

Logout & login again, sensor_user shoud now be able to mount and access the 1-wire device with:

/opt/owfs/bin/owfs -uall  /mnt/w1 && ls -la /mnt/w1/*




Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: