Open ergcgs opened 7 years ago
Might have to take a closer look but first pass/gut reaction is that if the values are there, the command is ok, then it might either be permissions on the RRD file and/or something like SELinux which may prevent the data from being properly "imported"/"entered". Especially because it is going to the /var/www/html dir.
Ok, so i got home from work today and just refreshed the website and voila, there is some data!
The header data at the top populated, the temperature graph populated, but it was very jagged. I clicked on the past hour and there were a lot of gaps in the data. I checked the database values and there are a lot of NAN values in the middle of the temps in the database. I wonder if the 1 second refresh interval in raspberrypiweatherstation.py was too quick. I changed that to 3 seconds and will check back in a bit to see how it turns out.
None of the other graphs would populate though, so I am hoping that the longer interval will let the values record to the RRD more successfully.
Ok, so changing the refresh interval to 3 seconds didnt work at all. The pi wouldnt record any data. It made everything NAN. At 1 second intervals it records data like this for all of the sensors.
T: Array
(
[1488371225] => NAN
[1488371230] => 55.5946699
[1488371235] => NAN
[1488371240] => 70.785952066667
[1488371245] => NAN
[1488371250] => NAN
[1488371255] => NAN
[1488371260] => NAN
[1488371265] => 74.67296886
[1488371270] => NAN
[1488371275] => 77.91850346
[1488371280] => 83.3
[1488371285] => 83.3
[1488371290] => NAN
[1488371295] => NAN
[1488371300] => NAN
[1488371305] => 83.3
[1488371310] => 83.3
[1488371315] => NAN
Is this what it is supposed to look like? I would think it would have values for each entry.
I'm having similar problems, took a bit but I've gotten the Python script to work, however RRDtool is not set up in the script... weird. Not sure how the PHP script is supposed to receive the info, is it from line 21:
$result = rrd_fetch( "./wundergrounddata.rrd", array( "AVERAGE", "--resolution", "300", "--start", "-10min", "--end", "-5min" ) );
but ./wundergrounddata.rrd
is supposed to be ./weatherdata.rrd
?
Would be great if we could get some help on this :).
After much trials and tribulations, I finally got the raspberryweatherstation.py to read the values.
I got the website to show up, with the graphs, moon phase, record high and low. But I cannot get the current humidity, temp, pressure, rainfall, light to show up. It is all zeros.
I cannot get the graphs to populate any values. I uncommented the lines:
$a = print_r($result);
print "preT: ". print_r($result['data']['temperature'], true);
in the index.php file, and it says everything in my database is NAN.
Does anybody have a working index.php they would be willing to share?
I added the following to my raspberrypiweatherstation.py to get it to update the database:
# csv.writerow(data)
#Write to wundergrounddata.RRD
UpdateRRD = ('/usr/bin/rrdtool update /var/www/html/weatherdata.rrd N:' + str(bmptemp) + ':' + str(trueRH) + ':' + str(light) + ':' + str(winddir) + ':' + str(windspeed) + ':' + str(bmppressure) + ':' + str(rain))
os.system(UpdateRRD)
which generates:
/usr/bin/rrdtool update /var/www/html/weatherdata.rrd N:71.24:57.7999992371:16:10:0:990.21:0
which doesn't return any errors...
The output of my raspberrypiweatherstation.py looks like this in the terminal:
GPS reading
latitude 0.0
longitude 0.0
time utc + nan
altitude (m) nan
time system 2017-02-27 00:04:56
Temperature: 21.8 deg C
Pressure: 990.21 hPa
Temp=20.8*C Humidity=57.4%
Humidity 57.4000015259 %
Light:16
Wind:9
Data: ['2017-02-27 00:04:56', XXXXXX, XXXXXX, 71.24000000000001, 57.400001525878906, 990.19, 16, 9, 0, 0]
/usr/bin/rrdtool update /var/www/html/weatherdata.rrd N:71.24:57.4000015259:16:9:0:990.19:0
BTW: What is up with the formatting here? That was totally bonkers.