Sida 15 av 15

Re: HOWTO: RRDtool på Ubuntu (installera, logga, rita graf)

Postat: 22 jan 2014, 18:10
av Dustbunny
Hallo..

En liten fundering har jag... fixade ingång en 1-wire givare "ute temp" enligt How to/Wiki (jättebra grejj för övrigt)
och tänkte detta är super... så jag lade till en givare "termax".
När jag kör ./get_termax.sh och ./graph_temp_termax.pl så kommer inga errors eller dylikt.
men kurvan ser lite konstig ut.. slutar lixom mitt i. (bifogad bild.)

Är det så att temperaturen går utanför diagrammet?

Mvh Loggaren i Finland

Re: HOWTO: RRDtool på Ubuntu (installera, logga, rita graf)

Postat: 22 jan 2014, 19:01
av CirruZZ
Ser ut som inget nytt värde har loggats på slutet z för termax, annars är nog grafen ok.

Re: HOWTO: RRDtool på Ubuntu (installera, logga, rita graf)

Postat: 23 jan 2014, 06:09
av Dustbunny
hah sååja

Fick ändra:

DS:termax_temp:GAUGE:300:-50:60 \

till:

DS:termax_temp:GAUGE:300:-50:120 \

så nu syns hela kurvan! :)

Re: HOWTO: RRDtool på Ubuntu (installera, logga, rita graf)

Postat: 29 jan 2014, 18:24
av Dustbunny
Ah.... Nu sitter jag fast..
ska ha tre st givare i samma diagram. act_temp , acm_temp och acb_temp.
Det går att köra alla create_ac*_temp.sh och graph_acku.pl utan några som helst errors.
Men diagrammet ritar bara act_temp .
Kan någon vänlig själ hjälpa, frun börjar bli lite orolig när jag bara sitter o pillar med mina diagram :D
Jag har provat typ allt... Vill inte börja köra Logtemp igen.
och jo, går väl säkert o banta bort lite i scripten oxo.

Såhär ser acb_temp ut
directory="/home/pi/rrddata/"
filename="acb_temp.rrd"

# Check i file already exists
if [ ! -f "$directory$filename" ]
then
# File doesn't exist, create new rrd-file
echo "Creating RRDtool DB for Ackumulator botten temp sensor"
rrdtool create $directory$filename \
--step 150 \
DS:acb_temp:GAUGE:600:0:120 \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:2:2016 \
RRA:AVERAGE:0.5:4:52560 \
RRA:AVERAGE:0.5:24:175200 \
RRA:MAX:0.5:1:5760 \
RRA:MAX:0.5:2:2016 \
RRA:MAX:0.5:4:52560 \
RRA:MAX:0.5:24:175200 \
RRA:MIN:0.5:1:5760 \
RRA:MIN:0.5:2:2016 \

RRA:MIN:0.5:4:52560 \
RRA:MIN:0.5:24:175200
echo "Done!"
else
echo $directory$filename" already exists, delete it first."
fi



acm_temp

directory="/home/pi/rrddata/"
filename="acm_temp.rrd"

# Check i file already exists
if [ ! -f "$directory$filename" ]
then
# File doesn't exist, create new rrd-file
echo "Creating RRDtool DB for Ackumulator mitt temp sensor"
rrdtool create $directory$filename \
--step 150 \
DS:acm_temp:GAUGE:600:0:120 \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:2:2016 \
RRA:AVERAGE:0.5:4:52560 \
RRA:AVERAGE:0.5:24:175200 \
RRA:MAX:0.5:1:5760 \
RRA:MAX:0.5:2:2016 \
RRA:MAX:0.5:4:52560 \
RRA:MAX:0.5:24:175200 \
RRA:MIN:0.5:1:5760 \
RRA:MIN:0.5:2:2016 \
RRA:MIN:0.5:4:52560 \
RRA:MIN:0.5:24:175200
echo "Done!"
else
echo $directory$filename" already exists, delete it first."
fi


act_temp

directory="/home/pi/rrddata/"
filename="act_temp.rrd"

# Check i file already exists
if [ ! -f "$directory$filename" ]
then
# File doesn't exist, create new rrd-file
echo "Creating RRDtool DB for Ackumulator top temp sensor"
rrdtool create $directory$filename \
--step 150 \
DS:act_temp:GAUGE:600:0:120 \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:2:2016 \
RRA:AVERAGE:0.5:4:52560 \
RRA:AVERAGE:0.5:24:175200 \
RRA:MAX:0.5:1:5760 \
RRA:MAX:0.5:2:2016 \
RRA:MAX:0.5:4:52560 \
RRA:MAX:0.5:24:175200 \
RRA:MIN:0.5:1:5760 \
RRA:MIN:0.5:2:2016 \
RRA:MIN:0.5:4:52560 \
RRA:MIN:0.5:24:175200
echo "Done!"
else
echo $directory$filename" already exists, delete it first."
fi

get_acb_temp
#!/bin/bash

OutsideTempSensor="28.865F35000000"
RRDDataDirectory="/home/pi/rrddata/"
RRDDataFile="acb_temp.rrd"

# Get temps form OWFS
acb_temp=`cat /mnt/1wire/$OutsideTempSensor/temperature|sed -e s/" "//g|awk '{$1=$1 + 0.005;printf "%.2f", $1}'`

#Update RRD database
rrdtool update $RRDDataDirectory$RRDDataFile N:$acb_temp
echo $acb_temp



get_acm_temp
#!/bin/bash

OutsideTempSensor="28.747335000000"
RRDDataDirectory="/home/pi/rrddata/"
RRDDataFile="acm_temp.rrd"

# Get temps form OWFS
acm_temp=`cat /mnt/1wire/$OutsideTempSensor/temperature|sed -e s/" "//g|awk '{$1=$1 + 0.005;printf "%.2f", $1}'`

#Update RRD database
rrdtool update $RRDDataDirectory$RRDDataFile N:$acm_temp
echo $acm_temp

get_act_temp
#!/bin/bash

OutsideTempSensor="28.728C35000000"
RRDDataDirectory="/home/pi/rrddata/"
RRDDataFile="act_temp.rrd"

# Get temps form OWFS
act_temp=`cat /mnt/1wire/$OutsideTempSensor/temperature|sed -e s/" "//g|awk '{$1=$1 + 0.005;printf "%.2f", $1}'`

#Update RRD database
rrdtool update $RRDDataDirectory$RRDDataFile N:$act_temp
echo $act_temp



Grafen
#!/usr/bin/perl

use RRDs;

my $cur_time = time();
my $start_time = $cur_time - 86400; # set end time to 24 hours ago

RRDs::graph "/var/www/graph_acku.png",
"--start= $start_time",
"--end= $cur_time",
"--title= 5Ackumulatortank",
"--height= 300",
"--width= 500",
"--vertical-label= c",
"DEF:act_temp=/home/pi/rrddata/act_temp.rrd:act_temp:AVERAGE",
"DEF:acm_temp=/home/pi/rrddata/acm_temp.rrd:acm_temp:AVERAGE",
"DEF:acb_temp=/home/pi/rrddata/acb_temp.rrd:acb_temp:AVERAGE",
"COMMENT:\t\t\t\tNu Medel Max Min\\n",
"HRULE:0#0000FF",
"LINE2:act_temp#0000FF:Top\t\t\t",
"GPRINT:act_temp:LAST:%6.1lf",
"GPRINT:act_temp:AVERAGE:%6.1lf",
"GPRINT:act_temp:MAX:%6.1lf",
"GPRINT:act_temp:MIN:%6.1lf\\n";
"HRULE:0#0000FE",
"LINE2:acm_temp#FF0000:Mitt\t\t\t",
"GPRINT:acm_temp:LAST:%6.1lf",
"GPRINT:acm_temp:AVERAGE:%6.1lf",
"GPRINT:acm_temp:MAX:%6.1lf",
"GPRINT:acm_temp:MIN:%6.1lf\\n";
"HRULE:18#800080",
"LINE2:acb_temp#0000FF:Botten\t\t\t",
"GPRINT:acb_temp:LAST:%6.1lf",
"GPRINT:acb_temp:AVERAGE:%6.1lf",
"GPRINT:acb_temp:MAX:%6.1lf",
"GPRINT:acb_temp:MIN:%6.1lf\\n";



my $err=RRDs::error;
if ($err) {print "problem generating the graph: $err\n";}

print "Done!\n"



Crontab

*/2.5 * * * * /home/pi/bin/get_acb_temp.sh
*/2.5 * * * * export LANG=sv_SE.utf8 && /home/pi/bin/graph_acku.pl

*/2.5 * * * * /home/pi/bin/get_acm_temp.sh
*/2.5 * * * * export LANG=sv_SE.utf8 && /home/pi/bin/graph_acku.pl

*/2.5 * * * * /home/pi/bin/get_act_temp.sh
*/2.5 * * * * export LANG=sv_SE.utf8 && /home/pi/bin/graph_acku.pl

