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 4017) - 17 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

Post Reply
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Server Generated Graphs for MX

Post by n9mfk »

Hi Mark
after some reading I found out the how the cache woks in jpgraph
is for it to make folder for the caching where ever the script is run from
so it is working just not where i expected Beau
Last edited by n9mfk on Mon 09 Mar 2015 8:19 pm, edited 1 time in total.
User avatar
mcrossley
Posts: 12686
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 »

Adrian Hudson wrote:Hi Mark,

Just a quick thank you for these graphs. Very nice. They work perfectly.

Can I ask, have you ever programmed in Fortran in your dim and distant past?

Adrian
Great, glad they are working for you. Fortran, wayyyyy back first/second year at uni - on punch cards!
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Server Generated Graphs for MX

Post by n9mfk »

Hi mark
I had 0.07 of rain today but the graph are showing 0.1
whats needs changed


http://n9mfk.info/raindata.json

http://n9mfk.info/images/graphRain.php

mx charts http://n9mfk.info/cumulus/wxcharts.php
thanks Beau
Adrian Hudson
Posts: 220
Joined: Mon 03 Jan 2011 4:27 pm
Weather Station: Davis Vantage Pro2
Operating System: Win 7
Location: Willand, mid Devon.
Contact:

Re: Server Generated Graphs for MX

Post by Adrian Hudson »

Fortran, wayyyyy back first/second year at uni - on punch cards!
I thought so... Your loop counters i and j gave it away. (me too, Fortran, punch cards, uni, IBM 370-145).
User avatar
mcrossley
Posts: 12686
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 »

n9mfk wrote:Hi mark
I had 0.07 of rain today but the graph are showing 0.1
whats needs changed


http://n9mfk.info/raindata.json

http://n9mfk.info/images/graphRain.php

mx charts http://n9mfk.info/cumulus/wxcharts.php
thanks Beau
Try version 0.4, which I think should fix this.
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Server Generated Graphs for MX

Post by n9mfk »

Hi Mark,
that Update fixed the problem
Thanks beau
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Server Generated Graphs for MX

Post by kocher »

Hi Mark

Thank you very much for your good work. :clap:
I see the "graphSettings.php" file on line 112:

Code: Select all

include 'db_ro_details.php';
What terms?

Javier
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 »

These are the settings for your MySQL database access so that the PHP code can access your database to obtain the data for the graphs.
David
Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Server Generated Graphs for MX

Post by kocher »

Hi David

Thanks for your answer. :)

I guess it's a common file for all charts that connect to the database

So I have to create the "db_ro_details.php" file?


regards
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 »

Code: Select all

<?php

// The server host name or number running your MySQL database
// usually 127.0.0.1 or localhost will suffice
$dbhost    = "localhost";
//
// The username used to log-in to your database server
$dbuser    ="YOUR USERNAME";
//
// The password used to log-in to your database server
$dbpassword   ="YOUR PASSWORD";
//
// The name of the MySQL database we will store the tables in
$database   ="YOUR DATABASE NAME";

?>
Use the above code saved as db_ro_details.php and substitute your settings in the last 3 parameters.
David
Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Server Generated Graphs for MX

Post by kocher »

Ok David

thank you very much :D


Javier
Image
User avatar
mcrossley
Posts: 12686
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 »

My reply seems to have gone missing, but I advise that you create the include file in a location inaccessible to the web server but on the PHP include path.
Big Daddy
Posts: 265
Joined: Tue 10 Sep 2013 8:40 pm
Weather Station: Ecowitt GW1003 (GW1000)
Operating System: Raspbian 10 (Buster) / Mono 6.12
Location: Freiston, Lincolnshire, UK
Contact:

Re: Server Generated Graphs for MX

Post by Big Daddy »

Need a bit of help please.

I managed to get the graphs working ok on my local Windows pc running Apache. It took me a while as I am a total novice but all working and caching ok.

I tried to move to my hosted website and changed the directories in the files as appropriate but when I run them on my website with Firefox I just get a blank page, no errors no nothing. With IE I get a HTTP 500 message. If I mispell the path I am entering I get a message to say object is not found or a 404 error so I assume everything is in the right place. Image is not being created on the website and nothing in the cache. When I was testing locally if I got something wrong I would get a "couldnt include XXX/XXX/ error and that sort of thing.

I ran a php info on the webserver and it shows its running PHP 5.5.25, I ran a checkgd.php (as per the jpgraph manual) and that is fine. I have tried in several directories and modified the files accordingly and I think I have got this right after spending a lot of time trying to undertsnad and work this out on my local server.

Have been sat staring at this all day but cannot seem to find the answer. It must be simple. Could it be the include_path. I cant access the php.ini file on my hosted server but running a echo get_include_path(); in a php file shows .:/usr/lib/php:/usr/local/lib/php. I dont know if this is right.

I read earlier in this post about using ./ for the directories and the full folder name for the cache file but it doesnt seem to change anything.

My local files are located in htdocs/midlifedad/jpgraph and the cache is in htdocs/midlifedad/jpgraph/cache. All my JSON and php scripts are in htdocs/midlifedad/jpgraph. My jpg-config file shows as follows define('CACHE_DIR','cache/'); and my graphsettings file has the following
$GRAPH['jsonloc'] = "";
$GRAPH['jpgraphloc'] = "/midlifedad/jpgraph/";
This all works fine, displys the graph and caches.

The settings for my website currently show (and I have changed them a lot)
files are located in public_html/weather/jpgraph and the cache is in public_html/weather/jpgraph/cache.
All my JSON and php scripts are in public_html/weather/jpgraph.
My jpg-config file shows as follows define('CACHE_DIR','cache/'); and my graphsettings file has the following
$GRAPH['jsonloc'] = "";
$GRAPH['jpgraphloc'] = "/weather/jpgraph/";

Would really appreciate somebody pointing me in the right direction.

Thanks
Andy
Big Daddy
Posts: 265
Joined: Tue 10 Sep 2013 8:40 pm
Weather Station: Ecowitt GW1003 (GW1000)
Operating System: Raspbian 10 (Buster) / Mono 6.12
Location: Freiston, Lincolnshire, UK
Contact:

Re: Server Generated Graphs for MX

Post by Big Daddy »

Hi All,
So just an update following some more testing.

Loaded jpgraph from scratch. Ran phpinfo.php, checkgd.php, checkgd2.php and checkttf.php as per the jpgraph documentation and all worked ok. Tried to run Tried jpgraph/src/Examples/example0.php - Blank page.

Headed over to TNET and found the instructions there. started from scratch again. Followed to the letter and exactly the same happens when I try and run jpgraph/src/Examples/testsuit.php. same as before and running the example0.php file also results in a blank page. I am totally lost with this one now. Its almost as if my hosting site is causing the problem. Does anyone know where to start to look or what to even ask them.

Thanks
Andy
User avatar
mcrossley
Posts: 12686
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 »

Andy, in on my phone at the most do I can't investigate properly, but I suspect your web hoster has disabled error messages. You should be able to switch them on again for an individual script by adding the appropriate command at the top of the script. You'll have to Google for the command I'm afraid.
Post Reply