If your sensors are powered you can dramatically improve the read speed
by writing to 'simultaneous/temperature'. Depending on your setup there
may be several of these, I read all of my sensors, then write '1' to all
of the simultaneous/temperature registers, then do all my control and
logging, then by the time I read the sensors again the conversions are
all complete and so very fast.
Writing to that bit causes all the conversions to be done at the same
time rather than sequentially but it will only work if they are powered.
Mick
On 30/03/15 16:20, Michael Kalist wrote:
HI Colin I am open to ANY suggestions. What would you recommend ?
I have since got everything working. Also down to 23 seconds per read.
This is for my home automation / monitoring project.
My raspberry pi running owfs is for all monitoring (eventually some
control) Leviton HAI for security, lighting, and audio controls,
5440 RGB DMX channels for LED control.
This what is working but want it better.
#!/bin/bash
# Read temperature from sensor
temp1=`cat /mnt/owfs/Garage_In/temperature`
temp2=`cat /mnt/owfs/Garage_Return/temperature`
temp3=`cat /mnt/owfs/Bedroom_In/temperature`
temp4=`cat /mnt/owfs/Bedroom_Return/temperature`
temp5=`cat /mnt/owfs/Floor_In/temperature`
temp6=`cat /mnt/owfs/Floor_Return/temperature`
temp7=`cat /mnt/owfs/Water_Tank_In/temperature`
temp8=`cat /mnt/owfs/Water_Tank_Return/temperature`
temp9=`cat /mnt/owfs/Loop_In/temperature`
temp10=`cat /mnt/owfs/Loop_Return/temperature`
temp11=`cat /mnt/owfs/Header_Out/temperature`
temp12=`cat /mnt/owfs/Header_Return/temperature`
temp13=`cat /mnt/owfs/Basement_In/temperature`
temp14=`cat /mnt/owfs/Basement_Return/temperature`
temp15=`cat /mnt/owfs/Mechanical/temperature`
# Update database
rrdtool update house.rrd
N:$temp1:$temp2:$temp3:$temp4:$temp5:$temp6:$temp7:$temp8:$temp9:$temp10:$temp11:$temp12:$temp13:$temp14:$temp15
#Garage
rrdtool graph garage_h.png --start -1h \
DEF:garageIN=house.rrd:garageIN:AVERAGE \
DEF:garageRTN=house.rrd:garageRTN:AVERAGE \
LINE1:garageIN#F62217:"Garage Supply Temp [deg C]" \
LINE1:garageRTN#0000FF:"Garage Return Temp [deg C]"
rrdtool graph garage_d.png --start -1d \
DEF:garageIN=house.rrd:garageIN:AVERAGE \
DEF:garageRTN=house.rrd:garageRTN:AVERAGE \
LINE1:garageIN#F62217:"Garage Supply Temp [deg C]" \
LINE1:garageRTN#0000FF:"Garage Return Temp [deg C]"
*From:*Colin Reese [mailto:colin.re...@gmail.com]
*Sent:* Sunday, March 29, 2015 5:00 PM
*To:* OWFS (One-wire file system) discussion and help
*Subject:* Re: [Owfs-developers] Temp Logging
Out of curiosity, why would you use this? Using a database with
accurate time stamps and log sizing is trivial, and apis for beautiful
html plots are easy to come by.
C
On Mar 29, 2015, at 3:42 PM, Stefano Miccoli <mo...@icloud.com
<mailto:mo...@icloud.com>> wrote:
On 29 Mar 2015, at 15:32, mike.kal...@gmail.com
<mailto:mike.kal...@gmail.com> wrote:
rrdtool create house.rrd --start N --step 300
\DS:garageIN:GAUGE:600:U:U \
DS:garageRTN:GAUGE:600:U:U \
DS:bedroomIN:GAUGE:600:U:U \
DS:bedroomRTN:GAUGE:600:U:U \
DS:floorIN:GAUGE:600:U:U \
DS:floorRTN:GAUGE:600:U:U \
DS:watertankIN:GAUGE:600:U:U \
DS:watertankRTN:GAUGE:600:U:U \
DS:loopIN:GAUGE:600:U:U \
DS:loopRTN:GAUGE:600:U:U \
DS:headerIN:GAUGE:600:U:U \
DS:headerRTN:GAUGE:600:U:U \
DS:basementIN:GAUGE:600:U:U \
DS:basementRTN:GAUGE:600:U:U \
DS:mechanicalRM:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:12 \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:12:168 \
RRA:AVERAGE:0.5:12:720 \
RRA:AVERAGE:0.5:288:365
In fact having rrdtool working is quite complicated.
Thirst thing to note: you should run “rrdtool update” at about a
300s interval (—step 300). If you fail to run ‘rrdupdate’ for 600s
(see 600 in 'DS:garageIN:GAUGE:600:U:U’) the data point will be
marked ‘unknown’ (and nothing will show up in your graphs.)
Second thing: RRA:AVERAGE:0.5:1:12 and RRA:AVERAGE:0.5:12:168 are
redundant, since you save also longer RRA’s at the same frequency
(RRA:AVERAGE:0.5:1:288 and RRA:AVERAGE:0.5:12:720).
Third thing: if you are interested in plotting MIN/MAX graphs, you
should also add RRA:MIN… and RRA:MAX definitions in your rrd.
Now suppose that the values in OWFS are correct. The best way to
check what got into your rrd is “rrdtool dump house.rrd” which
will output and XML file with the exact content of your rrd. If
you are interested in the last 24h of data, you can also issue
‘rrdtool fetch house.rrd AVERAGE —start -24h and so on. Once you
confirm that data is correctly stored in rrd, then you can start
plotting graphs.
A final comment: AFAIK, while having a single rrd file for all
your sensors is fine, this is rather an uncommon choice. Usually
you define a file for each sensor, in order to break the
read/update loop in smaller chunks; e.g.
rrdtool update Garage_Return.rrd
N:`cat /mnt/owfs/uncached/Garage_Return/temperature`
and so on… possibly in a bash for-loop over all sensors.
Bye,
Stefano
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel
Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your
hub for all
things parallel software development, from weekly thought
leadership blogs to
news, videos, case studies, tutorials and more. Take a look and
join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
<mailto:Owfs-developers@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/owfs-developers
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers