Skip to content

OneWire

Sébastien Gallou edited this page Apr 26, 2017 · 19 revisions

OneWire

This plugin provides support for the 1-wire network, getting access to affordable devices.

Supported platforms

For now, only Linux is supported, by kernel mode or OWFS mode.

Kernel mode provides access to only a few devices, but is suitable without adapter (devices directly connected to a GPIO pin). Due to the use of a GPIO, this mode can not be use for a big network.

OWFS mode provides access to many devices, but requires an adapter like the USB-adapter DS9490 (serial adapters also exist). Using a specialized chip for network interface, this mode can be used for big network.

Yadoms recommends to use OWFS mode.

Supported devices

Device Name Device ID 1-wire Family Kernel mode OWFS mode
High Precision Digital Thermometer DS18S20 0x10 - x
Thermochron temperature logging iButton DS1921 0x21 - x
Econo Digital Thermometer DS1822 0x22 - x
Programmable Resolution Digital Thermometer with ID DS1825 0x3B - x
Programmable Resolution Digital Thermometer DS18B20 0x28 - x
Addressable Switch DS2405 0x05 - x
MicroLAN Coupler DS2409 0x1F - x
Dual Addressable Switch with 1kbit Memory DS2406 0x12 - x
Hidable Dual Addressable Switch with 1kbit Memory DS2407 0x12 - x
8 Channels Addressable Switch DS2408 0x29 x x
Digital Potentiometer DS2890 0x2C - x
Digital Thermometer with Sequence Detect and PIO DS28EA00 0x42 - x
Dual Channel Addressable Switch DS2413 0x3A x x
EEPROM chip (4096-bit) with seven address inputs DS28E04 0x1C - x
4kbit RAM with Counter DS2423 0x1D - x
Quad A/D Converter DS2450 0x20 - x
Smart Battery Monitor DS2438 0x26 - x
High-Precision Li+ Battery Monitor DS2760, DS2761, DS2762 0x30 - x

Help us to improve this table by posting on our forum.

Note that some devices are frequently used in common schematics, so helper are provided (thank to OWFS) : for example, DS2438 (battery monitor chip) is frequently used with a humidity sensor to read humidity by 1-wire network, or barometer, or solar sensor. For this chip, Yadoms provides all values : raw voltage, humidity, solar, barometer.

Kernel mode

This mode requires that 1-wire kernel modules are enable :

sudo modprobe w1-gpio
sudo modprobe w1-therm

OWFS mode

This mode requires that OWFS tools are installed on your target. Here are the steps to install :

Install OWFS and Fuse :

sudo apt-get install owfs ow-shell fuse

Edit OWFS configuration file :

sudo nano /etc/owfs.conf
  • Comment line server: FAKE = ...
  • Uncomment line server: ... corresponding to your adapter
  • Uncomment line mountpoint = /mnt/1wire
  • Uncomment line allow_other

(Note : Ctrl-o to save the file, Ctrl-x to quit nano)

Edit Fuse configuration file :

sudo nano /etc/fuse.conf

Uncomment line user_allow_other

Create mount point :

sudo mkdir /mnt/1wire

Restart OWServer :

sudo service owserver restart

Start OWFS :

sudo owfs

To make OWFS autostart with system, create a file named owfs located at /etc/init.d/ as administrator

sudo nano /etc/init.d/owfs

Paste this content :

#!/bin/sh
### BEGIN INIT INFO
# Provides: owfs
# Required-Start: $remote_fs $syslog $network $named
# Required-Stop: $remote_fs $syslog $network $named
# Should-Start: owfs
# Should-Stop: owfs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: 1-wire file system mount & update daemon
# Description: Start and stop 1-wire file system mount & update daemon.
### END INIT INFO
CONFFILE=/etc/owfs.conf
DESC="1-Wire file system mount"
NAME="owfs"
DAEMON=/usr/bin/$NAME
case "$1" in
start)
echo "Starting $NAME"
$DAEMON -c $CONFFILE
;;
stop)
echo "Stopping $NAME"
killall $NAME
;;
*)
echo "Usage: $N {start|stop}" >&2
exit 1
;;
esac
exit 0

Save and close file. Make this script executable :

sudo chmod +x /etc/init.d/owfs
sudo update-rc.d owfs defaults
sudo update-rc.d owserver defaults

Clone this wiki locally