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 4019) - 03 April 2024

Legacy Cumulus 1 release 1.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

jpgraph setup help

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

Post Reply
CurtisZM
Posts: 29
Joined: Wed 30 Nov 2011 3:29 am
Weather Station: Davis VP2
Operating System: Windows 10 Version 1511
Location: Zumbrota,Mn
Contact:

jpgraph setup help

Post by CurtisZM »

To All,

I'm trying to get jpgraphs working. What am I doing wrong? Thank you.

-graphsettings.php-

$GRAPH['jsonloc'] = "/cumulusmx/";
$GRAPH['jpgraphloc'] = "/cumulusmx/jpgraph/src/";

-jpg-config.inc.php-

define('CACHE_DIR','/cumulusmx/jpgraph/cache/');
define('TTF_DIR','/var/www/$$$$$/$/$$$$$/$$$$$$$$$/httpdocs/curtiszmweather.com/cumulusmx/jpgraph/ttf/');

.htaccess is in cumulusmx/images/

Here is my directory tree:
server directory.png
You do not have the required permissions to view the files attached to this post.
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: jpgraph setup help

Post by mcrossley »

JPGraph needs to be installed on your web server, it looks like you are installing on your Cumulus server? Unless the they are the same server?

I am assuming that you are trying to get the MX static graph images working?
CurtisZM
Posts: 29
Joined: Wed 30 Nov 2011 3:29 am
Weather Station: Davis VP2
Operating System: Windows 10 Version 1511
Location: Zumbrota,Mn
Contact:

Re: jpgraph setup help

Post by CurtisZM »

Thank you for responding Mark.

Sorry Mark I should have been more specific. Yes I am trying to get your MX static graph images working.

All the files are located on the web server.
I'm trying to keep everything for CumulusMX under it's own directory.
Web server path: webspace/httpdocs/curtiszmweather.com/cumulusmx/
Attached is print screen of my web tree. (Not all since you can only go so far on a print screen)

webspace/httpdocs/curtiszmweather.com/cumulusmx/images/ directory = .htaccess & graph*.php files (From your github link)

webspace/httpdocs/curtiszmweather.com/cumulusmx/jpgraph/ = JpGraph PHP5 version

webspace/httpdocs/curtiszmweather.com/cumulusmx/lib/steelseries/ = gauges
You do not have the required permissions to view the files attached to this post.
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: jpgraph setup help

Post by mcrossley »

OK, you need to specify your paths either relative to the main calling script (no leading "/"), or as a full path on your server, or use an existing reference as a starting point

On my server $_SERVER["DOCUMENT_ROOT"] set to the root of web server files, I use that as the base path for my scripts. So in graphSettings.php for instance, I have...

Code: Select all

$GRAPH['jpgraphloc']     = $_SERVER["DOCUMENT_ROOT"]."site-utils/jpgraph/";
$GRAPH['jpgraphcache']   = $_SERVER["DOCUMENT_ROOT"]."site-utils/jpgraph/cache/";
As I have installed jpgraph into the "site-utils/jpgraph" folder off the root of my web file folder.

If you create a small script called say info.php, and just add one line..

Code: Select all

<?php phpinfo(); ?>
When you view that file from your browser it will give you all sorts of useful information about your PHP installation - including default paths and where the DOCUMENT_ROOT is located.
CurtisZM
Posts: 29
Joined: Wed 30 Nov 2011 3:29 am
Weather Station: Davis VP2
Operating System: Windows 10 Version 1511
Location: Zumbrota,Mn
Contact:

Re: jpgraph setup help

Post by CurtisZM »

Mark,

I have the script working:
http://curtiszmweather.com/cumulusmx/im ... empOut.php

The only issue I have is when I hover over the gauges, I'm not getting any of the jpgraphs to work. If I copy the cumulus png files they display just fine. My guess is the .htaccess file is not functioning properly. Any ideas?

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

Re: jpgraph setup help

Post by mcrossley »

The only two things I can think of if the .htaccess file is in place, are that that "mod_rewrite" module is not enabled on the Apache server. Your phpinfo() output shows which Apache modules are loaded - "Loaded Modules".

