Author Topic: AS3595 not Detecting Strikes  (Read 37425 times)

0 Members and 1 Guest are viewing this topic.

Offline dfroula

  • Forecaster
  • *****
  • Posts: 551
Re: AS3595 not Detecting Strikes
« Reply #125 on: July 24, 2014, 10:36:57 PM »
I tried all night to get it with no success. I am getting the UTC returned. How can it be adjusted for central time and date?

Try adding this line as the first line of the log_as3935.php script:

Code: [Select]
date_default_timezone_set('America/Los_Angeles');
Use the correct timezone from this list:

http://php.net/manual/en/timezones.america.php

Don
WD9DMP

Offline dfroula

  • Forecaster
  • *****
  • Posts: 551
Re: AS3595 not Detecting Strikes
« Reply #126 on: July 24, 2014, 10:39:07 PM »
Great!  \:D/

I must have gone around in circles on this, but the last thing I did was

Code: [Select]
Code: [Select]

<script src="./jquery-1.11.0.min.js"></script>
<script src="./jquery.csv-0.71.js"></script>

and it worked!  \:D/

Thanks!

Greg

Offline Dr Obbins

  • Forecaster
  • *****
  • Posts: 1152
Re: AS3595 not Detecting Strikes
« Reply #127 on: July 25, 2014, 03:55:34 AM »
I tried all night to get it with no success. I am getting the UTC returned. How can it be adjusted for central time and date?

Try adding this line as the first line of the log_as3935.php script:

Code: [Select]
date_default_timezone_set('America/Los_Angeles');
Use the correct timezone from this list:

http://php.net/manual/en/timezones.america.php

Don
WD9DMP
That did the trick.
Thanks!

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: AS3595 not Detecting Strikes
« Reply #128 on: July 26, 2014, 06:10:16 PM »
I must have gone around in circles on this, but the last thing I did was

Code: [Select]
Code: [Select]

<script src="./jquery-1.11.0.min.js"></script>
<script src="./jquery.csv-0.71.js"></script>

and it worked!  \:D/

Thanks!

Greg

Now that I am getting some real strike data again,  I see that I have some missing data fields. Any ideas?

Quote
07/26/2014,21:52:48,07/26/2014 21:52:48,9,,,0,,27,50,,,,,,
07/26/2014,21:53:32,07/26/2014 21:53:32,9,,,0,,27,50,,,,,,
07/26/2014,21:54:19,07/26/2014 21:54:19,9,,,0,,27,50,,,,,,
07/26/2014,21:54:31,07/26/2014 21:54:31,7,,,0,,27,50,,,,,,
07/26/2014,21:54:46,07/26/2014 21:54:46,7,,,0,,27,50,,,,,,
07/26/2014,21:55:12,07/26/2014 21:55:12,7,,,0,,27,50,,,,,,
07/26/2014,21:55:31,07/26/2014 21:55:31,9,,,0,,27,50,,,,,,
07/26/2014,21:57:31,07/26/2014 21:57:31,7,,,0,,27,50,,,,,,
07/26/2014,21:59:46,07/26/2014 21:59:46,5,,,0,,27,50,,,,,,
07/26/2014,22:00:38,07/26/2014 22:00:38,3,,,0,,27,50,,,,,,
07/26/2014,22:01:02,07/26/2014 22:01:02,3,,,0,,27,50,,,,,,
07/26/2014,22:01:32,07/26/2014 22:01:32,2,,,0,,27,50,,,,,,
07/26/2014,22:02:39,07/26/2014 22:02:39,2,,,0,,27,50,,,,,,

Quote
Last Strike
==== ======
Latest Strike:.................07/26/2014 22:02:39
Latest Strike Distance:........ KM
Latest Strike Energy:..........

Last Event
==== =====
Number of Strikes in Event:....2
Lightning Event Duration:...... Seconds
Current Event Strike Rate:.....0 Strikes/Minute
Shortest Distance to Strike:...27 KM
Longest Distance to Strike:....50 KM
Lowest Strike Intensity:.......
Highest Strike Intensity:......
Total strikes since reboot:....

I see energy being displayed in the controller web interface for the AS3935.

Greg H.





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

Offline dfroula

  • Forecaster
  • *****
  • Posts: 551
Re: AS3595 not Detecting Strikes
« Reply #129 on: July 27, 2014, 12:17:40 AM »
Greg, can you post your log_as3935.php script here, in a code block?

Don
WD9DMP

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: AS3595 not Detecting Strikes
« Reply #130 on: July 27, 2014, 08:17:29 AM »
Here you go. Thanks for having a look...
Let me know what dumb mistake I made... #-o

Greg H.

 
Code: [Select]
<?php
$date 
date("m/d/Y");
$time date("G:i:s");
$datetime "$date $time";

# Retrieve all possible value names and values from Controller on strike event for testing and save to file.
# $file_test = fopen("/virtual/users/e17373-19178/web/froula/as3935_test.txt","w");
# foreach ($_GET as $key => $value)
# {
# fwrite($file_test,"$key:  $value\n");
# }
# fclose($file_test);

