Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Server Generated Graphs for MX

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Server Generated Graphs for MX

Post by mcrossley »

Hi Ron, you can put them where you want, so long as they are accessible. You need to edit the JPGraph config file to enable caching and point it at your cache folder. Then edit the graphSettings.php script and set the cache folder and jpgraph fodler locations in there.
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Server Generated Graphs for MX

Post by nitrx »

Sorry doesn't work I've no idea but leave it you said not to put much effort in it.
Thanks
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Server Generated Graphs for MX

Post by steve »

You need to enable the popup graphs in gauges.js. You currently have

showPopupGraphs : false, //If popup data is displayed, show the graphs?
Steve
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Server Generated Graphs for MX

Post by nitrx »

You're right Steve , I've upladed with graphpopups now but there are no graphs created on the server.
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Server Generated Graphs for MX

Post by mcrossley »

Ron, where are the graphXxxxx.php files located on your server?
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Server Generated Graphs for MX

Post by nitrx »

mcrossley wrote:Ron, where are the graphXxxxx.php files located on your server?
They are in apeldoornmeteo.nl/cumulus and in apeldoornmeteo.nl/cumulus/images I've made in both a dir with /jpgraph and a /cache in the /jpraph ( I chmod /cache to 777)
EDIT I've only uploaded the content of src from the jpgrap package to /jpgraph do I dont have /jpgraph/src ...
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Server Generated Graphs for MX

Post by laulau »

mcrossley wrote: Guess how I do mine :lol: I don't have MX uploading the json files, just my tag files, so yes I just query my real time MySQL table.
I'm a little lost to rearrange the data extracted with realtileLog Sql script to match those from CMX jsongraph files!:groan:
Some help would be appreciated .
Laurent

Image
swyman18
Posts: 56
Joined: Fri 24 Apr 2009 5:27 am
Weather Station: Davis Vantage Pro2
Operating System: Ubuntu Server 14.04
Location: Honoka'a, HI

Re: Server Generated Graphs for MX

Post by swyman18 »

If it helps anyone, I had to use the ./ syntax for the locations in the graphSettings.php file in order to get it to work. I assume that is because my webhost is linux.

$GRAPH['jsonloc'] = "./";
$GRAPH['jpgraphloc'] = "./jpgraph/src/";
$GRAPH['jpgraphcache'] = "./jpgraph/cache/";

And I made sure I used the full absolute path in the cache definition in the jpg-config.inc.php file.

define('CACHE_DIR','/home/content/#/#/#/########/html/jpgraph/cache/'); for example.
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Server Generated Graphs for MX

Post by mcrossley »

Another thing to check - that your installation meets the requirements for JPGraph...

http://jpgraph.net/download/manuals/chu ... 03s02.html
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Server Generated Graphs for MX

Post by laulau »

laulau wrote:
mcrossley wrote: Guess how I do mine :lol: I don't have MX uploading the json files, just my tag files, so yes I just query my real time MySQL table.
I'm a little lost to rearrange the data extracted with realtileLog Sql script to match those from CMX jsongraph files!:groan:
Some help would be appreciated .
I think i got it :D
Laurent

Image
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Server Generated Graphs for MX

Post by mcrossley »

Hi Laurent, I do have a solution but it involves a slight change to all the graph files as well as a new get_data() function. The code for fetching the data is just the same as my HighCharts 'recent graphs' - almost! Still, you had fun working it out for yourself :clap:
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Server Generated Graphs for MX

Post by laulau »

I changed the reorg_data function and the appropriate call to the realtimeSglLog script of the 'switch case' in graphSettings.php.

Code: Select all

function reorg_data1($dat) {
	$keyname = array(
		"press" => "Pressure",
		"rfall" => "Rain today",
		"rrate" => "Rain rate",
		"hum" => "Outdoor humidity",
		"inhum" => "Indoor humidity",
		"temp" => "Temperature",
		"intemp" => "Indoor",
		"dew" => "Dew point",
		"apptemp" => "Apparent temp",
		"wchill" => "Wind chill",
		"bearing" => "Direction",
		"avgbearing" => "Average direction",
		"wspeed" => "Wind speed",
		"wgust" => "Wind gust",
		);	
	$keys = array_keys($dat);
	$retVal = array();
	
 
    for ($i = 0; $i < count($keys); $i++) {
        
		$key = $keys[$i];
		
        for ($j = 0; $j < count($dat[$key]); $j++) {
            if ($i === 0) {
                // JavaScript time in msecs, convert to secs
                $retVal['time'][] = $dat[$key][$j][0] / 1000;
            }
            $retVal[$keyname[$key]][] = $dat[$key][$j][1];
        }
    }
	
    return $retVal;	
}
Now i have to place the graph files in the right place and look at the .htaccess file.
Laurent

Image
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Server Generated Graphs for MX

Post by water01 »

steve wrote:
water01 wrote:Using MX though I am going to get some .htm files uploaded though for the moment as the option to just upload .json files and not the .htm files does not yet exist.

Let Steve complete the Beta first as it is not that important.
That's a fairly easy and useful change, though, so I'll look at doing that.
Meant to say Thank You for doing this Steve, improved my upload times and stopped using bandwidth I didn't need to !!
David
Image
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Server Generated Graphs for MX

Post by mcrossley »

I have added a version of the graph scripts that gets it data from a MySQL 'realtime' table. This allows you to graph anything in the realtime table, the package contains an additional graph for cloudbase.
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Server Generated Graphs for MX

Post by water01 »

Mark, I assume the data used is longer than the standard 2 hr realtime.log highcharts one in the wiki and involves a MySQL script of some kind to get the data into a database. Any chance of getting a copy of the code to build the database?
David
Image
Post Reply