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 4017) - 17 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

PHP Web 'viewer' for Cumulus NOAA Style reports

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
kingqueen
Posts: 60
Joined: Tue 26 Feb 2013 6:52 pm
Weather Station: Maplin N96GY / Fine Offset 1081
Operating System: Windows 7 HP 64 bit
Location: Wetherby, UK
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by kingqueen »

Beteljuice

Thank you for your script. It's great.

There's something wrong with the anglicised code though. I've tried multiple times, copying it precisely, and I always end up with the following error.

Code: Select all

Warning:  Division by zero in /home/wetherby/public_html/noaa-inc.php on line 433

Warning:  preg_replace() [function.preg-replace]: Empty regular expression in /home/wetherby/public_html/noaa-inc.php on line 433
I've commented out Line 433 for now and the result is at http://www.wetherbyweather.org.uk/climate.php . PHP attached

Thanks
You do not have the required permissions to view the files attached to this post.
Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by beteljuice »

That's an old oops :oops: - corrected syntax was mentioned here: https://cumulus.hosiene.co.uk/viewtopic.p ... 4&start=80

Your code should be:

Code: Select all

	 $rpt = preg_replace('/State: West Yorkshire/'i, 'County: West Yorkshire   Country: UK', $rpt, 1);
I have re-edited the original post - thank you for bringing it to my attention.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
kingqueen
Posts: 60
Joined: Tue 26 Feb 2013 6:52 pm
Weather Station: Maplin N96GY / Fine Offset 1081
Operating System: Windows 7 HP 64 bit
Location: Wetherby, UK
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by kingqueen »

beteljuice wrote:

Code: Select all

	 $rpt = preg_replace('/State: West Yorkshire/'i, 'County: West Yorkshire   Country: UK', $rpt, 1);
Thanks! I hardly dare say it, as I know absolutey zilch about Javascript etc., but to get it to work actually I had to have the i before the ':

Code: Select all

$rpt = preg_replace('/State: West Yorkshire/i', 'County: West Yorkshire   Country: UK', $rpt, 1);
Cheers
Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by beteljuice »

kingqueen wrote: ..Thanks! I hardly dare say it, as I know absolutey zilch about Javascript etc., but to get it to work actually I had to have the i before the ': ...
Arrgh ... the beteljuice had a bad bald day then and now.

You are correct of course :clap:
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
pernaczy
Posts: 133
Joined: Thu 15 Nov 2012 5:42 pm
Weather Station: Fine Offset WH 2080, TFA Spring
Operating System: Windows 7
Location: Niesiolowice, Northern Poland
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by pernaczy »

steve wrote:That's impossible! I tested it and it works! :lol:

But actually, I only tested the 'manual' saving, I forgot that the automatic saving is separate code :oops:

I'll change the other code and upload a new build later today.
Hi Steve,
It's me again. :oops: Today I had to regenerate my 2012 annual NOAA report file. From Cumulus menu I ask to generate this file then to save it. From drop-down menu I chose an option UTF-8. When editing this newly saved file under Notepad++ it says the format is ANSI.
I did the same with monthly file and here all is OK.
So it looks like the manual saving of (annual only) NOAA reports in UTF-8 format doesn't work. I have not checked other formats.
An automatic saving in UTF-8 format works fine.

Best Regards,
Piotr
The day when I have learned something is not the lost one.
Ignorance can be corrected with the help of a book. Stupidity requires a shotgun and a shovel.

Image
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by steve »

Yes, there's a typo in the code for manual saving of the annual report - fixed in the next build.
Steve
wetter-pocking
Posts: 4
Joined: Wed 04 Jan 2012 7:45 pm
Weather Station: Davis Monitor II
Operating System: Windows 7
Location: Pocking

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by wetter-pocking »

Does anybody know why the menu is invisible when current month is selected?
You can find my reports here: http://noaa.wetter-pocking.de/index.php
You do not have the required permissions to view the files attached to this post.
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by mcrossley »

I think we'd have to see the source PHP to figure that one out - I suspect the month offset, zero verses 1 for January is to blame somewhere.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by beteljuice »

I must admit to being a bit bemused .....

It seems to only happen for the current month.
You have set the 'system' to look for VWS type file formats, and the program seems to be finding them, but when I try to 'see' a named month or year file I get a 404 !

Could you please confirm your file formats please ?
Image
......................Imagine, what you will KNOW tomorrow !
wetter-pocking
Posts: 4
Joined: Wed 04 Jan 2012 7:45 pm
Weather Station: Davis Monitor II
Operating System: Windows 7
Location: Pocking

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by wetter-pocking »

Attached you will find the file format and php code.

This is a sample link to the files directory: http://noaa.wetter-pocking.de/reports/noaamo.txt
You do not have the required permissions to view the files attached to this post.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by beteljuice »

Image
......................Imagine, what you will KNOW tomorrow !
wetter-pocking
Posts: 4
Joined: Wed 04 Jan 2012 7:45 pm
Weather Station: Davis Monitor II
Operating System: Windows 7
Location: Pocking

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by wetter-pocking »

There is no "2013_08.txt", because this is the current month and the data is written to "noaamo.txt".

And there is no "2013.txt"-file, data of 2013 is written to "noaayr.txt".
BigOkie
Posts: 272
Joined: Tue 28 May 2013 1:06 am
Weather Station: Davis VP2 Plus
Operating System: Raspian Buster (RPi 3b)
Location: Tulsa, OK

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by BigOkie »

wetter-pocking wrote:Attached you will find the file format and php code.

This is a sample link to the files directory: http://noaa.wetter-pocking.de/reports/noaamo.txt
I'm not sure if this is relevant to your problem or not, but adding the mean baro and mean humidity columns takes this file format and invalidates it (NOAA format) as they do not include that data.

Just pointing that out. If you're using it for other things, then continue on.

:)
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by beteljuice »

There is no "2013_08.txt", because this is the current month and the data is written to "noaamo.txt".
True - however your screenshot shows one !
I'm not sure if this is relevant to your problem or not, but adding the mean baro and mean humidity columns takes this file format and invalidates it (NOAA format) as they do not include that data.
The content of the report is unimportant as far as this program is concerned as it merely displays it without any kind of processing.

ATM I can't understand why the 'dropdown' part of the menu is correctly populated but the 'current' isn't :?

The code is essentially the same as the original one by Ken True, it maybe that my Cumulus tweaks 'broke' the VWS functionality somehow - I will continue to investigate ....
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by laulau »

Laurent

Image
Post Reply