$strokes $_GET['strokes'];
$disturbers $_GET['disturbers'];
$duration $_GET['duration'];
#$rate = $strokes;
if ($duration <= 60) {
($rate 0);
} else {
$rate round(($strokes/$duration*60),2);
}
$dist $_GET['dist'];
$dist_min $_GET['dist_min'];
$dist_max $_GET['dist_max'];
$energy $_GET['energy'];
$energy_min $_GET['energy_min'];
$energy_max $_GET['energy_max'];
$strokes_all $_GET['strokes_all'];
$disturbers_all $_GET['disturbers_all'];
$events $_GET['events'];

if (!
file_exists("/virtual/users/e17373-19178/web/froula/as3935_log.txt")) {
     
$file fopen("/virtual/users/e17373-19178/web/froula/as3935_log.txt","w");
     
fwrite($file,"Date,Time,Date-Time,Event Strokes,Event Disturbers,Event Duration,Event Strike Rate,Current Strike Distance,Event Min Distance,Event Max Distance,Current Strike Energy,Event Min Energy,Event Max Energy,All Strokes,All Disturbers,Events\n");
fclose($file);
     }

$file fopen("/virtual/users/e17373-19178/web/froula/as3935_log.txt","a");
fwrite($file,"$date,$time,$datetime,$strokes,$disturbers,$duration,$rate,$dist,$dist_min,$dist_max,$energy,$energy_min,$energy_max,$strokes_all,$disturbers_all,$events\n");
fclose($file);

$file2 fopen("/virtual/users/e17373-19178/web/froula/as3935_display.txt","w");
fwrite($file2,"\nLast Strike\n==== ======\nLatest Strike:.................$date $time\nLatest Strike Distance:........$dist KM\nLatest Strike Energy:..........$energy\n\nLast Event\n==== =====\nNumber of Strikes in Event:....$strokes\nLightning Event Duration:......$duration Seconds\nCurrent Event Strike Rate:.....$rate Strikes/Minute\nShortest Distance to Strike:...$dist_min KM\nLongest Distance to Strike:....$dist_max KM\nLowest Strike Intensity:.......$energy_min\nHighest Strike Intensity:......$energy_max\nTotal strikes since reboot:....$strokes_all\n");
fclose($file2);
?>



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

Offline dfroula

  • Forecaster
  • *****
  • Posts: 551
Re: AS3595 not Detecting Strikes
« Reply #131 on: July 27, 2014, 10:49:28 AM »
Greg,

The script looks fine. However, the Controller is not sending all of the data fields to the URL, for some reason. I see empty data fields in your log file.

Could you post or PM me screen grabs from the AS3935, Alerts, and Actions sections of the controller Settings tab? I suspect something is mis-configured.

Don
WD9DMP

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: AS3595 not Detecting Strikes
« Reply #132 on: July 27, 2014, 12:45:30 PM »
Greg,

The script looks fine. However, the Controller is not sending all of the data fields to the URL, for some reason. I see empty data fields in your log file.

Could you post or PM me screen grabs from the AS3935, Alerts, and Actions sections of the controller Settings tab? I suspect something is mis-configured.

Don
WD9DMP

Will do. Just FYI and pondering  :-k I have the I2C rate set to 400k. I wonder if this is "too fast" for some reason. I could try slowing it down to the 50k I used to run it at. I haven't seen any complaints in the logger when I had AS3935 logging active and the other data is OK. I would think that if something is being clobbered I would see corruption in the logging output.

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: AS3595 not Detecting Strikes
« Reply #133 on: July 27, 2014, 12:55:49 PM »
Greg,

The script looks fine. However, the Controller is not sending all of the data fields to the URL, for some reason. I see empty data fields in your log file.

Could you post or PM me screen grabs from the AS3935, Alerts, and Actions sections of the controller Settings tab? I suspect something is mis-configured.

Don
WD9DMP

Will do. Just FYI and pondering  :-k I have the I2C rate set to 400k. I wonder if this is "too fast" for some reason. I could try slowing it down to the 50k I used to run it at. I haven't seen any complaints in the logger when I had AS3935 logging active and the other data is OK. I would think that if something is being clobbered I would see corruption in the logging output.

Greg H.

See attached below:



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

Offline dfroula

  • Forecaster
  • *****
  • Posts: 551
Re: AS3595 not Detecting Strikes
« Reply #134 on: July 27, 2014, 12:59:37 PM »
400k is the maximum, and very high. I set mine to 150k, just to move it above the lightning detection range, on the theory the bus frequency could potentially cause some interference.

Try lowering it. It appears that certain variables are not being included in the call to the script, as they are never assigned within the script and show as null data entires in the log file. There should always be something there if the controller has the AS3935 data, even if zero.

Don

Will do. Just FYI and pondering  :-k I have the I2C rate set to 400k. I wonder if this is "too fast" for some reason. I could try slowing it down to the 50k I used to run it at. I haven't seen any complaints in the logger when I had AS3935 logging active and the other data is OK. I would think that if something is being clobbered I would see corruption in the logging output.

Greg H.

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: AS3595 not Detecting Strikes
« Reply #135 on: July 27, 2014, 01:08:10 PM »
400k is the maximum, and very high. I set mine to 150k, just to move it above the lightning detection range, on the theory the bus frequency could potentially cause some interference.

Try lowering it. It appears that certain variables are not being included in the call to the script, as they are never assigned within the script and show as null data entires in the log file. There should always be something there if the controller has the AS3935 data, even if zero.

Don

Will do. Just FYI and pondering  :-k I have the I2C rate set to 400k. I wonder if this is "too fast" for some reason. I could try slowing it down to the 50k I used to run it at. I haven't seen any complaints in the logger when I had AS3935 logging active and the other data is OK. I would think that if something is being clobbered I would see corruption in the logging output.

Greg H.

We have boomers on the way, so I'll try this now and let you know....

Greg H.



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

Offline dfroula

  • Forecaster
  • *****
  • Posts: 551
Re: AS3595 not Detecting Strikes
« Reply #136 on: July 27, 2014, 01:13:07 PM »
I think I see the problem. You have both Server alerts and AS3935 alerts enabled. However, both alert types will call the same PHP script. The PHP script will only parse the parameters sent when the PHP call is triggered by the AS3935.

The erroneous data is caused by the PHP script being triggered by server alerts. Tobi used some common variable names between those included in the AS3935 alerts and the Server alerts. Those comon variables are being parsed by the PHP script, but the others are missing! That's why only the common parameter names are being registered.

There is also a precedence issue with having two AS3935 alerts defined with different criteria.

The logging script assumes the AS3935 action triggers on a single strike.

So, disable the Server alerts. Disable all but one AS3935 action and set it to trigger on a single strike at the desired distance, calling whatever action you wish. It is best that the action called is the first in the Actions list, as that one will have priority over the others. If you only have one Action defined, this should not matter.

I hope this all makes sense....Confusing.

I do have a new script that can detect if the Action is triggered by the AS3935 or a Server alert. It routes the data to a different log file, if triggered by a Server alert. However, you need to have both the AS3935 and Server alert call the SAME action to avoid one alert blocking the other.

Whew!

Here's the new script:

Code: [Select]
<?php
date_default_timezone_set
('America/Chicago');
$date date("m/d/Y");
$time date("G:i:s");
$datetime "$date $time";

# Retrieve all possible value names and values from Controller on strike event for testing and save to file.
# $file_test = fopen("/volume1/web/as3935_test.txt","w");
# foreach ($_GET as $key => $value)
# {
# fwrite($file_test,"$key:  $value\n");
# }
# fclose($file_test);

# Combined parameters (AS3935 and Server Alerts)
$strokes $_GET['strokes'];
$dist_min $_GET['dist_min'];
$dist_max $_GET['dist_max'];


# AS3935 Parameters
$disturbers $_GET['disturbers'];
$duration $_GET['duration'];
if (
$duration <= 60) {
($rate 0);
} else {
$rate round(($strokes/$duration*60),2);
}
$dist $_GET['dist'];
$energy $_GET['energy'];
$energy_min $_GET['energy_min'];
$energy_max $_GET['energy_max'];
$strokes_all $_GET['strokes_all'];
$disturbers_all $_GET['disturbers_all'];
$events $_GET['events'];

# Server Alert Parameters
$action $_GET['action'];
$name $_GET['name'];
$first $_GET['first'];
$last $_GET['last'];
$name $_GET['name'];
$strokes_per_min_last $_GET['strokes_per_min_last'];
$strokes_per_min_max $_GET['strokes_per_min_max'];
$arrival_time $_GET['arrival_time'];
$dist_last $_GET['dist_last'];
$degerees_last $_GET['degerees_last'];
$degrees_mean $_GET['degrees_mean'];
$trend_pct $_GET['trend_pct'];
$trend_sec $_GET['trend_sec'];

if (
$energy) {
if (!
file_exists("/volume1/web/as3935_log.txt")) {
     
$file fopen("/volume1/web/as3935_log.txt","w");
     
fwrite($file,"Date,Time,Date-Time,Event Strokes,Event Disturbers,Event Duration,Event Strike Rate,Current Strike Distance,Event Min Distance,Event Max Distance,Current Strike Energy,Event Min Energy,Event Max Energy,All Strokes,All Disturbers,Events\n");
fclose($file);
     }

$file fopen("/volume1/web/as3935_log.txt","a");
fwrite($file,"$date,$time,$datetime,$strokes,$disturbers,$duration,$rate,$dist,$dist_min,$dist_max,$energy,$energy_min,$energy_max,$strokes_all,$disturbers_all,$events\n");
fclose($file);

$file2 fopen("/volume1/web/as3935_display.txt","w");
fwrite($file2,"\nLast Strike\n==== ======\nLatest Strike:.................$date $time\nLatest Strike Distance:........$dist KM\nLatest Strike Energy:..........$energy\n\nLast Event\n==== =====\nNumber of Strikes in Event:....$strokes\nLightning Event Duration:......$duration Seconds\nCurrent Event Strike Rate:.....$rate Strikes/Minute\nShortest Distance to Strike:...$dist_min KM\nLongest Distance to Strike:....$dist_max KM\nLowest Strike Intensity:.......$energy_min\nHighest Strike Intensity:......$energy_max\nTotal strikes since reboot:....$strokes_all\n");
fclose($file2);
}

