Page 13 of 14

Re: Server Generated Graphs for MX

Posted: Mon Jun 26, 2017 1:52 pm
by steve
Herbaldew wrote:Can one make the popup graphs work on the CMX interface (running on rPi)?

Not with the Cumulus UI because the built-in MX 'web server' is lightweight and doesn't do PHP. You would need to run a proper web server on the Pi and run the standard web site (or part of it) on that, for viewing locally.

Re: Server Generated Graphs for MX

Posted: Fri Dec 29, 2017 1:00 am
by dazza1223
got it working

http://www.davisworthing.co.uk/images/graphPress.php

but still know pop ups gauges ?

Re: Server Generated Graphs for MX

Posted: Fri Dec 29, 2017 1:54 pm
by mcrossley
dazza1223 wrote:but still know pop ups gauges ?

You have a space in the image path variable in gauges.js...

Code: Select all

imgPathURL         : './images/ ',

Re: Server Generated Graphs for MX

Posted: Fri Dec 29, 2017 4:20 pm
by dazza1223
ok i did that put still the same


do i need to do somthink to is part of code



// Cumulus
realtimeVer = 12; // minimum version of the realtime JSON file required
config.realTimeURL = config.longPoll ? config.realTimeUrlLongPoll : config.realTimeUrlCumulus;
// the trend images to be used for the pop-up data, used in conjunction with config.imgPathURL
// by default this is configured for the Cumulus 'standard' web site
// ** If you specify one image in a sub-array, then you MUST provide images for all the other sub-elements
config.tipImgs = [ // config.tipImgs for Cumulus users using the 'default' weather site
['temp.png', 'intemp.png'], // Temperature: outdoor, indoor
// Temperature: dewpoint, apparent, windChill, heatIndex, humidex
['temp.png', 'temp.png', 'temp.png', 'temp.png', 'temp.png'],
'raint.png', // Rainfall
'rain.png', // Rainfall rate
['hum.png', 'hum.png'], // Humidity: outdoor, indoor
'graphPress.png', // Pressure
'wind.png', // Wind speed
'windd.png', // Wind direction
(config.showUvGauge ? 'uv.png' : null), // UV graph if UV sensor is present | =null if no UV sensor
(config.showSolarGauge ? 'solar.png' : null), // Solar rad graph if Solar sensor is present | Solar =null if no Solar sensor
(config.showRoseGauge ? 'windd.png' : null), // Wind direction if Rose is enabled | =null if Rose is disabled
(config.showCloudGauge ? 'press.png' : null) // Pressure for cloud height | =null if Cloud Height is disabled

Re: Server Generated Graphs for MX

Posted: Fri Dec 29, 2017 7:48 pm
by mcrossley
It doesn't look like you have loaded the .htaccess file on your web server?
You can only access the files via their full filenames eg "graphPress.php", whereas the gauges script is looking the aliases eg "press.png"

Re: Server Generated Graphs for MX

Posted: Fri Dec 29, 2017 8:13 pm
by dazza1223
I've put it in the images folder as I saw that where ppl been saying to put it or am I doing some thing rong or missing somthink

Re: Server Generated Graphs for MX

Posted: Fri Dec 29, 2017 8:35 pm
by mcrossley
Is your web server running on Apache?

Re: Server Generated Graphs for MX

Posted: Fri Dec 29, 2017 8:48 pm
by dazza1223
Yh it is mate on rasberry pi

Re: Server Generated Graphs for MX

Posted: Fri Dec 29, 2017 9:49 pm
by mcrossley
Take a look at this...
https://httpd.apache.org/docs/current/h ... ccess.html
You could move the contents of the file into your main Apache config file as that article indicates that is more efficient anyway.

Re: Server Generated Graphs for MX

Posted: Fri Dec 29, 2017 9:55 pm
by dazza1223
Ok I was thinking off do I g that but as it a raspberry pi and it nice having it all a ssd drive so there way ur saying I need to edit the config file to Pont it to the file

Re: Server Generated Graphs for MX

Posted: Sat Mar 24, 2018 6:54 pm
by Herbaldew
I've been playing with this for an embarassing amount of time without success.

My problem is identical to what is outlined in THIS thread.

That turn out to be a problem caused by his ISP provided free server.

I am using an rPi with Apache/PHP installed using:

Code: Select all

sudo apt-get install apache2 php7.0 php7.0-gd

It passes PHP and jpgraph testing, but no graph is showing up in the pop up.

Here is a pic from the above referenced thread that shows what I get:

Image

So, I am wondering .... might there be something in the php.ini that I need to do?

My second guess is that I didn't follow the wiki on changing from html to php - I just changed the Cumulus.ini file to upload the processed "T" files with a php extension. I am not permitted by my ISP to run a server so this is in house only and I can't provide any urls.


Thanks

Re: Server Generated Graphs for MX

Posted: Sun Mar 25, 2018 6:51 pm
by mcrossley
OK, what happens if you load the php directly into browser... e.g.

http:// hostname/images/graphTempOut.php

Which assumes you the graphs loaded in the image folder.

If that works, what about...?

http:// hostname/images/temp.png

Re: Server Generated Graphs for MX

Posted: Sun Mar 25, 2018 7:37 pm
by Herbaldew
No images are being created.

If I try to load any of th scripts eg "http:// hostname/images/graphTempOut.php", I get a 500 error.

Re: Server Generated Graphs for MX

Posted: Mon Mar 26, 2018 8:48 am
by mcrossley
OK, so we need to see the web server error log to see what the problem is.
You could try adding the following line to the top of the graphTemp.php script...

Code: Select all

error_reporting(E_ALL);

Then see what you get in the browser.

Re: Server Generated Graphs for MX

Posted: Mon Mar 26, 2018 3:00 pm
by Herbaldew
I don't have a "graphTemp.php" so I added the error reporting line to the top of "graphTempOut.php" (above the php code).

When I open the file in my browser all I see is the error reporting line I added. The following two lines were added to the php error log:

Code: Select all

[Mon Mar 26 10:32:18.726751 2018] [:error] [pid 508] [client 192.168.10.2:49796] PHP Warning:  require_once(jpgraph_glayout_vh.inc.php): failed to open stream: No such file or directory in /var/www/html/jpgraph/jpgraph_windrose.php on line 12
 
[Mon Mar 26 10:32:18.726912 2018] [:error] [pid 508] [client 192.168.10.2:49796] PHP Fatal error:  require_once(): Failed opening required 'jpgraph_glayout_vh.inc.php' (include_path='.:/usr/share/php') in /var/www/html/jpgraph/jpgraph_windrose.php on line 12

"jpgraph_glayout_vh.inc.php" is NOT included in the version I jpgraph I have (v 4.2.0).

I also have noticed "include/includes" several times and should have added that as a third item to my list in my OP of what I thought may be my problem.