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

Station Status question

Discussion of Ken True's web site templates

Moderator: saratogaWX

User avatar
aznetcowboy
Posts: 357
Joined: Fri 04 Jan 2013 6:03 pm
Weather Station: Davis 6153 Vantage Pro2
Operating System: Windows 10 Home 64-bit
Location: West Bend, WI USA
Contact:

Station Status question

Post by aznetcowboy »

The normal station status readings are:
Component Status
Age h:m:s Latest update time as of 07/16/2014 10:13am

Cumulus realtime Current 0:00:05 07/16/2014 10:12am

Cumulus FTP Current 0:02:50 07/16/2014 10:10am

Cumulus weather data Current 0:03:02 07/16/2014 10:10am
Is there a way to add another update status readings to it? An example is my Fire Weather Index (FWI Calc) status.
Tom Wills
Ridge Run Weather Station: http://www.ridgerun.us
Image
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: Station Status question

Post by saratogaWX »

Easy to add. See the code in comments inside wxstatus.php

Code: Select all

<?php
############################################################################
#
# Add your custom checks below using the commented examples
#
# the do_check function has four arguments:
#   do_check($text,$target,$maxtime,$checktype);
#
# where:
#   $text is the text to display on the page.. always a good idea to run it
#        through langtransstr($text) for multilanguage support
#   $target is the item to be checked .. type of item is determined by $checktype
#
#     $target = relative file location/name if $checktype = 'file'
#     $target = unix timestamp (like from time() ) if $checktyp = 'application'
#
#   $maxtime is number of SECONDS expected between updates .. always allow a cushion
#        (extra time) to allow for delays in updates via FTP
#
#   $checktype defaults to 'file' type, use 'application' for timestamp checking from
#         applications.
#
#
############################################################################

/*
// example check for 'file' update time
        $tDir = './';
		if(file_exists($tDir.'somefile.ext')) {
           do_check(langtransstr("Some File"),$tDir.'somefile.ext',10*60+15,'file');
		
        }
	
// example check for 'application' update time (this WXSIM check is already in wxstatus.php)

		if(isset($SITE['WXSIM']) and file_exists('plaintext.txt')) {
	       $doPrint = false;
		   include_once($SITE['WXSIMscript']);
		   print "<!-- wdate='$wdate' -->\n";
		   $lastWXSIM = strtotime($wdate);
		   // note: '6*60*60 + 2*60' is 6:02:00 hms
           do_check(langtransstr("WXSIM forecast"),$lastWXSIM,6*60*60 + 2*60,'application');
		
        }

*/	
############################################################################
# start of custom checks (put your custom checks below)		



# end of custom checks
############################################################################
?>
User avatar
aznetcowboy
Posts: 357
Joined: Fri 04 Jan 2013 6:03 pm
Weather Station: Davis 6153 Vantage Pro2
Operating System: Windows 10 Home 64-bit
Location: West Bend, WI USA
Contact:

Re: Station Status question

Post by aznetcowboy »

Me thinks I am missing the obvious. I am getting nothing. What I am looking for is the find out when/if the file "fwiweb.xml" was uploaded to the root of my domain. I made some guesses as to what the code should have been, but I am no where near close to getting this correct. :cry:

As of right now, the result I am getting is:
Fire Weather Index Data NOT Current 390479:53:22 > 6:00:00

The code I have is:
$tDir = './';
if(file_exists($tDir.'fwiweb.xml')) {
do_check(langtransstr("Fire Weather Index Data"),$tDir.'fwiweb.xml',6*60*60,'fwiweb.xml');
}
The file timestamp is 3:021:02. The time calculation (6*60*60) is confusing. I assume it is where the > 6:00:00 is coming from. I am at least getting something right now, but not what is correct.
Tom Wills
Ridge Run Weather Station: http://www.ridgerun.us
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: Station Status question

Post by beteljuice »

Code: Select all

        6*60*60 // 6 HOURS

/* I assume you want 6 minutes (and a 'buffer') 6*60+15
    multiplication takes precedence so same as (6*60) +15
*/

Image
......................Imagine, what you will KNOW tomorrow !
User avatar
aznetcowboy
Posts: 357
Joined: Fri 04 Jan 2013 6:03 pm
Weather Station: Davis 6153 Vantage Pro2
Operating System: Windows 10 Home 64-bit
Location: West Bend, WI USA
Contact:

Re: Station Status question

Post by aznetcowboy »

beteljuice wrote:

Code: Select all

        6*60*60 // 6 HOURS

/* I assume you want 6 minutes (and a 'buffer') 6*60+15
    multiplication takes precedence so same as (6*60) +15
*/