if (
$dist_last) {
if (!
file_exists("/volume1/web/alerts_log.txt")) {
     
$file fopen("/volume1/web/alerts_log.txt","w");
     
fwrite($file,"Date,Time,Date-Time,Action Number,Action Name,First Strike Time,Last Strike Time,Number of Strikes,Last Strike Rate,Max Strike Rate,Arrival Time,Last Strike Distance,Min Strike Distance,Max Strike Distance,Last Strike Bearing,Mean Strike Bearing,Trend Percent,Trend Seconds\n");
fclose($file);
     }

$file fopen("/volume1/web/alerts_log.txt","a");
fwrite($file,"$date,$time,$datetime,$action,$name,$first,$last,$strokes,$strokes_per_min_last,$strokes_per_min_max,$arrival_time,$dist_last,$dist_min,$dist_max,$degerees_last,$degrees_mean,$trend_pct,$trend_sec\n");
fclose($file);

$file2 fopen("/volume1/web/alerts_display.txt","w");
fwrite($file2,"\nLast Strike\n==== ======\nLatest Strike:.................$last\nLatest Strike Distance:........$dist_last KM\nLatest Strike Rate:............$strokes_per_min_last Strikes/Minute\nLatest Strike Bearing:.........$degerees_last Degrees\n\nLast Event\n==== =====\nFirst Lightning in Event:......$first\nMaximum Event Strike Rate:.....$strokes_per_min_max Strikes/Minute\nShortest Distance to Strike:...$dist_min KM\nLongest Distance to Strike:....$dist_max KM\nMean Strike Bearing:...........$degrees_mean Degrees\n");
fclose($file2);

}
 
?>

Note I added a line to set the time zone in the first line of the script.

Don
WD9DMP

Offline dfroula

  • Forecaster
  • *****
  • Posts: 551
Re: AS3595 not Detecting Strikes
« Reply #137 on: July 27, 2014, 01:21:18 PM »
BTW, I have a new set of graphing scripts for the Server alerts. It reads the new Server alert log file and plots distance, rate, and bearing in individual charts. Get the Controller setting sorted first, and use that new script (with adjusted path names). The new graph scripts will then read the new log file the new version of the script creates.

Don
WD9DMP

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: AS3595 not Detecting Strikes
« Reply #138 on: July 27, 2014, 01:28:45 PM »
I think I see the problem. You have both Server alerts and AS3935 alerts enabled. However, both alert types will call the same PHP script. The PHP script will only parse the parameters sent when the PHP call is triggered by the AS3935.

The erroneous data is caused by the PHP script being triggered by server alerts. Tobi used some common variable names between those included in the AS3935 alerts and the Server alerts. Those comon variables are being parsed by the PHP script, but the others are missing! That's why only the common parameter names are being registered.

There is also a precedence issue with having two AS3935 alerts defined with different criteria.

The logging script assumes the AS3935 action triggers on a single strike.

So, disable the Server alerts. Disable all but one AS3935 action and set it to trigger on a single strike at the desired distance, calling whatever action you wish. It is best that the action called is the first in the Actions list, as that one will have priority over the others. If you only have one Action defined, this should not matter.

I hope this all makes sense....Confusing.

I do have a new script that can detect if the Action is triggered by the AS3935 or a Server alert. It routes the data to a different log file, if triggered by a Server alert. However, you need to have both the AS3935 and Server alert call the SAME action to avoid one alert blocking the other.

Whew!

Here's the new script:

Code: [Select]
<?php
date_default_timezone_set
('America/Chicago');
$date date("m/d/Y");
$time date("G:i:s");
$datetime "$date $time";

# Retrieve all possible value names and values from Controller on strike event for testing and save to file.
# $file_test = fopen("/volume1/web/as3935_test.txt","w");
# foreach ($_GET as $key => $value)
# {
# fwrite($file_test,"$key:  $value\n");
# }
# fclose($file_test);

# Combined parameters (AS3935 and Server Alerts)
$strokes $_GET['strokes'];
$dist_min $_GET['dist_min'];
$dist_max $_GET['dist_max'];


# AS3935 Parameters
$disturbers $_GET['disturbers'];
$duration $_GET['duration'];
if (
$duration <= 60) {
($rate 0);
} else {
$rate round(($strokes/$duration*60),2);
}
$dist $_GET['dist'];
$energy $_GET['energy'];
$energy_min $_GET['energy_min'];
$energy_max $_GET['energy_max'];
$strokes_all $_GET['strokes_all'];
$disturbers_all $_GET['disturbers_all'];
$events $_GET['events'];

