Author Topic: Add Blitzortung data feed status to wxstatus.php  (Read 1344 times)

0 Members and 1 Guest are viewing this topic.

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Add Blitzortung data feed status to wxstatus.php
« on: July 03, 2015, 03:43:22 PM »
Is there a way to automatically check the condition of the data coming to the Blitzortung scripts and depict it on the wxstatus.php page? I think that this could be a useful addition.

The basic format of the page showing data aging would be a good fit.

Maybe the skilled PHP gurus could cook something up...  :-"

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: Add Blitzortung data feed status to wxstatus.php
« Reply #1 on: July 03, 2015, 08:34:13 PM »
Hi Greg: I just added this line to my include-wxstatus.php-

Code: [Select]
// check Blitzortung cron
  $blitzDir = './BOmaps/cache/';
  if(isset($SITE['blitzDir'])) {$blitzDir = $SITE['blitzDir']; }
 
  if(file_exists($blitzDir.'BOOntario-map.html')) {
do_check(langtransstr("Cron animation Blitzortung"),$blitzDir.'BOOntario-map.html',5*60+15,'file');
 
  }

You can see it in action here-

http://www.beamsvillewx.ca/wxstatus.php
« Last Edit: July 03, 2015, 08:36:32 PM by weathergirl »
Ann-Marie
Beamsville, Ontario, Canada

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Add Blitzortung data feed status to wxstatus.php
« Reply #2 on: July 03, 2015, 09:23:13 PM »
Thanks, Ann-Marie. I'll try it tomorrow.

I gave it a quick try tonight, but I don't see anything happening on mine. My BOmaps are running on my other hosting server, miraculon.net. I do have an old BOmaps directory on rogerscityweather.com that isn't updating. I expected to see the status showing very old status.

Greg H.
« Last Edit: July 03, 2015, 09:55:58 PM by miraculon »


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Add Blitzortung data feed status to wxstatus.php
« Reply #3 on: July 04, 2015, 09:19:35 AM »
I noticed this message in the header of include-wxstatus.php
Code: [Select]
#   Please DO NOT CHANGE this file .. add your custom checks to wxstatus.php instead
#   That will make it easy to just replace this file as new weather software
#   is supported.

I tried adding it to this area in wxstatus.php and it still didn't work for me. I have meteobridge doing my uploads if that makes any difference.

Code: [Select]
############################################################################
# start of custom checks (put your custom checks below)

// check Blitzortung cron
  $blitzDir = './BOmaps/cache/';
  if(isset($SITE['blitzDir'])) {$blitzDir = $SITE['blitzDir']; }
 
  if(file_exists($blitzDir.'BOOntario-map.html')) {
do_check(langtransstr("Cron animation Blitzortung"),$blitzDir.'BOOntario-map.html',5*60+15,'file');
 
}


# end of custom checks
############################################################################

Yours obviously works.

I assume that I can point the blitzDir to my miraculon.net directory. I don't know if I need http:// and the full path for it to work. I need to get past the issue of it not showing the status based on the old files on rogerscityweather.com.

Greg H.



Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: Add Blitzortung data feed status to wxstatus.php
« Reply #4 on: July 04, 2015, 09:39:54 AM »
I would think that if your blitz files are on miraculon.net then that's where you need to point the script. My knowledge of this is rather limited but I've included my include-wxstatus.php if you would like to take a look at it.
Ann-Marie
Beamsville, Ontario, Canada

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Add Blitzortung data feed status to wxstatus.php
« Reply #5 on: July 04, 2015, 09:59:35 AM »
I got it to work when it is looking at the old files on rogerscityweather.com.

For pointing at miraculon.net, I tried

Code: [Select]
'miraculon.net/BOmaps/cache/'
Code: [Select]
'http://miraculon.net/BOmaps/cache/'
Code: [Select]
"http://miraculon.net/BOmaps/cache/"
I'll look at your file and see if I see anything I am missing. I'll also do some more homework on PHP.

