<html xmlns:m="http://schemas.microsoft.com/office/2004/12/omml">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--a:link
        {mso-style-priority:99;}
span.MSOHYPERLINK
        {mso-style-priority:99;}
a:visited
        {mso-style-priority:99;}
span.MSOHYPERLINKFOLLOWED
        {mso-style-priority:99;}
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:Calibri;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {font-family:Calibri;
        color:windowtext;}
span.EmailStyle18
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Here is my read script (started life in a
NSLU2 –no runs under ubuntu), once started it loops every 90 seconds and
uses a simple bash script. Each section has a description and you can see
how to convert the counts into a real number. See Accum_flow as the counts
divided by 4100 = litres in my case</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>#!/bin/bash</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>OWWRITE="/opt/owfs/bin/owwrite -s
3001"</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>OWREAD="/opt/owfs/bin/owread -s
3001"</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>AWK="/usr/bin/awk"</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>hwclock -s</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>echo "`date` -- 1Wire Data Collection
Script Started -- " >>/var/scripts/nohup.out</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>while true</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>do</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>### Force Simulataneous 1wire
conversion ###</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>$OWWRITE simultaneous/voltage 1</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>$OWWRITE simultaneous/temperature 1</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>### Read 1wire data and convert into
engineering units #ph was 2.6667 offset was .3##</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>PH=$($OWREAD 20.022408000000/volt.A | $AWK
' {printf "%4.2f\n",(($0-0.0)-1)/1.6+5.5 }')</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>US=$($OWREAD 20.022408000000/volt.B | $AWK
'{printf "%3.0f\n",(($0-0.0)*100)}')</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>ORP=$($OWREAD 20.022408000000/volt.D |
$AWK '{printf "%3.0f\n",(($0-0.0)*99)}')</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>TempAqua=$($OWREAD 20.022408000000/volt.C
| $AWK '{printf "%3.1f\n",(((($0-0.0)-1)*5)+20)}')</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>LITRES=$($OWREAD 20.952A05000000/volt.D |
$AWK '{printf "%3.1f\n",(($0-2.94)*62)}')</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>TempOut=$($OWREAD
28.11BF97000000/temperature | $AWK '{printf "%3.1f\n",($0)}')</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>TempAmb=$($OWREAD
28.D70598000000/temperature | $AWK '{printf "%3.1f\n",($0)}')</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>TempRes=$($OWREAD 28.A6EE97000000/temperature
| $AWK '{printf "%3.1f\n",($0)}')</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Accum_flow=$($OWREAD
1D.EBEF0900000034/counters.A | $AWK '{printf "%g\n",($0/4100)}')</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>### Out of Range Error trap -Do not log
data ###</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>PHtest=`echo $PH |cut -f1 -d'.'`</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>if [ -z $PHtest ] || [ $PHtest -gt 8 ];
then</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>echo "`date` PH reading error
$PH" >>/var/scripts/nohup.out</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>PH="U"</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>fi</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>ORPtest=`echo $ORP |cut -f1 -d'.'`</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>if [ -z $ORPtest ] || [ $ORPtest -gt 600
]; then</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>echo "`date` ORP reading error
$ORP" >>/var/scripts/nohup.out</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>ORP="U"</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>fi</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>UStest=`echo $</span></font><font size=2
color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>US</span></font><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'> |cut -f1 -d'.'`</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>if [ -z $UStest ] || [ $UStest -gt 500 ];
then</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>echo "`date` Conductivity reading
error $US" >>/var/scripts/nohup.out</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>US="U"</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>fi</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>TEMPtest=`echo $TempAqua |cut -f1 -d'.'`</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>if [ -z $TEMPtest ] || [ $TEMPtest -gt 33
] ; then</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>echo "`date` Aquarium Temp error $TempAqua"
>>/var/scripts/nohup.out</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>TempAqua="U"</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>fi</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>### Calculations based upon Data ###</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>C12=$($AWK -v PH="$PH" '{printf
"%3.1f\n",((3*$0)*(10^(7-PH)))}' /var/scripts/kh_value.txt)</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Todayflow=$($AWK -v AF="$Accum_flow"
'{printf "%g\n",(AF-$0)}' /var/scripts/lastflow.txt)</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Weekflow=$($AWK -v AF="$Accum_flow"
'{printf "%g\n",(AF-$0)}' /var/scripts/weekflow.txt)</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>### Push Data into NEW Trend Files ###</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>rrdtool update /var/www/rrd/aqua_ph.rrd
N:$PH</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>rrdtool update /var/www/rrd/aqua_orp.rrd
N:$ORP</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>rrdtool update /var/www/rrd/aqua_temp.rrd N:$TempAqua:$TempRes</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>rrdtool update /var/www/rrd/aqua_co2.rrd
N:$C12</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>rrdtool update /var/www/rrd/aqua_cond.rrd
N:$US</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>rrdtool update /var/www/rrd/aqua_level.rrd
N:$LITRES</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>rrdtool update /var/www/rrd/weather_temp.rrd
N:$TempAmb:$TempOut</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>rrdtool update /var/www/rrd/aqua_waterchange.rrd
N:$Todayflow:$Weekflow</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>sleep 90</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>done</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b>
rrd-users-bounces@lists.oetiker.ch [mailto:rrd-users-bounces@lists.oetiker.ch] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Eduard<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, February 17, 2009
7:00 AM<br>
<b><span style='font-weight:bold'>To:</span></b> rrd-users@lists.oetiker.ch<br>
<b><span style='font-weight:bold'>Subject:</span></b> [rrd-users] help with
NSLU2, OWFS and RRD for DS2423 counter</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Calibri><span
style='font-size:11.0pt'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Calibri><span
style='font-size:11.0pt'>Are there users who are using RRD and OWFS with a
NSLU2 ?</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Calibri><span
style='font-size:11.0pt'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Calibri><span
style='font-size:11.0pt'> I’m interested in how to update a RRD with
data from a DS2423 counter. Does anybody have some working examples
for me?</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Calibri><span
style='font-size:11.0pt'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Calibri><span
style='font-size:11.0pt'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Calibri><span
style='font-size:11.0pt'>Kind regards,<br>
<br>
Eduard</span></font></p>
</div>
</body>
</html>
<P><FONT SIZE=2 FACE="Arial">No virus found in this incoming message.<BR>
Checked by AVG - www.avg.com<BR>
Version: 8.0.237 / Virus Database: 270.10.24/1954 - Release Date: 02/15/09 18:09:00<BR>
</FONT></P>
<P><FONT SIZE=2 FACE="Arial"> </FONT> </P>