# Server Alert Parameters
$action $_GET['action'];
$name $_GET['name'];
$first $_GET['first'];
$last $_GET['last'];
$name $_GET['name'];
$strokes_per_min_last $_GET['strokes_per_min_last'];
$strokes_per_min_max $_GET['strokes_per_min_max'];
$arrival_time $_GET['arrival_time'];
$dist_last $_GET['dist_last'];
$degerees_last $_GET['degerees_last'];
$degrees_mean $_GET['degrees_mean'];
$trend_pct $_GET['trend_pct'];
$trend_sec $_GET['trend_sec'];

if (
$energy) {
if (!
file_exists("/volume1/web/as3935_log.txt")) {
     
$file fopen("/volume1/web/as3935_log.txt","w");
     
fwrite($file,"Date,Time,Date-Time,Event Strokes,Event Disturbers,Event Duration,Event Strike Rate,Current Strike Distance,Event Min Distance,Event Max Distance,Current Strike Energy,Event Min Energy,Event Max Energy,All Strokes,All Disturbers,Events\n");
fclose($file);
     }

$file fopen("/volume1/web/as3935_log.txt","a");
fwrite($file,"$date,$time,$datetime,$strokes,$disturbers,$duration,$rate,$dist,$dist_min,$dist_max,$energy,$energy_min,$energy_max,$strokes_all,$disturbers_all,$events\n");
fclose($file);

$file2 fopen("/volume1/web/as3935_display.txt","w");
fwrite($file2,"\nLast Strike\n==== ======\nLatest Strike:.................$date $time\nLatest Strike Distance:........$dist KM\nLatest Strike Energy:..........$energy\n\nLast Event\n==== =====\nNumber of Strikes in Event:....$strokes\nLightning Event Duration:......$duration Seconds\nCurrent Event Strike Rate:.....$rate Strikes/Minute\nShortest Distance to Strike:...$dist_min KM\nLongest Distance to Strike:....$dist_max KM\nLowest Strike Intensity:.......$energy_min\nHighest Strike Intensity:......$energy_max\nTotal strikes since reboot:....$strokes_all\n");
fclose($file2);
}

if (
$dist_last) {
if (!
file_exists("/volume1/web/alerts_log.txt")) {
     
$file fopen("/volume1/web/alerts_log.txt","w");
     
fwrite($file,"Date,Time,Date-Time,Action Number,Action Name,First Strike Time,Last Strike Time,Number of Strikes,Last Strike Rate,Max Strike Rate,Arrival Time,Last Strike Distance,Min Strike Distance,Max Strike Distance,Last Strike Bearing,Mean Strike Bearing,Trend Percent,Trend Seconds\n");
fclose($file);
     }

$file fopen("/volume1/web/alerts_log.txt","a");
fwrite($file,"$date,$time,$datetime,$action,$name,$first,$last,$strokes,$strokes_per_min_last,$strokes_per_min_max,$arrival_time,$dist_last,$dist_min,$dist_max,$degerees_last,$degrees_mean,$trend_pct,$trend_sec\n");
fclose($file);

$file2 fopen("/volume1/web/alerts_display.txt","w");
fwrite($file2,"\nLast Strike\n==== ======\nLatest Strike:.................$last\nLatest Strike Distance:........$dist_last KM\nLatest Strike Rate:............$strokes_per_min_last Strikes/Minute\nLatest Strike Bearing:.........$degerees_last Degrees\n\nLast Event\n==== =====\nFirst Lightning in Event:......$first\nMaximum Event Strike Rate:.....$strokes_per_min_max Strikes/Minute\nShortest Distance to Strike:...$dist_min KM\nLongest Distance to Strike:....$dist_max KM\nMean Strike Bearing:...........$degrees_mean Degrees\n");
fclose($file2);

}
 
?>

Note I added a line to set the time zone in the first line of the script.

Don
WD9DMP

Yup! That's it. As soon as I disabled the ToA alerts, the data started populating.

Greg H.



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

Offline dfroula

  • Forecaster
  • *****
  • Posts: 551
Re: AS3595 not Detecting Strikes
« Reply #139 on: July 27, 2014, 01:53:10 PM »
Good!

I also suggest using the "outdoor" setting on the AS3935. It seems to work much better and gives better distance calculations.

Note I have my "Tune CAP" setting manually set to the value on the envelope when I received the board. Set to your value, or use "Auto-tune".

Don
WD9DMP

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: AS3595 not Detecting Strikes
« Reply #140 on: July 27, 2014, 02:15:06 PM »
I have tried the "outdoor", but the current settings seem to work the best for my situation.
I have long lost the ESD bag with the label, but I set "5" based on the log results with automatic.

The new script seems to be working well. A million thanks for your help.  =D&gt;

I'll leave a single level of alerts/actions for the AS3935 so things don't get confuzzled.

Greg H.



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

Offline dfroula

  • Forecaster
  • *****
  • Posts: 551
Re: AS3595 not Detecting Strikes
« Reply #141 on: July 27, 2014, 02:35:06 PM »
Very good!

Remember, if you have the AS3935 alert criteria calling action #1 and the TOA alerts calling Action #2, and both alerts occur at the same time, the AS3935 action will block the TOA action, as the lower-numbered action has precedence.

Ideally, both the AS3935 and TOA alerts should call the SAME action. This prevents provisioning a unique sound for each alert type, but allows the alerts to be queued and logged properly.

Don
WD9DMP

Offline dfroula

  • Forecaster
  • *****
  • Posts: 551
Re: AS3595 not Detecting Strikes
« Reply #142 on: July 27, 2014, 02:37:16 PM »
I checked both your http://www.miraculon.net/froula/as3935_log.txt and http://www.miraculon.net/froula/alerts_log.txt files. Looks like the new script is correctly sorting out the alert logging. I do see the AS3935 logs have a full set of data fields.

Don
WD9DMP

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: AS3595 not Detecting Strikes
« Reply #143 on: July 27, 2014, 03:21:32 PM »
Very good!

Remember, if you have the AS3935 alert criteria calling action #1 and the TOA alerts calling Action #2, and both alerts occur at the same time, the AS3935 action will block the TOA action, as the lower-numbered action has precedence.

Ideally, both the AS3935 and TOA alerts should call the SAME action. This prevents provisioning a unique sound for each alert type, but allows the alerts to be queued and logged properly.

Don
WD9DMP

I set the more distant TOA alert to Action 1, same as the AS3935.

Greg


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

Offline dfroula

  • Forecaster
  • *****
  • Posts: 551
Re: AS3595 not Detecting Strikes
« Reply #144 on: July 27, 2014, 05:31:58 PM »
Here are the TOA alert display scripts:

alert_distance.html:

Code: [Select]
<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="refresh" content="60">
   <title>Server Alerts Distance</title>
   <script src="https://www.google.com/jsapi"></script>
   <script src="./jquery-1.11.0.min.js"></script>
   <script src="./jquery.csv-0.71.js"></script>

   <script>
    // load the visualization library from Google and set a listener
    google.load("visualization", "1", {packages:["corechart"]});

    // next line prevents caching of retrieved data by IE and possibly other browsers.
    // without this, IE11 never updated the graphs on new strike data being added to the .csv file.
    $.ajaxSetup({ cache: false });

    google.setOnLoadCallback(drawChart);

    function drawChart() {
    // grab the CSV
    $.get("alerts_log.txt", function(csvString) {

    // transform the CSV string into a 2-dimensional array
    var arrayData = $.csv.toArrays(csvString, {onParseValue: $.csv.hooks.castToScalar});

    // this new DataTable object holds all the data
    var data = new google.visualization.arrayToDataTable(arrayData);

    //Use rowRange variable to set the last "n" number of rows of data to display
    var rowRange = 300;

    var numRows = data.getNumberOfRows();
    var maxRows = numRows-1;
    var minRows = numRows-rowRange;
    if (minRows < 0){minRows = 0;}

    // this view can select a subset of the data at a time
    var view = new google.visualization.DataView(data);
    view.setColumns([2,11]);
    view.setRows(minRows,maxRows);

    var options = {
    title: "Lightning Distance in KM\n<= 300km from Station\nLast 300 Alerts",
    chartArea: {height: 120, width: 1000},
    backgroundColor: {fill: "#33CCFF"},
    hAxis: {title: data.getColumnLabel(2), slantedText: 1, slantedTextAngle: 45, textStyle: {fontSize: 10}},
    //vAxis: {title: data.getColumnLabel(7), minValue: data.getColumnRange(7).min, maxValue: data.getColumnRange(7).max},
vAxis: {title: data.getColumnLabel(11), titleTextStyle: {fontSize: 12}},
    legend: 'none'

    };
   
    var chart1 = new google.visualization.ColumnChart(document.getElementById('chart1'));
    chart1.draw(view, options);
   });
}
</script>

</head>
<body>
   <div id="chart1" style="width:1100px; height:325px;"> </div>
</body>
</html>


alert_rate.html:
Code: [Select]
<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="refresh" content="60">
   <title>Server Alerts Rate</title>
   <script src="https://www.google.com/jsapi"></script>
   <script src="./jquery-1.11.0.min.js"></script>
   <script src="./jquery.csv-0.71.js"></script>

   <script>
    // load the visualization library from Google and set a listener
    google.load("visualization", "1", {packages:["corechart"]});

    // next line prevents caching of retrieved data by IE and possibly other browsers.
    // without this, IE11 never updated the graphs on new strike data being added to the .csv file.
    $.ajaxSetup({ cache: false });

    google.setOnLoadCallback(drawChart);

    function drawChart() {
    // grab the CSV
    $.get("alerts_log.txt", function(csvString) {

    // transform the CSV string into a 2-dimensional array
    var arrayData = $.csv.toArrays(csvString, {onParseValue: $.csv.hooks.castToScalar});

    // this new DataTable object holds all the data
    var data = new google.visualization.arrayToDataTable(arrayData);

    //Use rowRange variable to set the last "n" number of rows of data to display
    var rowRange = 300;

    var numRows = data.getNumberOfRows();
    var maxRows = numRows-1;
    var minRows = numRows-rowRange;
    if (minRows < 0){minRows = 0;}

    // this view can select a subset of the data at a time
    var view = new google.visualization.DataView(data);
    view.setColumns([2,8]);
    view.setRows(minRows,maxRows);

    var options = {
    title: "Lightning Rate (Strikes/Minute)\n<= 300km from Station\nLast 300 Alerts",
    chartArea: {height: 120, width: 1000},
    backgroundColor: {fill: "#33CCFF"},
    hAxis: {title: data.getColumnLabel(2), slantedText: 1, slantedTextAngle: 45, textStyle: {fontSize: 10}},
    //vAxis: {title: data.getColumnLabel(7), minValue: data.getColumnRange(7).min, maxValue: data.getColumnRange(7).max},
vAxis: {title: data.getColumnLabel(8), titleTextStyle: {fontSize: 12}},
    legend: 'none'

    };
   
    var chart1 = new google.visualization.ColumnChart(document.getElementById('chart1'));
    chart1.draw(view, options);
   });
}
</script>

