luckygray
Posts: 4
Joined: Thu Jan 17, 2013 10:12 pm

owserver, owhttpd /etc/owfs.conf for 1wire w1_gpio w1_therm

Thu Jan 17, 2013 11:10 pm

I do not manage to access my DS18S20 via owserver/owhttpd and would be very thankful for any help.

I attached two DS18S20 to the GPIO 2, 6, and 7 to VDD, GND and DQ.
I successfully installed the wire, w1_gpio and w1_therm modules
and can read the temperatures with a python script:
----------------------------------------------------------------------
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# read 1wire temperatures
import sys
# Open 1-wire slaves list for reading
file = open( '/sys/devices/w1_bus_master1/w1_master_slaves' )
# Read 1-wire slaves list
w1_slaves = file.readlines()
# Close 1-wire slaves list
file.close()
# Print header for results table
print( 'Sensor ID | Temperature' )
print( '-----------------------------' )
# Repeat following steps with each 1-wire slave
for line in w1_slaves:
w1_slave = line.split( "\n" )[0] # Extract 1-wire slave
file = open( '/sys/bus/w1/devices/' + str( w1_slave ) + '/w1_slave' ) # Open 1-wire slave file
filecontent = file.read() # Read content from 1-wire slave file
file.close() # Close 1-wire slave file
stringvalue = filecontent.split( "\n" )[1].split(" ")[9] # Extract temperature string
temperature = float( stringvalue[2:] ) / 1000 # Convert temperature value
print( str( w1_slave ) + ' | %5.3f °C' % temperature ) # Print temperature
# Quit python script
sys.exit(0)
------------------------------------------------------------------------------------

Or simply in the file system:
$ ls /sys/bus/w1/devices/
10-000802292554 10-000802294bc9 w1_bus_master1
$ cat /sys/bus/w1/devices/10-000802292554/w1_slave
2f 00 4b 46 ff ff 01 10 ca : crc=ca YES
2f 00 4b 46 ff ff 01 10 ca t=23687



Now I installed owserver and owhttpd with:
sudo apt-get install owserver owhttpd

Here is the /etc/owfs.conf file:
--------------------------------------------------------------------------------------
######################## SOURCES ########################
! server: server = localhost:4304
server: FAKE = DS18S20,DS2405
# USB device: DS9490
#server: usb = all
# Serial port: DS9097
#server: device = /dev/ttyS1
# owserver tcp address
#server: server = 192.168.10.1:3131
######################### OWFS ##########################
# mountpoint = /mnt/1wire
# allow_other
#########################################################
http: port = 2121
ftp: port = 2120
# for local access:
server: port = localhost:4304
# for external access:
server: port = 192.168.1.51:4304
------------------------------------------------------------------------------------

With this /etc/owfs.conf I see the fake DS18S20 and DS2405 in a browser on another machine with the
URL:
http://<raspis-ip>:2121/
So owhttpd is working.

I do not know what to put in the /etc/owfs.conf file for this setup (wire, w1_gpio, w1_therm)
since it is not an USB, nor a serial device, nor serial link, nor a HA7, nor a etherweather...

TIA
--
luckygray

vincewebb
Posts: 3
Joined: Sun Jan 27, 2013 2:23 am

Re: owserver, owhttpd /etc/owfs.conf for 1wire w1_gpio w1_th

Sun Jan 27, 2013 2:51 am

I have owserver talking OK to three DS18B20 probes, they are pretty much the same as your DS18S20 however my set up is different.

Unlike you I didn't connect the probes direct to the pi's GPIO pins. I have them connected via a DS2482-100 on a daughter board from sheepwalk electronics:
http://www.sheepwalkelectronics.co.uk/RPI2.shtml

To get it all talking I did the equivalent of:
sudo modprobe i2c-bcm2708
sudo modprobe i2c-dev

Rather than issue the above modprobe commands I instead edited
/etc/modules
and
/etc/modprobe.d/raspi-blacklist.conf


In /etc/owfs.conf I added the lines:

# I2C device: DS2482-100
# If Raspberry Pi version 1
server: device = /dev/i2c-0
# If Raspberry Pi version 2
#server: device = /dev/i2c-1

Good luck

Galaxynik
Posts: 43
Joined: Mon Jan 02, 2012 2:55 pm

Re: owserver, owhttpd /etc/owfs.conf for 1wire w1_gpio w1_th

Fri Sep 13, 2013 10:43 pm

what version of OW are you using (currently trying to get 2.9p1 running) I can get owfs and owhttp running with a similar setup but struggling with owserver (I want to use perl to read)

SunSeaAndPalms
Posts: 1
Joined: Thu Feb 20, 2014 6:56 am

Re: owserver, owhttpd /etc/owfs.conf for 1wire w1_gpio w1_th

Thu Feb 20, 2014 7:01 am

Have smb succeeded binding OWFS on w1_gpio results?

Return to “Interfacing (DSI, CSI, I2C, etc.)”