I have modified the timing so that the file gets uploaded every 30 minutes, need it or not. The status code is now:
$tDir = './';
if(file_exists($tDir.'fwiweb.xml')) {
do_check(langtransstr("Fire Weather Index Data"),$tDir.'fwiweb.xml',30*60+15,'fwiweb.xml');
}

The results are: Fire Weather Index Data NOT Current 390482:19:36 > 0:30:15


The last update to the fwi file was 20 minutes ago. BTW, what is the "390482:19:36:\" and the "> 0:30:15"?
Tom Wills
Ridge Run Weather Station: http://www.ridgerun.us
Image
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: Station Status question

Post by saratogaWX »

Looking at the view-source of your wxstatus.php page shows
<h1>Weather Station Status</h1>
<p> <br/><br/>
Station system up for <b>16 hours 14 minutes</b><br/>
Station system free memory <b>2289/4094 MB (free/total)</b><br/>
This website uses <b>Cumulus
(1.9.4-b1096)</b> for weather conditions reporting.<br/>
It was last started <b>1 hour 56 minutes</b>.<br/></p>

<table width="620" border="0" cellspacing="6" cellpadding="3" style="border-collapse:collapse">
<tr>
<th style="width: 40%" scope="col">Component</th>
<th style="width: 15%" scope="col" align="center">Status</th>
<th style="width: 10%" scope="col" align="right">Age<br />h:m:s</th>
<th style="width: 35%" scope="col" align="right">Latest update time as of<br/> 07/18/2014 7:53pm</th>
</tr>

<!-- include-wxstatus.php - V1.05 - 06-Mar-2013 -->
<!-- ./realtime.txt age = 6 secs. 0:00:06 -->
<tr>
<td>Cumulus realtime</td>
<td align="center"><span style="color: green"><b>Current</b></span></td>
<td align="right">0:00:06</td>
<td align="right">07/18/2014 7:53pm </td>
</tr>
<!-- CUtags.php age = 217 secs. 0:03:37 -->
<tr>
<td>Cumulus FTP</td>
<td align="center"><span style="color: green"><b>Current</b></span></td>
<td align="right">0:03:37</td>
<td align="right">07/18/2014 7:50pm </td>
</tr>
<!-- CUtags.php internal update date time='7/18/2014 19:50' fixed='2014-07-18 19:50' -->
<!-- age = 229 secs. 0:03:49 -->
<tr>
<td>Cumulus weather data</td>
<td align="center"><span style="color: green"><b>Current</b></span></td>
<td align="right">0:03:49</td>
<td align="right">07/18/2014 7:50pm </td>
</tr>
<!-- GR3='/home/elghek00/domains/elgheko.us/public_html/GR3/KDMA_cr_0.jpg' -->
<!-- end include-wxstatus.php -->
<!-- age = 1405738429 secs. 390482:53:49 -->

<tr>
<td>Fire Weather Index Data</td>
<td align="center"><span style="color: red"><b>NOT Current</b></span></td>
<td align="right">390482:53:49</td>
<td align="right"> > 0:30:15 <br/><b></b></td>
</tr>

</table>
so the display is not 'Fire Weather Index Data' but the GRLevel3 Radar image data check, and
/GR3/KDMA_cr_0.jpg doesn't exist on your site.

Zip and attach your wxstatus.php page (or rename it to .txt and attach it here). I think your code shown in the above post is in a extended PHP comment (and is therefore not executed).

Best regards,
Ken
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: Station Status question

Post by beteljuice »

It should be in the form of - Age h:m:s Latest update time as of 07/16/2014 10:13am

but there is definately something odd going on.

What is the time/datestamp of your ./fwicalc.xml file ?
Last edited by beteljuice on Sat 19 Jul 2014 3:47 am, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
aznetcowboy
Posts: 357
Joined: Fri 04 Jan 2013 6:03 pm
Weather Station: Davis 6153 Vantage Pro2
Operating System: Windows 10 Home 64-bit
Location: West Bend, WI USA
Contact:

Re: Station Status question

Post by aznetcowboy »

Ken,

Here it (wxstatus.zip) is as requested.

Tom
You do not have the required permissions to view the files attached to this post.
Tom Wills
Ridge Run Weather Station: http://www.ridgerun.us
Image
User avatar
aznetcowboy
Posts: 357
Joined: Fri 04 Jan 2013 6:03 pm
Weather Station: Davis 6153 Vantage Pro2
Operating System: Windows 10 Home 64-bit
Location: West Bend, WI USA
Contact:

Re: Station Status question

Post by aznetcowboy »

beteljuice wrote:I should[/] be in the form of - Age h:m:s Latest update time as of 07/16/2014 10:13am

but there is definately something odd going on.

What is the time/datestamp of your ./fwicalc.xml file ?