</head>
<body>
   <div id="chart1" style="width:1100px; height:325px;"> </div>
</body>
</html>


alert_bearing.html:
Code: [Select]
<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="refresh" content="60">
   <title>Server Alerts Bearng</title>
   <script src="https://www.google.com/jsapi"></script>
   <script src="./jquery-1.11.0.min.js"></script>
   <script src="./jquery.csv-0.71.js"></script>

   <script>
    // load the visualization library from Google and set a listener
    google.load("visualization", "1", {packages:["corechart"]});

    // next line prevents caching of retrieved data by IE and possibly other browsers.
    // without this, IE11 never updated the graphs on new strike data being added to the .csv file.
    $.ajaxSetup({ cache: false });

    google.setOnLoadCallback(drawChart);

    function drawChart() {
    // grab the CSV
    $.get("alerts_log.txt", function(csvString) {

    // transform the CSV string into a 2-dimensional array
    var arrayData = $.csv.toArrays(csvString, {onParseValue: $.csv.hooks.castToScalar});

    // this new DataTable object holds all the data
    var data = new google.visualization.arrayToDataTable(arrayData);

    //Use rowRange variable to set the last "n" number of rows of data to display
    var rowRange = 300;

    var numRows = data.getNumberOfRows();
    var maxRows = numRows-1;
    var minRows = numRows-rowRange;
    if (minRows < 0){minRows = 0;}

    // this view can select a subset of the data at a time
    var view = new google.visualization.DataView(data);
    view.setColumns([2,15]);
    view.setRows(minRows,maxRows);

    var options = {
    title: "Lightning Average Bearing in Degrees\n<= 300km from Station\nLast 300 Alerts",
    chartArea: {height: 120, width: 1000},
    backgroundColor: {fill: "#33CCFF"},
    hAxis: {title: data.getColumnLabel(2), slantedText: 1, slantedTextAngle: 45, textStyle: {fontSize: 10}},
    vAxis: {title: data.getColumnLabel(15), minValue: 0, maxValue: 360, titleTextStyle: {fontSize: 12}},
//vAxis: {title: data.getColumnLabel(15)},
    legend: 'none'

    };
   
    var chart1 = new google.visualization.ColumnChart(document.getElementById('chart1'));
    chart1.draw(view, options);
   });
}
</script>

</head>
<body>
   <div id="chart1" style="width:1100px; height:325px;"> </div>
</body>
</html>


display_alerts_data.php:
Code: [Select]
<html>
<head>
<meta http-equiv="refresh" content="60" >
</head>
<body bgcolor="#33CCFF">
<?php 
echo "<p> <b> <font face='courier'>";
echo 
nl2br(file_get_contents("alerts_display.txt")); 
echo 
"</font> </b> </p>";
?>

</body>
</html>


alert_stats.html:
Code: [Select]
<!DOCTYPE html>
<html>
<head>
</head>
<body bgcolor="#FFFFCC">

<center>

<p><b><font size="5" color="blue">Blitzortung Server Alert Statistics</font></b></p>
<p><b>Data updates every minute. Table times in UTC Graph times in US Central local time.</b></p>
<p>These tables and graphs show statistics for all lightning strikes detected by the Blitzortung servers at a distance <= 300km from the reporting station in Saint Charles, Illinois, USA (Blitzortung Station #681).</p>
<iframe src="display_alerts_data.php" height=335 width=545 scrolling=no frameborder=0>  margin=auto display=block align=middle</iframe></br>
<iframe src="alert_distance.html" height=335 width=1125 scrolling=no frameborder=0 margin=auto display=block></iframe>
<iframe src="alert_rate.html" height=335 width=1125 scrolling=no frameborder=0 margin=auto display=block></iframe>
<iframe src="alert_bearing.html" height=335 width=1125 scrolling=no frameborder=0 margin=auto display=block></iframe>

</center>

</body>
</html>
« Last Edit: July 27, 2014, 05:34:00 PM by dfroula »

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4108
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: AS3595 not Detecting Strikes
« Reply #145 on: July 30, 2014, 10:54:21 AM »
Thanks for posting the Alert scripts. I added these to my site and it works fine.

Greg H.


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

Offline Frank57

  • Member
  • *
  • Posts: 44
    • TyngsboroWeather
Re: AS3595 not Detecting Strikes
« Reply #146 on: August 06, 2014, 08:34:04 PM »
Well, here's an update. Amazon contacted them directly since they had a unhappy buyer. They finally emailed me back stating that emails were going to the wrong mailbox and then to top it off, stated they have had issues getting parts for the boards ](*,). Are you kidding me? They were selling them on Amazon and had 2 left, I bought one, leaving 1 left. Now they well me it will be a couple of weeks waiting for some parts even thou they had some (would have thought complete) they were selling. I don't know if I'll ever get one. Jet, PM me if you would like to sell one of them Tautic module extra ones you have. Also, were is everyone getting these programs to run these on their PC's, creating plots and charts of their data? I have seen others uploading these graphs and charts..  Thank you Frank    :-)
Update 8/6/14: finally got an email from them saying it shipped. Yipeee! I see this application on these listing of programming the board/chip, does this program come with it or where is everyone getting it? hope to be playing with this soon :) thanks

