My Pi Logs Temperature and Humidity every Minute into a csv File and in a RRDtool Database:
I created this RRDtool Database like this:
rrdtool create /home/pi/Desktop/GarageData.rrd --step 60
DS:Temperatur:GAUGE:300:U:U
DS:Humidity:GAUGE:300:U:U
RRA:AVERAGE:0.5:12:24
RRA:AVERAGE:0.5:288:31
So the database should accept one value every 60 seconds
I am logging with a python 3 script. Here is the important part.
import Adafruit_DHT
from rrdtool import update as rrd_update
humidity, temperatur = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, '22')
rrd_update('/home/pi/Desktop/GarageData.rrd', 'N:%s:%s' %(temperatur, humidity))
when using rrdtool fetch GarageData.rrd AVERAGE r300
I am only seeing nan
Temperatur Humidity
1469111040: nan nan
1469128320: nan nan
1469145600: nan nan
1469162880: nan nan
1469180160: nan nan
1469197440: nan nan
and when plotting the Database.... nothing is shows up in the plot.
Where is the problem in my script? I thought I did everything exactly like in this Tutorial