The other possible thing to try is to quote the rules. E.g.
RewriteRule "^press\.png$" "graphPress.php" [NC,L]
CurtisZM
Posts: 29
Joined: Wed 30 Nov 2011 3:29 am
Weather Station: Davis VP2
Operating System: Windows 10 Version 1511
Location: Zumbrota,Mn
Contact:

Re: jpgraph setup help

Post by CurtisZM »

Mark,

Thank you for responding.

I added the quotes with no success.

Checked PHP info:
When I search for rewrite, all I find is:

url_rewriter.tags a=href,area=href,frame=src,form=,fieldset= a=href,area=href,frame=src,form=,fieldset=

Is that it? Otherwise I will have to contact my web provider to see if Rewrite is enabled.
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: jpgraph setup help

Post by mcrossley »

In the Apache2 handler section on mine I have...
Untitled-1.jpg
You can see "mod_rewrite" in there.
You do not have the required permissions to view the files attached to this post.
CurtisZM
Posts: 29
Joined: Wed 30 Nov 2011 3:29 am
Weather Station: Davis VP2
Operating System: Windows 10 Version 1511
Location: Zumbrota,Mn
Contact:

Re: jpgraph setup help

Post by CurtisZM »

Mark,

No mod_rewrite when I look at mine. I contacted my provider and they were asking me how that feature is turned on. Do you know? I certainly do not.
When it comes to this, I'm a rookie...

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

Re: jpgraph setup help

Post by mcrossley »

CurtisZM wrote:I contacted my provider and they were asking me how that feature is turned on. Do you know? I certainly do not.
They should be able to run the command...

a2enmod rewrite

Then re-start the Apache service...

service apache2 restart
CurtisZM
Posts: 29
Joined: Wed 30 Nov 2011 3:29 am
Weather Station: Davis VP2
Operating System: Windows 10 Version 1511
Location: Zumbrota,Mn
Contact:

Re: jpgraph setup help

Post by CurtisZM »

Mark,

My web host provider (Charter Spectrum) contacted me this morning and said the mod_rewrite function is turned off and will not be turned to ON. Thanks for your assistance Mark.
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: jpgraph setup help

Post by mcrossley »

OK, so you should still be able to point the gauges at the PHP scripts - just a bit more editing.
CurtisZM
Posts: 29
Joined: Wed 30 Nov 2011 3:29 am
Weather Station: Davis VP2
Operating System: Windows 10 Version 1511
Location: Zumbrota,Mn
Contact:

Re: jpgraph setup help

Post by CurtisZM »

Sounds good. Thank you....
CurtisZM
Posts: 29
Joined: Wed 30 Nov 2011 3:29 am
Weather Station: Davis VP2
Operating System: Windows 10 Version 1511
Location: Zumbrota,Mn
Contact:

Re: jpgraph setup help

Post by CurtisZM »

Made the changes. All is working. Thanks.

case 0:
// Cumulus
_realtimeVer = 12; //minimum version of the realtime JSON file required
config.realTimeURL = config.longPoll ? config.realTimeURL_LongPoll : config.realTimeURL_Cumulus;
// 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
['graphTempOut.php', 'graphTempIn.php'], // Temperature: outdoor, indoor
// Temperature: dewpoint, apparent, windChill, heatIndex, humidex
['graphTempOut.php', 'graphTempOut.php', 'graphTempOut.php', 'graphTempOut.php', 'graphTempOut.php'],
'graphRain.php', // Rainfall
'graphRrate.php', // Rainfall rate
['graphHumOut.php', 'graphHumIn.php'], // Humidity: outdoor, indoor
'graphPress.php', // Pressure
'graphWind.php', // Wind speed
'graphWdir.php', // Wind direction
(config.showUvGauge ? 'graphUV.php' : null), // UV graph if UV sensor is present | =null if no UV sensor
(config.showSolarGauge ? 'graphSolar.php' : null), // Solar rad graph if Solar sensor is present | Solar =null if no Solar sensor
(config.showRoseGauge ? 'graphWdir.php' : null), // Wind direction if Rose is enabled | =null if Rose is disabled
(config.showCloudGauge ? 'graphPress.php' : null) // Pressure for cloud height | =null if Cloud Height is disabled
];
break;
Post Reply