Re: HOWTO: RRDtool på Ubuntu (installera, logga, rita graf)

Postat: 31 aug 2014, 14:59
av Nykteristen
skulle ni vilja göra en fullständig guide hur man gör det på windows??
jag skulle vilja få det att fungera från en API-länk jag får från mitt elbolag

jag frågar för jag saknar programmeringskunskaper :(

Re: HOWTO: RRDtool på Ubuntu (installera, logga, rita graf)

Postat: 07 okt 2016, 11:26
av CDK2H
Lyckades inte hitta http://rpi-ipadress/graph_temp.png på grund av att Apache rooten numera är /var/www/html och det är alltså dit jag fick skriva i graph_temp.pl

Re: HOWTO: RRDtool på Ubuntu (installera, logga, rita graf)

Postat: 21 mar 2019, 11:19
av chekstrom
CDK2H skrev:
07 okt 2016, 11:26
Lyckades inte hitta http://rpi-ipadress/graph_temp.png på grund av att Apache rooten numera är /var/www/html och det är alltså dit jag fick skriva i graph_temp.pl

Tack detta löste mitt problem jag har försökt lösa mycket länge.

Re: HOWTO: RRDtool på Ubuntu (installera, logga, rita graf)

Postat: 24 mar 2019, 21:01
av chekstrom
Dustbunny skrev:
29 jan 2014, 18:24
Ah.... Nu sitter jag fast..
ska ha tre st givare i samma diagram. act_temp , acm_temp och acb_temp.
Det går att köra alla create_ac*_temp.sh och graph_acku.pl utan några som helst errors.
Men diagrammet ritar bara act_temp .
Kan någon vänlig själ hjälpa, frun börjar bli lite orolig när jag bara sitter o pillar med mina diagram :D
Jag har provat typ allt... Vill inte börja köra Logtemp igen.
och jo, går väl säkert o banta bort lite i scripten oxo.

Såhär ser acb_temp ut
directory="/home/pi/rrddata/"
filename="acb_temp.rrd"

# Check i file already exists
if [ ! -f "$directory$filename" ]
then
# File doesn't exist, create new rrd-file
echo "Creating RRDtool DB for Ackumulator botten temp sensor"
rrdtool create $directory$filename \
--step 150 \
DS:acb_temp:GAUGE:600:0:120 \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:2:2016 \
RRA:AVERAGE:0.5:4:52560 \
RRA:AVERAGE:0.5:24:175200 \
RRA:MAX:0.5:1:5760 \
RRA:MAX:0.5:2:2016 \
RRA:MAX:0.5:4:52560 \
RRA:MAX:0.5:24:175200 \
RRA:MIN:0.5:1:5760 \
RRA:MIN:0.5:2:2016 \

RRA:MIN:0.5:4:52560 \
RRA:MIN:0.5:24:175200
echo "Done!"
else
echo $directory$filename" already exists, delete it first."
fi



acm_temp

directory="/home/pi/rrddata/"
filename="acm_temp.rrd"

# Check i file already exists
if [ ! -f "$directory$filename" ]
then
# File doesn't exist, create new rrd-file
echo "Creating RRDtool DB for Ackumulator mitt temp sensor"
rrdtool create $directory$filename \
--step 150 \
DS:acm_temp:GAUGE:600:0:120 \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:2:2016 \
RRA:AVERAGE:0.5:4:52560 \
RRA:AVERAGE:0.5:24:175200 \
RRA:MAX:0.5:1:5760 \
RRA:MAX:0.5:2:2016 \
RRA:MAX:0.5:4:52560 \
RRA:MAX:0.5:24:175200 \
RRA:MIN:0.5:1:5760 \
RRA:MIN:0.5:2:2016 \
RRA:MIN:0.5:4:52560 \
RRA:MIN:0.5:24:175200
echo "Done!"
else
echo $directory$filename" already exists, delete it first."
fi


act_temp

directory="/home/pi/rrddata/"
filename="act_temp.rrd"

# Check i file already exists
if [ ! -f "$directory$filename" ]
then
# File doesn't exist, create new rrd-file
echo "Creating RRDtool DB for Ackumulator top temp sensor"
rrdtool create $directory$filename \
--step 150 \
DS:act_temp:GAUGE:600:0:120 \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:2:2016 \
RRA:AVERAGE:0.5:4:52560 \
RRA:AVERAGE:0.5:24:175200 \
RRA:MAX:0.5:1:5760 \
RRA:MAX:0.5:2:2016 \
RRA:MAX:0.5:4:52560 \
RRA:MAX:0.5:24:175200 \
RRA:MIN:0.5:1:5760 \
RRA:MIN:0.5:2:2016 \
RRA:MIN:0.5:4:52560 \
RRA:MIN:0.5:24:175200
echo "Done!"
else
echo $directory$filename" already exists, delete it first."
fi

get_acb_temp
#!/bin/bash

OutsideTempSensor="28.865F35000000"
RRDDataDirectory="/home/pi/rrddata/"
RRDDataFile="acb_temp.rrd"

# Get temps form OWFS
acb_temp=`cat /mnt/1wire/$OutsideTempSensor/temperature|sed -e s/" "//g|awk '{$1=$1 + 0.005;printf "%.2f", $1}'`

#Update RRD database
rrdtool update $RRDDataDirectory$RRDDataFile N:$acb_temp
echo $acb_temp



get_acm_temp
#!/bin/bash

OutsideTempSensor="28.747335000000"
RRDDataDirectory="/home/pi/rrddata/"
RRDDataFile="acm_temp.rrd"

# Get temps form OWFS
acm_temp=`cat /mnt/1wire/$OutsideTempSensor/temperature|sed -e s/" "//g|awk '{$1=$1 + 0.005;printf "%.2f", $1}'`

#Update RRD database
rrdtool update $RRDDataDirectory$RRDDataFile N:$acm_temp
echo $acm_temp

get_act_temp
#!/bin/bash

OutsideTempSensor="28.728C35000000"
RRDDataDirectory="/home/pi/rrddata/"
RRDDataFile="act_temp.rrd"

# Get temps form OWFS
act_temp=`cat /mnt/1wire/$OutsideTempSensor/temperature|sed -e s/" "//g|awk '{$1=$1 + 0.005;printf "%.2f", $1}'`

#Update RRD database
rrdtool update $RRDDataDirectory$RRDDataFile N:$act_temp
echo $act_temp



Grafen
#!/usr/bin/perl

use RRDs;

my $cur_time = time();
my $start_time = $cur_time - 86400; # set end time to 24 hours ago

RRDs::graph "/var/www/graph_acku.png",
"--start= $start_time",
"--end= $cur_time",
"--title= 5Ackumulatortank",
"--height= 300",
"--width= 500",
"--vertical-label= c",
"DEF:act_temp=/home/pi/rrddata/act_temp.rrd:act_temp:AVERAGE",
"DEF:acm_temp=/home/pi/rrddata/acm_temp.rrd:acm_temp:AVERAGE",
"DEF:acb_temp=/home/pi/rrddata/acb_temp.rrd:acb_temp:AVERAGE",
"COMMENT:\t\t\t\tNu Medel Max Min\\n",
"HRULE:0#0000FF",
"LINE2:act_temp#0000FF:Top\t\t\t",
"GPRINT:act_temp:LAST:%6.1lf",
"GPRINT:act_temp:AVERAGE:%6.1lf",
"GPRINT:act_temp:MAX:%6.1lf",
"GPRINT:act_temp:MIN:%6.1lf\\n";
"HRULE:0#0000FE",
"LINE2:acm_temp#FF0000:Mitt\t\t\t",
"GPRINT:acm_temp:LAST:%6.1lf",
"GPRINT:acm_temp:AVERAGE:%6.1lf",
"GPRINT:acm_temp:MAX:%6.1lf",
"GPRINT:acm_temp:MIN:%6.1lf\\n";
"HRULE:18#800080",
"LINE2:acb_temp#0000FF:Botten\t\t\t",
"GPRINT:acb_temp:LAST:%6.1lf",
"GPRINT:acb_temp:AVERAGE:%6.1lf",
"GPRINT:acb_temp:MAX:%6.1lf",
"GPRINT:acb_temp:MIN:%6.1lf\\n";



my $err=RRDs::error;
if ($err) {print "problem generating the graph: $err\n";}

print "Done!\n"



Crontab

*/2.5 * * * * /home/pi/bin/get_acb_temp.sh
*/2.5 * * * * export LANG=sv_SE.utf8 && /home/pi/bin/graph_acku.pl

*/2.5 * * * * /home/pi/bin/get_acm_temp.sh
*/2.5 * * * * export LANG=sv_SE.utf8 && /home/pi/bin/graph_acku.pl

*/2.5 * * * * /home/pi/bin/get_act_temp.sh
*/2.5 * * * * export LANG=sv_SE.utf8 && /home/pi/bin/graph_acku.pl


Liknande detta jag oxå skulle behöva en förklaring om. Har du fått fatt i en lösning så får du gärna dela med dig.