Thanks for your help. I seem to be making some progress.
I use my other site for the BOMaps since it is not cached by Cloudflare.

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Add Blitzortung data feed status to wxstatus.php
« Reply #6 on: July 04, 2015, 10:14:51 AM »
I decided to say "why fight it?" and I reactivated the cron for the rogerscityweather.com set of BOMaps. I'll leave the actual maps over on miraculon.net. All I really want is a quick way to see if the BlitzO files are getting old. This works.

Once again, thank you very much for the help.

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Add Blitzortung data feed status to wxstatus.php
« Reply #7 on: July 04, 2015, 11:32:29 AM »
Changing include-wxstatus.php is not recommended -- it is subject to replacement when new weather software is added to the template set.

Changing the wxstatus.php itself, is the recommended method (as that page is not replaced with updates).

Here's what I do on my site:

To wxstatus.php, add (in the area reserved for additions)
Code: [Select]

$BOdir = './BOmap/cache/';

$BOfilesize = filesize("${BOdir}strikes.txt");

do_check('Cron animation Blitzortung <a href="${BOdir}gen-BO-maps-log.txt">status</a>'.
'<br/>&nbsp;&nbsp;Strikes file size '.show_size($BOfilesize)  ,
   '${BOdir}BONorthAmerica-ani.gif',60*5+15,'file');

function show_size($size)
{
 if (!is_numeric($size)) {return false;}
 else
 {
  if ($size >= 1073741824) {$size = round($size/1073741824*100)/100 ." GB";}
  elseif ($size >= 1048576) {$size = round($size/1048576*100)/100 ." MB";}
  elseif ($size >= 1024) {$size = round($size/1024*100)/100 ." KB";}
  else {$size = $size . " B";}
  return $size;
 }
} // end show_size


Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Add Blitzortung data feed status to wxstatus.php
« Reply #8 on: July 04, 2015, 02:06:28 PM »
For some reason, I couldn't quite get this exact method to work.
What I did was a hybrid of Ken's method and of what I had, adding a line to show the file size separately.

Quote
Weather Station Status



This website uses Meteobridge (2.5 build 6638 TL-MR3020) for weather conditions reporting.

820.04 KB is strikes.txt file size used by Blitzortung.
Component    Status    Age
h:m:s    Latest update time as of
Sat, 04-Jul-2015 2:02pm EDT
Meteobridge realtime    Current    0:00:00    Sat, 04-Jul-2015 2:02pm EDT
Meteobridge FTP    Current    0:00:14    Sat, 04-Jul-2015 2:01pm EDT
Meteobridge weather data    Current    0:00:14    Sat, 04-Jul-2015 2:01pm EDT
Cron animation Blitzortung    Current    0:00:23    Sat, 04-Jul-2015 2:01pm EDT

Code: [Select]
// Ken's version of checks for Blitzortung including file size

$BOdir = './BOmaps/cache/';

$BOfilesize = filesize("${BOdir}strikes.txt");

do_check (langtransstr("Cron animation Blitzortung"),$BOdir.'/BONorthAmerica-ani.gif',60*5+15,'file');

function show_size($size)
{
 if (!is_numeric($size)) {return false;}
 else
 {
  if ($size >= 1073741824) {$size = round($size/1073741824*100)/100 ." GB";}
  elseif ($size >= 1048576) {$size = round($size/1048576*100)/100 ." MB";}
  elseif ($size >= 1024) {$size = round($size/1024*100)/100 ." KB";}
  else {$size = $size . " B";}
  return $size;
 }
} // end show_size

print show_size($BOfilesize);

# end of custom checks

############################################################################
?>
 is <b>strikes.txt</b> file size used by Blitzortung.
  </table>
 
  <?php } else { // software not defined yet ?>
  <p>&nbsp;</p>
  <p>Weather Software not yet specified .. no status to report.</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <?php // end software not defined ?>
<hr>

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF