Use proper 1-wire master - DS2482-800 - with Domoticz ?

Moderators: fantom, leecollings

Post Reply
User avatar
Redguy
Posts: 33
Joined: Saturday 19 November 2016 21:26
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: Maassluis
Contact:

Use proper 1-wire master - DS2482-800 - with Domoticz ?

Post by Redguy »

My "old" sensor bus uses loads of DS1820 sensors and other 1-wire devices, connected to the raspberry pi through some DS2482-800 - 8-Channel 1-Wire Master chips. These are connected to the rpi through the I2C bus, which works great..


Does domoticz support the use of these chips directly ? or only through the use of OWFS ?
djmoon
Posts: 14
Joined: Wednesday 16 March 2016 16:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Use proper 1-wire master - DS2482-800 - with Domoticz ?

Post by djmoon »

Hi,

I've such a chip too with a Rpi and it work fine now from... yesterday !

I don't find other solution than OWFS.

In resume :
Configure I2C
Installing OWFS
Create proper folder
Setup OWFS
Put OWFS on startup
Reboot
In domoticz, Add a "One Wire" hardware that can read value directly in the folder previously created for OWFS.

Complete guide :

Installation OWFS (not sure python-ow needed)
sudo apt-get install owfs python-ow

Config :
sudo nano /etc/owfs.conf

Comment out the following line
# server: FAKE = DS18S20,DS2405

Find the following section
# USB device: DS9490
#server: usb = all
#

Insert the line below to enable i2c support.
server: device = /dev/i2c-1

Find the section titled
######################### OWFS ##########################

Remove the hashes from the lines
mountpoint = /mnt/1wire
allow_other

Save your changes and exit the nano editor.

Create destination folder
sudo mkdir /mnt/1wire

To make it possible to access the 1wire devices without root privileges you'll have to modify the FUSE settings. Open the fuse configuration file:

sudo nano /etc/fuse.conf
Change

#user_allow_other
to

user_allow_other


Launch OWFS
sudo owfs --i2c=ALL:ALL --allow_other /mnt/1wire/

Autorun OWFS

Create the startup script in /etc/init.d/

cd /etc/init.d
sudo nano start1wire.sh

Add the folowing to the file (remove the first space on each row):

#!/bin/bash

### BEGIN INIT INFO
# Provides: start1wire
# Required-Start: $local_fs $syslog
# Required-Stop: $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start OWFS at boot time
# Description: Start OWFS at boot time
### END INIT INFO

# Starts OWFS
owfs --i2c=ALL:ALL --allow_other /mnt/1wire

To make the script executable, run the following command:

sudo chmod +x start1wire.sh
Add the script to the default runlevel.

sudo update-rc.d start1wire.sh defaults
User avatar
Redguy
Posts: 33
Joined: Saturday 19 November 2016 21:26
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: Maassluis
Contact:

Re: Use proper 1-wire master - DS2482-800 - with Domoticz ?

Post by Redguy »

I have had such a system active for quite a while connected to my pi before switching to domoticz, mainly for monitoring temperatures in my heating systems and guarding my water leakage sensors etc..

i am in doubt about reusing the system or converting the "hub" nodes in that network to MySensors nodes, but i find using 1-wire devices with arduinos a huge pain in the butt compared to OWFS.
Lomax
Posts: 32
Joined: Monday 18 May 2015 17:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: Use proper 1-wire master - DS2482-800 - with Domoticz ?

Post by Lomax »

djmoon wrote:Hi,

I've such a chip too with a Rpi and it work fine now from... yesterday !

I don't find other solution than OWFS.

In resume :
Configure I2C
Installing OWFS
Create proper folder
Setup OWFS
Put OWFS on startup
Reboot
In domoticz, Add a "One Wire" hardware that can read value directly in the folder previously created for OWFS.
That's a great guide! Just one detail: I don't think you need to pass any arguments to owfs when starting it - these are already set in the owfs.conf file. In my init.d script I only have "owfs" where you have "owfs --i2c=ALL:ALL --allow_other /mnt/1wire" and this seems to work just the same (provided that those settings have been made in owfs.conf of course).
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests