Page 10 of 13

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 22 Aug 2015 11:38 am
by BCJKiwi
Thanks Steve.

I'll add that change to future versions of the script.
Will need to look at some other scripts as well where the same explode() is used.

A surprise this has not come up before as I would have expected other users of the script to have come across this. It seems that it has - n9mfk reported it a few posts before this but without enough info to track the issue, not sure anyone else reported it though.
It so happens I only get away with it as our lat is -36 else I would have found it myself a long time ago.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sun 23 Aug 2015 2:40 am
by BCJKiwi
Steve,
It seems that everyone in the northern hemisphere should have been affected by this but I have not seen a corresponding number of complaints.
Have incorporated your suggestion into the script but also changed the variable in the cloudbaseCUT.txt data file that Cumulus sends.
Either or both changes will work.

This data item is only used to determine hemisphere and the script already caters for the regular <#latitude> tag as well as the dp version.

Have attached a revised cloudbaseCUT.txt file.
Users may just replace the existing file in their cumulus/web folder (C1 or MX) and /or make the change to the cloudbaseCU.php file as suggested above.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sun 23 Aug 2015 7:43 am
by steve
I've also changed the code so that hopefully it will just use the required number of characters without padding, as Cumulus 1 apparently does.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sun 23 Aug 2015 10:51 am
by BCJKiwi
Ah, I got the impression from your earlier post that the padding process was the same in C1 and MX. On re-reading the posts it seems that was your original feeling but proved not to be the case. That would explain the lack of grumbles.

I'm sure consistency in the data file is the best solution.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Wed 25 May 2016 10:14 pm
by BCJKiwi
As per Ken's info on the changes at NOAA for Metar access, please note that change also affects this Cloudbase script IF and only IF you are using the Metar option in your configuration.

Have put a note on the page http://silveracorn.nz/weather/wxscripts.php until (if) the script there gets updated.

The Note there says;
UPDATE May 2016:- If using the Metar option, $getmetar = true; then line 1126 in cloudbaseCU.php should be changed;
from $rawfile = 'http://weather.noaa.gov/pub/data/observ ... /stations/' . $icao . '.TXT';
to $rawfile = 'http://tgftp.nws.noaa.gov/data/observat ... /stations/' . $icao . '.TXT';
So, please amend your cloudbaseCU.php script.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Thu 26 May 2016 9:17 am
by ConligWX
Thanks for the heads-up!

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Tue 04 Jul 2017 11:52 am
by BeaumarisWX
A Brilliant Script, Thanks Brian.
Image attached with it in action, showing the use of Local vs Metar data.
CB-Compare.PNG
And actual site data image for compare.
Huon River Vista Weather Huon Valley South Franklin Tasmania Home-min.png
regards,

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Tue 04 Jul 2017 5:01 pm
by ConligWX
Hi Tony

Whats up with your site at the moment? not seeing any data or site for that matter.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Tue 04 Jul 2017 10:31 pm
by BeaumarisWX
Hi Simon,

as per my signature below each post;

Weather PC Died 2016/11/21 15:25 Cannot justify replacement (Website dead)

Only running local Wamp site since then, most likely will not go public again, don't have the time nor money.

regards,

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sun 30 Dec 2018 1:01 pm
by ConligWX
Hi BCJKiwi

Just fyi, I noticed your 1.5 script points to an invalid metar URL now.

Code: Select all

$rawfile = 'http://weather.noaa.gov/pub/data/observations/metar/stations/' . $icao . '.TXT';
it should be:

Code: Select all

$rawfile = 'https://tgftp.nws.noaa.gov/data/observations/metar/stations/' . $icao . '.TXT';
I have your script in its current form working with Meteobridge using a customised Template :)

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Tue 22 Feb 2022 9:04 pm
by ConligWX
I know this is an old thread but needed to see if anyone has this script running with php 8.x?

just tried PHP8.0 and one of the errors was this:

Code: Select all

[Tue Feb 22 20:54:05.777646 2022] [php:error] [pid 3186:tid 139793068971776] [client x.x.x.x:2672] PHP Parse error:  syntax error, unexpected token "," in /htdocs/weather/cloudbaseCU.php on line 650, referer: https://www.conligwx.org/wxclouds.php

Code: Select all

line 645 if (!empty($clouds["pic"])) {
line 646   $imgClouds = imagecreatefrompng($pathToImages . $clouds["pic"]);
line 647   imageAlphaBlending($imgClouds, false);
line 648   imageSaveAlpha($imgClouds, true);
line 649   if (match($imgMist,$clouds["pic"]))
line 650         {$pt = $cldhgt == 0 ? 200 : 170;             $cY = $pt - $clouds["base"] - round($cldhgt/$scale["step"]);}
line 651   else  {$pt = 170 - round($cldhgt/$scale["step"]);  $cY = $pt - $clouds["base"];}
Anyone know a fix for this?

I have reverted back to PHP 7.4 for now.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Tue 22 Feb 2022 9:23 pm
by BCJKiwi
Try this:-
cloudbaseCUmx.zip
Updated courtesy of Ken True.

There is still no update of the jpgraph system from Asial

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Tue 22 Feb 2022 9:55 pm
by ConligWX
Thanks for the update, looks like nearly a total rewrite from the version I had.

is there other files to go along with this or do all the previous files work with the new revised version?

Code: Select all

$pathToMoonImage = './images/cb/moon/';				// path to the cloudbase moon image (with trailing slash)
// The 100x100px source image used on the index page (Dashboard) will automatically be resized for cloudbase
// These settings should match those in ajaxCUmx.js
$srcmoonimgdir = './images/moonmx/';
these are new whereas it was:

Code: Select all

$pathToMoonImages = './images/cb/moon/';  // path to the moon phase images (with trailing slash)
ie images (S) plural)

and moonx? what goes in there?

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Tue 22 Feb 2022 10:11 pm
by BCJKiwi
That is the update for the CumulusMXUI template.
There are some supporting files.

It seems you are using the Saratoga template so these files are needed:-
CUtags.php
cloudbaseCU.txt
plus the images/cb folder

Don't recall if they are all the same as before but should be.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Tue 22 Feb 2022 10:22 pm
by ConligWX
Yep I have the old version working fine with saratoga templates. all files are there,

though with that new script there are a plenty of undefined variables now.

Also just noticed the revision changes:

Code: Select all

Nov 2019	V CUmx 1.0.0	Changed data source to tag file, removed Saratoga options.
looks like that new script wont work with Saratoga then. oh well never mind thanks for the help.