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