Update 7/23/14: finally got an email back from them, after having Amazon contact, said they ran out of pcb's and more were coming in and that the ones listed on Amazon were also shared with the ones in Ebay, so they sold out. More were coming in next week. One question now, while I wait, I see there are 3 of these types of pcb's out there. The from Embedded, another one from Tautic and now there is another one out there, are these all the same other than the outputs and the printing, layout of the parts on them, producing the same results?  #-o

Offline Jet

  • Member
  • *
  • Posts: 27
Re: AS3595 not Detecting Strikes
« Reply #147 on: August 06, 2014, 11:19:10 PM »
Glad to see they've finally sent you one.

Setup should be easy, should be just a case of hooking it up straight for the embedded adventures boards, the connections you need to make are listed on the AS3935 section in the web interface to your Red Controller.  Set your Red to i2C address 0x03.  If they contain a tuning cap value
on the board, set it to that, otherwise let it Auto Tune.  Auto Tune should work fine if your cable length is short, and should arrive at the same value. 
But it's best to fix it once you've figured it out.  There's no software to load on the board itself, the Red handles it all.
From my experience with the 20 or so AS3935's I've seen so far, with something close to the reference design, the Tuning cap value generally is 5, and occasionally 4, any other values I'd be suspicious of.

To answer your previous question, all the boards are pretty much the same.  Tautic defaults to SPI, Embedded defaults to I2C, but both are capable of either.  They basically all use the same reference design for Austrian Micro, although Tautic missed a couple of things, and Embedded look to have
copied Tautic, so if you ever design one yourself, reference the datasheet, not those designs.

Well, here's an update. Amazon contacted them directly since they had a unhappy buyer. They finally emailed me back stating that emails were going to the wrong mailbox and then to top it off, stated they have had issues getting parts for the boards ](*,). Are you kidding me? They were selling them on Amazon and had 2 left, I bought one, leaving 1 left. Now they well me it will be a couple of weeks waiting for some parts even thou they had some (would have thought complete) they were selling. I don't know if I'll ever get one. Jet, PM me if you would like to sell one of them Tautic module extra ones you have. Also, were is everyone getting these programs to run these on their PC's, creating plots and charts of their data? I have seen others uploading these graphs and charts..  Thank you Frank    :-)
Update 8/6/14: finally got an email from them saying it shipped. Yipeee! I see this application on these listing of programming the board/chip, does this program come with it or where is everyone getting it? hope to be playing with this soon :) thanks

Update 7/23/14: finally got an email back from them, after having Amazon contact, said they ran out of pcb's and more were coming in and that the ones listed on Amazon were also shared with the ones in Ebay, so they sold out. More were coming in next week. One question now, while I wait, I see there are 3 of these types of pcb's out there. The from Embedded, another one from Tautic and now there is another one out there, are these all the same other than the outputs and the printing, layout of the parts on them, producing the same results?  #-o
Station 1046: Calgary, Alberta, Canada

Offline Frank57

  • Member
  • *
  • Posts: 44
    • TyngsboroWeather
Re: AS3595 not Detecting Strikes
« Reply #148 on: August 07, 2014, 06:14:48 PM »
Ok, so all these postings about the AS3595 are for hooking up and running with the RED system? Hum, I don't have this system. Hoping to be able to build a stand-alone unit and run some software for it similar to the screen shots of the ones shown here.. I hope   :eek:

Offline Jet

  • Member
  • *
  • Posts: 27
Re: AS3595 not Detecting Strikes
« Reply #149 on: August 07, 2014, 06:25:25 PM »
In which case, you'll probably want to put it in SPI mode (better performance), and "Striker" is one of the better softwares out there, although you'll need to fix a few issues with it first.  (That's assuming you're going ATmega based).

Ok, so all these postings about the AS3595 are for hooking up and running with the RED system? Hum, I don't have this system. Hoping to be able to build a stand-alone unit and run some software for it similar to the screen shots of the ones shown here.. I hope   :eek:
Station 1046: Calgary, Alberta, Canada

 

anything