If you use Cumulus, please donate Image

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3041 Aug 17 2016

PHP Web 'viewer' for Cumulus NOAA Style reports

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

Moderators: daj, TNETWeather

User avatar
Solorize
Posts: 489
Joined: Tue Feb 01, 2011 8:22 am
Weather Station: WH1081
Operating System: Win 7, XP, Xubuntu, Linux Mint
Location: Wokingham, Berkshire, UK
Contact:

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

Postby Solorize » Wed Nov 02, 2011 7:56 am

Hi,

I've just noticed that my NOAA report on my website has not moved on to November.
i.e. not showing any data nor giving me the (NOV) month button at the top to click on.

can someone confirm if Cumulus generates and uploads the new month automatically
or do I need to generate each new month myself?

If Cumulus does not automatically generate and upload, will this be added into a
future Cumulus update?
Cumulus Real Time Data Grabber
http://bit.ly/WjBh5z

Wokingham Berkshire - weather station
http://www.wokinghamweather.co.uk

CGM UKScene Radio (pi)
http://cgmuksceneradio-pi.noip.me/

Image

User avatar
captzero
Posts: 363
Joined: Wed Mar 03, 2010 10:20 am
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows 10
Location: Brisbane, Australia
Contact:

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

Postby captzero » Wed Nov 02, 2011 7:58 am

Mine rolled over without any problems.
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.

User avatar
nking
Posts: 804
Joined: Thu Dec 17, 2009 2:03 pm
Weather Station: WH1081
Operating System: Windows 10
Location: Hurstpierpoint, West Sussex, UK
Contact:

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

Postby nking » Wed Nov 02, 2011 8:15 am

Solorize wrote:Can someone confirm if Cumulus generates and uploads the new month automatically
or do I need to generate each new month myself?

If Cumulus does not automatically generate and upload, will this be added into a
future Cumulus update?


It is a feature built into 1.9.2 (which I note you are using) and the parameters are under Configuration on the Cumulus control panel "NOAA Setup". I can confirm that mine is working automatically and generates the reports correctly.

User avatar
steve
Cumulus Author
Posts: 25239
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: Davis VP2
Operating System: Raspbian
Location: Sanday, Orkney
Contact:

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

Postby steve » Wed Nov 02, 2011 8:16 am

Solorize wrote:I've just noticed that my NOAA report on my website has not moved on to November.

Perhaps you had an ftp problem on the first upload after midnight. Did the report get created in the reports folder on your PC?
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Like Cumulus and want to support it? Please donate! Image

User avatar
Solorize
Posts: 489
Joined: Tue Feb 01, 2011 8:22 am
Weather Station: WH1081
Operating System: Win 7, XP, Xubuntu, Linux Mint
Location: Wokingham, Berkshire, UK
Contact:

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

Postby Solorize » Wed Nov 02, 2011 8:23 am

hmm,

I have just looked in my C:\Cumulus\Reports folder and can see that there is a txt file.
NOAAM01111.txt <--- which is the November report file, so it is logging it ok.


NOAAM01111.txt;

Code: Select all

                  Monthly Climatological Summary for Nov 2011

Name: Wokingham Weather   City: Wokingham   State: Berkshire
Elevation: 45 m  Lat: N 51° 25' 37"   Lon: W 000° 51' 02"

                  Temperature (°C), Rain (mm), Wind Speed (mph)

                                      Heat  Cool        Avg
    Mean                              Deg   Deg         Wind                 Dom
Day Temp  High   Time   Low    Time   Days  Days  Rain  Speed High   Time    Dir
----------------------------------------------------------------------------------
 1  12.0  16.2   12:27   6.2   23:53   6.3   0.0   0.3   3.6  15.2   02:23    SW
----------------------------------------------------------------------------------
    12.0  16.2     1     6.2     1     6.3   0.0   0.3   3.6  15.2     1      SW

Max >=  27.0:  0
Max <=   0.0:  0
Min <=   0.0:  0
Min <= -18.0:  0
Max Rain: 0.3 on day 1
Days of Rain: 1 (> 0.2 mm)  0 (> 2.0 mm)  0 (> 20.0 mm)
Heat Base: 18.3  Cool Base: 18.3  Method: Integration


I have looked in my NOAAYR2011.txt and it has an entry for the 11th month;

Code: Select all

Name: Wokingham Weather   City: Wokingham   State: Berkshire
Elevation: 45 m  Lat: N 51° 25' 37"   Lon: W 000° 51' 02"

                  Temperature (°C), Heat Base: 18.3  Cool Base: 18.3
                          Dep.  Heat  Cool                       Max  Max  Min  Min
        Mean  Mean        From  Deg   Deg                        >=   <=   <=   <=
 YR MO  Max   Min   Mean  Norm  Days  Days  Hi  Date  Low  Date 27.0  0.0  0.0 -18.0
------------------------------------------------------------------------------------
 11  1
 11  2  10.0   3.5   6.7   0.0   197     0  16.0  24   0.0   12    0    0    1    0
 11  3  14.8   1.5   7.6   0.0   332     0  22.9  25  -5.6    8    0    0   12    0
 11  4  20.2   6.6  13.1   0.0   155     0  28.8  23   2.0   13    1    0    0    0
 11  5  19.9   7.7  13.7   0.0   141     0  25.7   6   0.1    4    0    0    0    0
 11  6  21.7   9.4  15.5   0.0    92     9  30.7  27   4.5   12    2    0    0    0
 11  7  22.6  11.1  16.8   0.0    59    14  26.9   5   6.6   25    0    0    0    0
 11  8  21.9  11.7  16.6   0.0    84    30  29.4   1   6.8   19    3    0    0    0
 11  9  21.1  10.4  15.4   0.0   103    18  26.5   2   4.7   15    0    0    0    0
 11 10  17.4   8.6  12.8   0.0   178     7  27.1   1  -0.4   20    1    0    1    0
 11 11  16.2   6.2  12.0   0.0     6     0  16.2   1   6.2    1    0    0    0    0
 11 12
------------------------------------------------------------------------------------
        18.6   7.7  13.0   0.0  1351    79  30.7 Jun  -5.6  Mar    7    0   14    0

                                Precipitation (mm)


It looks like the files didnt get copied onto my server?

Could someone confirm what settings I need to have selected to have this
done automatically, just so I can check I have it all set up OK.

The only thing I can think off why it is not on my server is perhaps my internet connection
was down, when Cumulus went to upload the files and therefore they did not get coppied?


These are my settings on Cumulus;

Image
Cumulus Real Time Data Grabber
http://bit.ly/WjBh5z

Wokingham Berkshire - weather station
http://www.wokinghamweather.co.uk

CGM UKScene Radio (pi)
http://cgmuksceneradio-pi.noip.me/

Image

User avatar
nking
Posts: 804
Joined: Thu Dec 17, 2009 2:03 pm
Weather Station: WH1081
Operating System: Windows 10
Location: Hurstpierpoint, West Sussex, UK
Contact:

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

Postby nking » Wed Nov 02, 2011 8:32 am

Your settings look fine and if during October it was updating daily then you have them set right. Like Steve mentions, your FTP may have misfunctioned when the auto FTP was attempted.

User avatar
Solorize
Posts: 489
Joined: Tue Feb 01, 2011 8:22 am
Weather Station: WH1081
Operating System: Win 7, XP, Xubuntu, Linux Mint
Location: Wokingham, Berkshire, UK
Contact:

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

Postby Solorize » Wed Nov 02, 2011 1:25 pm

Yup I guess it must have been a problem with the FTP upload.

I have manually copied them over to my server so hopefully
it will work ok from now on.

Thanks
Cumulus Real Time Data Grabber
http://bit.ly/WjBh5z

Wokingham Berkshire - weather station
http://www.wokinghamweather.co.uk

CGM UKScene Radio (pi)
http://cgmuksceneradio-pi.noip.me/

Image

User avatar
mcrossley
Posts: 4615
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

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

Postby mcrossley » Wed Nov 02, 2011 5:57 pm

I just dropped the script on my web server, I had to comment out the setting of the TZ variable (line 159) as the server did not like that, but I get a couple of errors which seem to relate to the non-existent (yet) December 11 report...?

Notice: Undefined index: NOAAMO1211.txt in C:\xampp\htdocs\weather\NOAA-reports.php on line 301
Notice: Undefined offset: 13 in C:\xampp\htdocs\weather\NOAA-reports.php on line 325

http://weather.wilmslowastro.com/noaa-reports.php

User avatar
beteljuice
Posts: 2430
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

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

Postby beteljuice » Wed Nov 02, 2011 11:17 pm

I think it's because your error reporting is at twitch level (insisting variables are declared up front and not dynamically)

Try this please:
NOAA-reports.zip

I don't understand why your TZ failed - works on PHP 4.5 up :?

Edit: I see that you've edited out //putenv("TZ=$ourTZ");
Does it work if you use 'old' style declaration ?
You do not have the required permissions to view the files attached to this post.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
mcrossley
Posts: 4615
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

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

Postby mcrossley » Thu Nov 03, 2011 9:09 am

Hi beteljuice, just the same with that version :(
Notice that if you select a year, then an additional error is displayed
http://weather.wilmslowastro.com/noaa-r ... hp?yr=2011

User avatar
mcrossley
Posts: 4615
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

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

Postby mcrossley » Thu Nov 03, 2011 9:34 am

Changing line 302 to:

Code: Select all

if (array_key_exists($testfile, $filesfound)) {

fixes that problem, trying to figure out which index is going out of bounds at line 326...

Edit: Got it, in the month for loop $m is incremented before the range check, so when the loop exits $m=13
change line 326 to:

Code: Select all

if($y != $first_year) { $nav_build[$y]['months'][$m-1] .= "<br />\n";}
and that fixes it.

And finally changed 367-371 to:

Code: Select all

         if (array_key_exists($testfile, $filesfound)) {
            $advisory = "<br /><b>Report for $yr ";
            if ($mo) {$advisory .= $months[$mo];}
            $advisory .= "</b>\n";
            $rpt = implode("",file("$NOAAdir/$testfile"));

User avatar
mcrossley
Posts: 4615
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

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

Postby mcrossley » Thu Nov 03, 2011 10:07 am

Oh, and the putenv error? I run in Safe Mode, so
In Safe Mode, the user may only alter environment variables whose names begin with the prefixes supplied by this directive. By default, users will only be able to set environment variables that begin with PHP_
http://php.net/manual/en/function.putenv.php

User avatar
beteljuice
Posts: 2430
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

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

Postby beteljuice » Thu Nov 03, 2011 1:07 pm

Cheers Mark, I'll check that out and update later.

Never used array_key_exists, I'll have to look it up :?
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
mcrossley
Posts: 4615
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

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

Postby mcrossley » Thu Nov 03, 2011 2:03 pm

I hadn't either, but looking up on how to trap 'does not exist' errors found it, you cannot pass the missing array member to any of the normal error checking routines because it doesn't exist so the act of passing it causes an error - doh!

User avatar
beteljuice
Posts: 2430
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

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

Postby beteljuice » Thu Nov 03, 2011 2:33 pm

mcrossley wrote:...
And finally changed 367-371 to:

Code: Select all

         if (array_key_exists($testfile, $filesfound)) {
            $advisory = "<br /><b>Report for $yr ";
            if ($mo) {$advisory .= $months[$mo];}
            $advisory .= "</b>\n";
            $rpt = implode("",file("$NOAAdir/$testfile"));

I elected to go 'terse' - same but different ;)

Code: Select all

         if (array_key_exists($testfile, $filesfound)) {
            $advisory = "<br /><b>Report for $yr " .($mo ? $months[$mo] : ''). "</b>\n";
            $rpt = implode("",file("$NOAAdir/$testfile"));

         } else {
Image
......................Imagine, what you will KNOW tomorrow !


Return to “Web site - General”

Who is online

Users browsing this forum: Bing [Bot], Toxic17 and 2 guests