Page 1 of 1

WXGRAPHS.PHP update to v 1.07 not working

Posted: Fri 28 May 2021 3:59 pm
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

Re: WXGRAPHS.PHP update to v 1.07 not working

Posted: Fri 28 May 2021 4:52 pm
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.

Re: WXGRAPHS.PHP update to v 1.07 not working

Posted: Fri 28 May 2021 7:27 pm
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.

Re: WXGRAPHS.PHP update to v 1.07 not working

Posted: Fri 28 May 2021 7:47 pm
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 :)

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

Posted: Sat 29 May 2021 2:56 pm
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