The current timestamp is 08:04:18 and my current time is 08:20:00. Hmmmm, this doesn't happen to operate on a 24 HR clock does it?
Tom Wills
Ridge Run Weather Station: http://www.ridgerun.us
Image
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: Station Status question

Post by saratogaWX »

That timestamp of 1405738429 is essentially 'now'.

I just looked at wxstatus you posted, and your mod IS in the correct place.

If you're not running GRLevel3 radar, please change your Settings.php code

Code: Select all

$SITE['GR3radar']    = 'KDMA';    // set to lower-case full name of NEXRAD radar site
$SITE['GR3DIR']        = '/GR3';     // set to directory for GRLevel3 images (or '.' for root directory
$SITE['GR3type']    = 'cr';        // radar image type 'cr','br','cr248','br1' etc.
$SITE['GR3img']        = 'jpg';    // GR3 image type 'jpg' or 'png'
$SITE['GR3cnt']        = 10;        // number of images in series 10=(_0 ... _9 in name of file)
$SITE['GR3width']    = 512;        // width of GR3 images
$SITE['GR3height']  = 512;        // height of GR3 images
$SITE['showradarstatus'] = true; // set to false to suppress 'active' message by radar-status.php
to

Code: Select all

/*
$SITE['GR3radar']    = 'KDMA';    // set to lower-case full name of NEXRAD radar site
$SITE['GR3DIR']        = '/GR3';     // set to directory for GRLevel3 images (or '.' for root directory
$SITE['GR3type']    = 'cr';        // radar image type 'cr','br','cr248','br1' etc.
$SITE['GR3img']        = 'jpg';    // GR3 image type 'jpg' or 'png'
$SITE['GR3cnt']        = 10;        // number of images in series 10=(_0 ... _9 in name of file)
$SITE['GR3width']    = 512;        // width of GR3 images
$SITE['GR3height']  = 512;        // height of GR3 images
$SITE['showradarstatus'] = true; // set to false to suppress 'active' message by radar-status.php
*/
so the check for GR3 data (which is failing) should stop interfering with the display.

Then change your code from

Code: Select all

$tDir = './';
if(file_exists($tDir.'fwiweb.xml')) {
do_check(langtransstr("Fire Weather Index Data"),$tDir.'fwiweb.xml',30*60+15,'fwiweb.xml');
}
to

Code: Select all

$tDir = './';
if(file_exists($tDir.'fwiweb.xml')) {
do_check(langtransstr("Fire Weather Index Data"),$tDir.'fwiweb.xml',30*60+15,'file');
}
The last argument must be either 'file' or 'application' as values.. it doesn't understand the 'fwiweb.xml' 4th argument literal string.



Best regards,
Ken
User avatar
aznetcowboy
Posts: 357
Joined: Fri 04 Jan 2013 6:03 pm
Weather Station: Davis 6153 Vantage Pro2
Operating System: Windows 10 Home 64-bit
Location: West Bend, WI USA
Contact:

Re: Station Status question

Post by aznetcowboy »

saratogaWX wrote: <SNIP>

Then change your code from

Code: Select all

$tDir = './';
if(file_exists($tDir.'fwiweb.xml')) {
do_check(langtransstr("Fire Weather Index Data"),$tDir.'fwiweb.xml',30*60+15,'fwiweb.xml');
}
to

Code: Select all

$tDir = './';
if(file_exists($tDir.'fwiweb.xml')) {
do_check(langtransstr("Fire Weather Index Data"),$tDir.'fwiweb.xml',30*60+15,'file');
}
The last argument must be either 'file' or 'application' as values.. it doesn't understand the 'fwiweb.xml' 4th argument literal string.


Best regards,
Ken
Thank you Ken! I was wondering what that "file" meant. I blew that one, big time. Over the years I programmed in CA-Clipper and HTML, not PHP. :bash:

What has the GR3 got to do with it? That is one thing I've never been able to get working and I guess I forgot all about it over time. :groan:


Tom
Tom Wills
Ridge Run Weather Station: http://www.ridgerun.us
Image
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Station Status question

Post by dazza1223 »

can i uses on my site cumulus mx or i need to use it with the template wxstatus.php???
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
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: Station Status question

Post by saratogaWX »

The wxstatus.php (and include-wxstatus.php) do rely on having the Saratoga template installed for other parts that are used (Settings.php, Settings-weather.php, common.php).

The 'guts' of the page are handled in include-wxstatus.php -- you could replace all the $SITE['...'] variable calls with the appropriate data concerning your site, and use the basic code. A bit of a programming exercise, but doable, nonetheless.
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Station Status question

Post by dazza1223 »

well im not very good with php and i dont think u got the time to help me to set something like this up
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
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: Station Status question

Post by saratogaWX »

Generally, with PHP, you learn by doing. Having someone do it for you is not learning. This is a hobby.. enjoy it by learning :)
Post Reply