Page 1 of 2

Setting up CumulusMX to use MySQL

Posted: Sun 21 Feb 2016 2:14 pm
by itfidds
Hi,

I hope this is the correct place to post this question or questions.

I have a Davis Vantage Pro 2 and have installed CumulusMX 3036.

These play together very nicely and I have FTP'd the live files to a directory (http://www.domain.com/cumulusmx) which can be seen by visiting http://www.domain.com/cumulusmx/index.htm

Since that success I have configured CumulusMX to send data to a MySQL database called...cumulusmx! And the data arrives.

Now I would like to publish data from the database on a webpage but here is where it gets foggy (apologies for the weather pun!) as I am a bit of a novice.

I have copied the http://www.domain.com/cumulusmx directory to http://www.domain.com/cumulusmx-sql so as to not mess up the orignal directory.

For JPGraph I have copied the src directory and its contents to the cumulusmx-sql directory so I now have http://www.domain.com/cumulusmx-sql/jpgraph which contains the files from the src directory.

I have edited the graphSettings.php file and ensured that JPGraph is in lower case as below: -

Code: Select all

$GRAPH['jpgraphloc']     = '/cumulusmx-sql/jpgraph/'; // Path to jpgraph, or put it in your PHP path
In addition I have added a file db_ro_details.php with the database details as suggested.

What else, if anything, am I missing - the cache directory? If cache setting is false do I need to do anything, such as create a directory?

I also notice that in the graphSettings.php there is a refences to a json location which has a default of \
Is this neccessary if we are using the MySQL server?

Apologies for being a novice but I have searched the forum for over three hours with little success - although I did find little snippets regarding all of the different configurations but am having trouble putting them all together.

Thanks in advance

Re: Setting up CumulusMX to use MySQL

Posted: Sun 21 Feb 2016 3:28 pm
by mcrossley
It's not quite clear to me, but are you talking about getting the jpgraphs for MX working with MySQL?

If so, if you look in the original zip file, you will find there are two copies of the scripts, one set for json data, the other for MSQL. It sounds like you are trying to use the json scripts with SQL?

Re: Setting up CumulusMX to use MySQL

Posted: Sun 21 Feb 2016 4:06 pm
by water01
And I don't know whether it is just me but none of your links work they all give 404s.

Re: Setting up CumulusMX to use MySQL

Posted: Sun 21 Feb 2016 4:09 pm
by duke
water01 wrote:And I don't know whether it is just me but none of your links work they all give 404s.
ditto

Re: Setting up CumulusMX to use MySQL

Posted: Sun 21 Feb 2016 4:11 pm
by mcrossley
I don't think domain.com is his real domain

Re: Setting up CumulusMX to use MySQL

Posted: Mon 22 Feb 2016 2:56 pm
by itfidds
Mark, spot on - http://www.domain.com was just to show reference to structure.

And to all, having re-read my post it's not even clear to me what I am trying to say! Possible a few too many beers the night before.

So, apologies and let's try again...

I have a Davis Vantage Pro 2 which is connected to a PC which was running Cumulus 1.x and with this setup I could use the Cumulus to upload load files to a webpage and get the standard pages to display as they should. This can be seen here: -
http://icastronomy.jvtech.es/weather/index.htm

Since then I moved on to trying to use CumulusMX to display the information: -
http://icastronomy.jvtech.es/cumulusmx/
And that worked too!

Now I am trying to use CumulusMX with MySQL and PHP to display weather information.

I have a MySQL database which is receiving data into 3 tables - dayfile, monthly and realtime

So next I have created a directory off the root of the server: -
http://icastronomy.jvtech.es/cumulusmx-sql

In here I copied the contents of the SQL directory from the downloaded zip file 'Cumulus-MX-Gauge-Graphs-master'.
I also created a 'db_ro_details.php' file with my database details.

I then created 3 more directories: -
http://icastronomy.jvtech.es/cumulusmx-sql/jpgraph/src and copied the jpgraph/src contents
http://icastronomy.jvtech.es/cumulusmx-sql/jpgraph/ttf and copied arial.ttf and arialbd.ttf
http://icastronomy.jvtech.es/cumulusmx-sql/wxgraphs and copied the wxgraphs contents

Now this is where I started to get lost! I am confused as to which config files I need to edit: -

http://icastronomy.jvtech.es/cumulusmx- ... hsconf.php ?
http://icastronomy.jvtech.es/cumulusmx- ... ge.inc.php ?
http://icastronomy.jvtech.es/cumulusmx- ... ig.inc.php ?

I guess I was hoping for a 'Dummies Guide' for the whole process, but I have spent hours reading about different templates, scripts etc.
If I point my browser to http://icastronomy.jvtech.es/cumulusmx- ... _test.html I get error messages saying that JPGraph files cannot be found.

So near yet so far?

If any kind soul could point me in the right direction I would be extremely grateful.

Many thanks in advance

Re: Setting up CumulusMX to use MySQL

Posted: Mon 22 Feb 2016 5:41 pm
by mcrossley
Ah, so it's the wxgraphs package you are using - sorry, but I don't anything much about that. I wrote the CumulusMX Graphs package.

You'll need somebody else to chip-in wxgraphs, or try on the wxforum where I think you may find more users of that package.

Re: Setting up CumulusMX to use MySQL

Posted: Mon 22 Feb 2016 10:23 pm
by kocher
To see possible errorres would be interesting to know the code for a graphic; eg:

http://icastronomy.jvtech.es/cumulusmx- ... mp_1hr.php

Re: Setting up CumulusMX to use MySQL

Posted: Tue 23 Feb 2016 8:33 am
by itfidds
mcrossley wrote:Ah, so it's the wxgraphs package you are using - sorry, but I don't anything much about that. I wrote the CumulusMX Graphs package.

You'll need somebody else to chip-in wxgraphs, or try on the wxforum where I think you may find more users of that package.
Uhhh, so this has confused me even more! I thought that I had read that I needed wxgraphs to use CumulusMX Graphs...

Would it be better for me to rephrase my post to ask "What options do I have and what do I need to get graphs from the data stored in a MySQL database"?

I guess, from the fact that wxgraphs and CumulusMX Graphs are different (competitors?) products, I may get conflicting answers - bit like Microsoft or Linux??!?!?

However, it can't hurt to ask - can it?

Many thanks again for your guidance so far.

Re: Setting up CumulusMX to use MySQL

Posted: Tue 23 Feb 2016 8:54 pm
by duke
Lets try and break this down:

1/ Do you actually want to use a MySQL database to produce graphs?
2/ or do you want to produce graph images using php as in 'this' thread?
3/ or do you want to display the graphs (charts) as used in the MX interface on your site?

Re: Setting up CumulusMX to use MySQL

Posted: Tue 23 Feb 2016 9:42 pm
by kocher
With MySQL can be obtained graphics type:

- Dynamics and interactives, for example with Highcharts
- Dynamics not interactives (produce an image), for example with JPGraph


Demo: http://kocher.es/graficos-comparativa.php

Re: Setting up CumulusMX to use MySQL

Posted: Thu 25 Feb 2016 1:08 pm
by itfidds
duke wrote:Lets try and break this down:

1/ Do you actually want to use a MySQL database to produce graphs?
2/ or do you want to produce graph images using php as in 'this' thread?
3/ or do you want to display the graphs (charts) as used in the MX interface on your site?
Thanks for the reply Duke,

The answer is almost certainly number one - produce graphs using MySQL.
However, is number two not also possible with number one, i.e. use php to extract data from MySQL and show this as graphics?

Thanks again

Re: Setting up CumulusMX to use MySQL

Posted: Thu 25 Feb 2016 1:14 pm
by itfidds
kocher wrote:With MySQL can be obtained graphics type:

- Dynamics and interactives, for example with Highcharts
- Dynamics not interactives (produce an image), for example with JPGraph


Demo: http://kocher.es/graficos-comparativa.php
Hola kocher y gracias por su respuesta,

Me voy a mirar tu sitio de web para ver las diferencias...

Y disculpe mi español malo - la proxima vez uso Google Traductor o ingles!!!

Un saludo

Re: Setting up CumulusMX to use MySQL

Posted: Thu 25 Feb 2016 7:03 pm
by itfidds
mcrossley wrote:Ah, so it's the wxgraphs package you are using - sorry, but I don't anything much about that. I wrote the CumulusMX Graphs package.

You'll need somebody else to chip-in wxgraphs, or try on the wxforum where I think you may find more users of that package.
Hi Mark,

Having spent another day or so looking through this forum I have come to the conclusion that I was a bit confuddled!

Not sure if you have seen my more recent replues to lorcher and duke?

I am more than happy to (re)-attempt setting up CumulusMX with Jgraph and Highcharts.
Is this how you acheived your site? If so, does it use PHP or HTML?

And the million £ question - is there a step-by-step (proper dummies) guide to setting this up?

Many thanks

Re: Setting up CumulusMX to use MySQL

Posted: Thu 25 Feb 2016 10:54 pm
by mcrossley
I'm away travelling at the moment, I'll try and get a reply for you over the weekend - though I have some new toys to add to my 'other' car this weekend :D before going away again on Monday :x