Page 1 of 1

Historic graph - where does it get its data from?

Posted: Tue 09 Feb 2021 11:35 am
by martinu
I've just upgraded to b3107 and I'm very impressed with the historic and select-a-chart graphs. On my "round tuit" list was a task to devise a means of uploading data to my server, getting the server to add it to a SQL table, and then write PHP to extract data for a selected time period and display it with Google Charts. But you've solved all that ;-)

Just one "funny" with the historic graph, caused by the perennial problem with my weather station: registering a bizarre rain rate due to spurious tipping when I clean the tipping spoon. I'd hand-edited the various log.txt files in ~/Cumulus/data, so it didn't affect the record values. But I'd not done the .json files: alldailyraindata.json still had the rogue value.

It wasn't until I looked at the historic graph (Rainfall, rainfall rate graph) that I spotted this. I've now corrected that file and uploaded it to the web server, but I'm still seeing the spike.

So where does historic charts get its data from? Is it one of those things that will need Cumulus to be restarted?

It affects both the local :8998 site and my public web site.


UPDATE: Because Cumulus has just stopped when I was running the :8998 site (see separate thread), I've had to restart Cumulus and the corrected json file is now being read correctly. So that answers my question: the graphs used a cached version of the file, not the live one in the /web folder on the Cumulus computer (a RasPi) or on the public web server.

Re: Historic graph - where does it get its data from?

Posted: Tue 09 Feb 2021 9:00 pm
by mcrossley
First, which historic graph? The Dashboard interface, or the default web site?

Ultimately the data source is your dayfile.txt file. If you edit data using the dashboard interface, then the cached dayfile data will be updated. If you edit the dayfile directly then it will be re-read when you start Cumulus MX again after the edit.

The json files are transient, they are re-created at day rollover, and at program start-up. You can re-create them on the fly by using the FTP Now function and selecting the option to include graph data files.