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

WXGRAPHS.PHP update to v 1.07 not working

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
pkiener
Posts: 56
Joined: Mon 24 Feb 2014 10:21 pm
Weather Station: Davis Vantage VUE
Operating System: Windows 10
Location: United States
Contact:

WXGRAPHS.PHP update to v 1.07 not working

Post by pkiener »

Good morning!
I upgraded wxgraphs.php from version 1.06 to version 1.07 and now I am unable to produce any graphs on the web page. V 1.06 was working perfectly and simply upgrading to v 1.07 prevents any graph to be constructed or displayed. Performing a page inspect, I see the following error message: "Failed to load resource: the server responded with a status of 404 ()". The page appears to be looking for "https://www.paulkiener.com/Saratoga/graphconfig.json" which is not located in that location on the web site.

My web site is located at: https://weather.paulkiener.com; and the page in question is at: https://www.paulkiener.com/Saratoga/wxgraphs.php. I am currently using CumulusMX (3.11.4-b3133).

I have been trying to determine the differences between wxgraphs.php v 1.06 and v 1.07 and have been unable to explain why v 1.06 works and v 1.07 will not work properly. No other changes are made while switching from one version with the other.

I hope I have provided enough information regarding my problem and any help will be greatly appreciated. Thanks in advance!

Paul
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: WXGRAPHS.PHP update to v 1.07 not working

Post by saratogaWX »

Ok, this took a bit of debugging to suss out.

Your template is located in /Saratoga/ directory, but the CumulusMX files are uploaded to the /Cumulus/ directory. The missing graphconfig.json is in /Cumulus/ directory.

So, the /Saratoga/wxgraphs.php is trying to load graphconfig.json from your document root. The way the CumulusMX wxgraphs.php scripting is set up is it expects all those .json files to be in the same directory as the wxgraphs.php page is in. There would need to be some major surgery done on the cumx/cumulusmxcharts.js to support this :

Change:

Line 17: url: "graphconfig.json",
Line 245: url: 'tempdata.json',
Line 421: url: 'pressdata.json',
Line 594: url: 'wdirdata.json',
Line 763: url: 'winddata.json',
Line 941: url: 'raindata.json',
Line 1112: url: 'humdata.json',
Line 1301: url: 'solardata.json',
Line 1450: url: 'sunhours.json',
Line 1596: url: 'dailyrain.json',
Line 1762: url: 'dailytemp.json',

to

Line 17: url: "/Cumulus/graphconfig.json",
Line 245: url: '/Cumulus/tempdata.json',
Line 421: url: '/Cumulus/pressdata.json',
Line 594: url: '/Cumulus/wdirdata.json',
Line 763: url: '/Cumulus/winddata.json',
Line 941: url: '/Cumulus/raindata.json',
Line 1112: url: '/Cumulus/humdata.json',
Line 1301: url: '/Cumulus/solardata.json',
Line 1450: url: '/Cumulus/sunhours.json',
Line 1596: url: '/Cumulus/dailyrain.json',
Line 1762: url: '/Cumulus/dailytemp.json',

so that Highcharts will know where the data really is on your site.
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: WXGRAPHS.PHP update to v 1.07 not working

Post by saratogaWX »

I've made an update to the ./cuwx/cumulusmxcharts.js script which would support easier configuration .. download from https://cumulusmx.saratoga-weather.org/ ... xcharts.js

In there, for your configuration with /Cumulus/ for the directory of the CumulusMX .json files, change the top code from

Code: Select all

var cuDir = './'; 
to

Code: Select all

var cuDir = '/Cumulus/'; 
and it should work with your configuration.
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: WXGRAPHS.PHP update to v 1.07 not working

Post by saratogaWX »

I've also updated the distribution so you can use the update tool with a query of Base-*, Cumulus, 28-May-2021 and get the package updated. The distribution default assumes the CumulusMX files are in the same directory as wxgraphs.php page, and now it's really easy to change that :)
pkiener
Posts: 56
Joined: Mon 24 Feb 2014 10:21 pm
Weather Station: Davis Vantage VUE
Operating System: Windows 10
Location: United States
Contact:

Re: WXGRAPHS.PHP update to v 1.07 not working (resolved)

Post by pkiener »

Thank you very much for your quick reply. I'm sorry that my response back to you was not as timely; family, "honey-do", etc!!

I downloaded the revised "cumulusmxcharts.js" and made the suggested edit in the file before I uploaded to my web site. Alas, it still did not work. I finally got it working by editing the suggested line from "./" to "../Cumulus/". Graphs are now appearing as expected, seen in my page: https://www.paulkiener.com/Saratoga/wxgraphs.php.

I am still puzzled, however, as to why the previous version of wxgraphs.php worked, but the newer version didn't without the change to the .js file.

Again, thank you very much for all your help!! I, and I am sure many others, appreciate all the work and support that you provide in developing such wonderful pages and scripts for us to use. I enjoy watching the weather via my site!!

Paul
Post Reply