WXforum.net

Weather Station Hardware => Blitzortung => Topic started by: Jumpin Joe on April 03, 2014, 07:17:34 AM

Title: AS3595 not Detecting Strikes
Post by: Jumpin Joe on April 03, 2014, 07:17:34 AM
My AS3935 is showing 0 strikes and we have lighting all around us. Anyone know what I can check?

Joe

Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on April 03, 2014, 09:12:44 AM
Funny you should ask....I've been playing with the settings this morning with all the lightning in the Chicago area.

My theory is that setting disturber rejection settings low doesn't swamp the internals of the AS3935, since it has to analyze each event anyway. They just prevent an interrupt from being generated and swamping the controller with interrupts, unless "Ignore disturber" is on, which prevents disturbers from generating interrupts inside the chip.

Try these settings. Seems to be working better. I get about 10-15 disturbers/sec if I disable "Ignore disturbers", but leave "Ignore disturbers" checked to minimize load on the controller.

Check my results at: http://projectmf.homelinux.com/as3935_stats.html

Don

Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on April 03, 2014, 09:50:16 AM
New discovery....

Setting the "Tune cap" parameter from "Auto" to the number printed on the anti-static bag in which the AS395 was shipped seems to greatly increase the number of detections. I think the cal routine runs periodically, based on the I2C logs I've examined. While it is calibrating, the interrupt line is used to send calibration frequencies to the controller. Lightning can't be detected during the cal process.

Oddly, I found the AS3935 was more sensitive to my piezo lighter test before I grounded the controller, although I think it was due to more interference being received. It is probably working better with actual lightning grounded.
Title: Re: AS3595 not Detecting Strikes
Post by: Jumpin Joe on April 03, 2014, 05:24:13 PM
Since getting my power supply back up, and restarting RED, the AS3935 decided it wanted to cooperate and started detecting.  \:D/
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on May 05, 2014, 07:29:12 PM
I discovered something interesting when a storm rolled through a week or so ago - the AS3935 board becomes completely deaf when the controller board is grounded!

I have my board grounded to the AC ground of the wall outlet through a modified 3-wire plug. This helps the performance of the ferrite antennas significantly. When I unplugged the ground, the AS3935 started happily detecting strikes immediately.

Right now, the shields are tied to the "-"  grounded terminals of the amplifier connections, which in turn are grounded to the controller through the shielded CAT5 cable.

I plan to separate the shield grounds from the grounded sides of the ferrite antennas in the antenna box and run a ground only to the shields, leaving the controller and amplifier ungrounded. This should provide the benefits of grounded shields without impacting the operation of the AS3935.

Odd a ground should stop the AS3935 from operating. Interferer levels are normal with the controller ground connected.

Regards,

Don
Title: Re: AS3595 not Detecting Strikes
Post by: 92merc on May 06, 2014, 12:18:56 PM
I'm still in the process of putting my system together.  I'm just waiting for my standoffs to arrive so I can mount my boards in the boxes I bought.

I'm mounting both boards in my attached garage where my main breaker panel is.  I was able to attach a ground wire to the house's main ground that goes to that panel.  I've already run a line up and over to where my boards are going to go.

I've also build my antenna's conduit system to include copper shielding.  I was planning on grounding both boards and the copper shielding to the ground wire.  Are you saying I probably shouldn't run a ground to the boards?
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on May 06, 2014, 01:06:04 PM
All I can say with certainty is that tying the board ground terminal to AC ground makes the AS3935 completely insensitive to lightning strikes,  even directly overhead.

As I said, I plan to try grounding just the shields on the ferrites and leave the rest of the system without an explicit ground connection to see if it helps. I know the AS3935 happily detects lightning without the ground, to its maximum distance. I may be an issue with my AC ground, but with the ground connected the auto-noise floor gets set to maximum gain and the interferer level is low. That indicates noise is not getting coupled through the ground, I believe.

YMMV, so use whatever works best! I'd be interested in reports from others. I noticed that Joe's problem resolved when he changed the power supply. I'm guessing the new supply had its "-" lead isolated from AC ground.

Don
Title: Re: AS3595 not Detecting Strikes
Post by: 92merc on May 06, 2014, 01:12:26 PM
I'll start out by not grounding my boards.  But I bought grounding blocks and have a good main ground to my area.  So I can easily change what I want.

I decided to go a different route on my power supply.  With the new E-Boards coming out, I'm glad I did.  I just hope it's a "clean" power supply.

This unit has varying amperage available for the different USB ports.  But it has 5 ports on one brick. So that makes it easier for me.  Unless, it dies. 

http://www.amazon.com/gp/product/B00DVH62J2/ref=oh_details_o00_s00_i01?ie=UTF8&psc=1
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on May 11, 2014, 10:28:33 AM
During local lightning activity I've tried many different settings to try to coax real strikes from the AS3935. I've tried enabling disturber detection and adjusting settings for a few disturbers/sec. No lightning detected, at any noise threshold/sensitivity/strike rejection settings.

The only way I get any "lightning" detections is by setting Signal Threshold and Spike Rejection both to zero. This results in a flood of disturbers, but also random lightning detections that don't seem correlated to actual lightning. Setting either or both of these settings back to non-zero values stops strike detection completely.

I though this may have been related to recent grounding of my system and change of a power supply. After experimenting with various grounding configurations, I'm convinced this is not the issue.

The AS3935 also no longer responds to my piezo "sparker", except to indicate a high noise floor, which triggers a noise threshold adjustment.

The detector used to work fine a few releases back. Puzzling.

I'll try again when storms roll through Chicago this afternoon.

Regards,

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: Jumpin Joe on May 11, 2014, 11:15:45 AM
During local lightning activity I've tried many different settings to try to coax real strikes from the AS3935. I've tried enabling disturber detection and adjusting settings for a few disturbers/sec. No lightning detected, at any noise threshold/sensitivity/strike rejection settings.

The only way I get any "lightning" detections is by setting Signal Threshold and Spike Rejection both to zero. This results in a flood of disturbers, but also random lightning detections that don't seem correlated to actual lightning. Setting either or both of these settings back to non-zero values stops strike detection completely.

I though this may have been related to recent grounding of my system and change of a power supply. After experimenting with various grounding configurations, I'm convinced this is not the issue.

The AS3935 also no longer responds to my piezo "sparker", except to indicate a high noise floor, which triggers a noise threshold adjustment.

The detector used to work fine a few releases back. Puzzling.

I'll try again when storms roll through Chicago this afternoon.

Regards,

Don
WD9DMP

Don, mine is no longer detecting.  I will try changing my setting to zero and see if the corrects it. Confused as to why it has stopped.

Joe
Title: Re: AS3595 not Detecting Strikes
Post by: Jumpin Joe on May 11, 2014, 11:36:01 AM
During local lightning activity I've tried many different settings to try to coax real strikes from the AS3935. I've tried enabling disturber detection and adjusting settings for a few disturbers/sec. No lightning detected, at any noise threshold/sensitivity/strike rejection settings.

The only way I get any "lightning" detections is by setting Signal Threshold and Spike Rejection both to zero. This results in a flood of disturbers, but also random lightning detections that don't seem correlated to actual lightning. Setting either or both of these settings back to non-zero values stops strike detection completely.

I though this may have been related to recent grounding of my system and change of a power supply. After experimenting with various grounding configurations, I'm convinced this is not the issue.

The AS3935 also no longer responds to my piezo "sparker", except to indicate a high noise floor, which triggers a noise threshold adjustment.

The detector used to work fine a few releases back. Puzzling.

I'll try again when storms roll through Chicago this afternoon.

Regards,

Don
WD9DMP

Don, mine is no longer detecting.  I will try changing my setting to zero and see if the corrects it. Confused as to why it has stopped.

Joe

Just checked my status screen and discovered that the AS3935 detected one strike last night 2km away, nothing else. Very weird. Have the revisions Tobi has made caused the AS3935 to stop working?

Joe
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on May 11, 2014, 12:13:51 PM
I should mention, I also tried powering the module from +5vdc (from +3vdc), no change.

 I believe there is an internal voltage regulator in the chip that can be turned on/off with a register setting. I'm not sure how Tobi's code sets this up (I should look, as he posted a link to the code). I think I read somewhere there is a bug that affects detections relating to how the internal VR is configured.

 Don
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on May 11, 2014, 12:18:07 PM
Here's the VR bug reference. Not sure if this affects detections:

http://fll-freak.com/blog/?p=554

"The behaviour using I2C at address 0 is known to me and worked arround by using the address ADD0=ADD1=1 (Vdd). Testing this I have found another issue: If the voltage regulator is turned on, ADD0 and ADD1 must not be connected to Vdd (as described in the data sheet). If the voltage regulator is turned on and one of the address pins is set to the positive voltage supply (Vdd), the chip-intern voltage regulator will not be able to regulate the voltage. In my case the output regulated voltage was 4,3V instead of 3V as described in data sheet. I have contacted the AMS support with it and they confirmed this issue. They recommended to me to set the ADD0 and ADD1 pins to the voltage regulated supply (VREG). After connecting the address pins to VREG the regulated voltage became 3V =)."

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on May 11, 2014, 01:24:56 PM
New Beta 4 firmware just posted by Tobi that may correct the issue. See similar thread at blitzortung.org.

Regards,

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: Jumpin Joe on May 11, 2014, 06:00:05 PM
New Beta 4 firmware just posted by Tobi that may correct the issue. See similar thread at blitzortung.org.

Regards,

Don
WD9DMP

I installed the update, no change. Still not detecting and storms are all around me.

Joe
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on May 12, 2014, 10:11:54 AM
Same here. No change with the new firmware.

I can get the AS3935 to report lightning by setting the "Signal Threshold" and "Strike Detection" to zero, but the report rate is independent of actual lightning activity. It triggers randomly, even with no lightning in the area.

The new firmware seemed to cause the web interface on the controller to hang after a while.

Regards,

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on May 12, 2014, 10:19:31 AM
Joe, I see from your posting on the blitzortung.org message boards that your AS3935 is now working.

What did you do to kick-start the board? I haven't tried a power-cycle on the system yet, but I will after I post this.

Best,

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: Jumpin Joe on May 12, 2014, 10:35:10 AM
Joe, I see from your posting on the blitzortung.org message boards that your AS3935 is now working.

What did you do to kick-start the board? I haven't tried a power-cycle on the system yet, but I will after I post this.

Best,

Don
WD9DMP

Don,

Nothing!! It just started working. Not sure it is picking up all or most of the strikes. At least this is an improvement.  I still think it has to do with the update Tobi has made. Probably still needs a few more adjustments.

Good luck,

Joe
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on May 13, 2014, 12:32:35 PM
Well, after two rounds of severe storms here yesterday, my AS3935 recorded a total of 10 lightning strikes. I was using the settings in the attched image, which should have set things for the maximum sensitivity and minimum filtering for false strikes.

I'm at a loss to figure out why the AS3935 has suddenly become so unresponsive. Guess I'll put this issue on the back burner for now.

Regards,

Don WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: Jumpin Joe on May 14, 2014, 05:05:43 PM
As I post this we are being hit very heavily by storms and the AS3935 has only picked up 2 hits. Since those two hits I have seen more lighting than I could count. Very disappointed.

Joe
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on May 14, 2014, 09:39:08 PM
I got one!
It picked up 1 strike about 10 minutes ago. However I don't recall seeing or hearing any lightning. :-k Its raining, but not storming here.
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on May 28, 2014, 01:04:50 PM
I found the new Acu-Rite Lightning Detector and posted it here http://www.wxforum.net/index.php?topic=22740.msg219002#msg219002 (http://www.wxforum.net/index.php?topic=22740.msg219002#msg219002)

I sent a message to Rhino asking if it uses the AS3935 IC from AMS. Reading between the lines in the manual and the timing of it makes me think (and hope) that it uses the AS3935. If so, I plan on parking it next to my AS3935 board interfaced to RED to see how they compare.

Greg
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on May 28, 2014, 01:09:21 PM
Seeing only 3 lightning detections after a round of local storms last night, I grabbed an AS3935 and I2C log this morning, under clear-sky conditions.

It appears that the AS3935 is issuing a constant stream of interrupts. The debug log doesn't seem to give the register values, so I can't determine the type of interrupt. However, there is no lightning detected, "Ignore Disturbers" is checked, and the noise floor is stable. The AS3935 seems to be recalculating storm distance on every interrupt, which seems odd.

The stream of non-lightning interrupts could be masking lightning detections.

Log below:

Code: [Select]

2014-05-28 12:06:40  174317 | AS3935: Interrupt (1)
2014-05-28 12:06:40  174317 | I2C: -------
2014-05-28 12:06:40  174317 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:40  174317 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:40  174317 | I2C: Send Register 0x3
2014-05-28 12:06:40  174317 | I2C: Transmitted (Read)
2014-05-28 12:06:40  174317 | I2C: Select Receive from device 0x7
2014-05-28 12:06:40  174317 | AS3935: Interrupt (0)
2014-05-28 12:06:40  174317 | I2C: Receiver-Mode
2014-05-28 12:06:40  174317 | I2C: Received 0x30
2014-05-28 12:06:40  174317 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:40  174317 | AS3935: Distance estimation recalculated
2014-05-28 12:06:40  174317 | AS3935: Interrupt (1)
2014-05-28 12:06:40  174317 | I2C: -------
2014-05-28 12:06:40  174317 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:40  174317 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:40  174317 | I2C: Send Register 0x3
2014-05-28 12:06:40  174317 | I2C: Transmitted (Read)
2014-05-28 12:06:40  174317 | I2C: Select Receive from device 0x7
2014-05-28 12:06:40  174317 | AS3935: Interrupt (0)
2014-05-28 12:06:40  174317 | I2C: Receiver-Mode
2014-05-28 12:06:40  174317 | I2C: Received 0x30
2014-05-28 12:06:40  174317 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:40  174317 | AS3935: Distance estimation recalculated
2014-05-28 12:06:42  174319 | AS3935: Interrupt (1)
2014-05-28 12:06:42  174319 | I2C: -------
2014-05-28 12:06:42  174319 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:42  174319 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:42  174319 | I2C: Send Register 0x3
2014-05-28 12:06:42  174319 | I2C: Transmitted (Read)
2014-05-28 12:06:42  174319 | I2C: Select Receive from device 0x7
2014-05-28 12:06:42  174319 | AS3935: Interrupt (0)
2014-05-28 12:06:42  174319 | I2C: Receiver-Mode
2014-05-28 12:06:42  174319 | I2C: Received 0x30
2014-05-28 12:06:42  174319 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:42  174319 | AS3935: Distance estimation recalculated
2014-05-28 12:06:42  174319 | AS3935: Interrupt (1)
2014-05-28 12:06:42  174319 | I2C: -------
2014-05-28 12:06:42  174319 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:42  174319 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:42  174319 | I2C: Send Register 0x3
2014-05-28 12:06:42  174319 | I2C: Transmitted (Read)
2014-05-28 12:06:42  174319 | I2C: Select Receive from device 0x7
2014-05-28 12:06:42  174319 | AS3935: Interrupt (0)
2014-05-28 12:06:42  174319 | I2C: Receiver-Mode
2014-05-28 12:06:42  174319 | I2C: Received 0x30
2014-05-28 12:06:42  174319 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:42  174319 | AS3935: Distance estimation recalculated
2014-05-28 12:06:43  174320 | AS3935: Interrupt (1)
2014-05-28 12:06:43  174320 | I2C: -------
2014-05-28 12:06:43  174320 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:43  174320 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:43  174320 | I2C: Send Register 0x3
2014-05-28 12:06:43  174320 | I2C: Transmitted (Read)
2014-05-28 12:06:43  174320 | I2C: Select Receive from device 0x7
2014-05-28 12:06:43  174320 | AS3935: Interrupt (0)
2014-05-28 12:06:43  174320 | I2C: Receiver-Mode
2014-05-28 12:06:43  174320 | I2C: Received 0x30
2014-05-28 12:06:43  174320 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:43  174320 | AS3935: Distance estimation recalculated
2014-05-28 12:06:43  174320 | AS3935: Interrupt (1)
2014-05-28 12:06:43  174320 | I2C: -------
2014-05-28 12:06:43  174320 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:43  174320 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:43  174320 | I2C: Send Register 0x3
2014-05-28 12:06:43  174320 | I2C: Transmitted (Read)
2014-05-28 12:06:43  174320 | I2C: Select Receive from device 0x7
2014-05-28 12:06:43  174320 | AS3935: Interrupt (0)
2014-05-28 12:06:43  174320 | I2C: Receiver-Mode
2014-05-28 12:06:43  174320 | I2C: Received 0x30
2014-05-28 12:06:43  174320 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:43  174320 | AS3935: Distance estimation recalculated
2014-05-28 12:06:44  174321 | AS3935: Interrupt (1)
2014-05-28 12:06:44  174321 | I2C: -------
2014-05-28 12:06:44  174321 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:44  174321 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:44  174321 | I2C: Send Register 0x3
2014-05-28 12:06:44  174321 | I2C: Transmitted (Read)
2014-05-28 12:06:44  174321 | I2C: Select Receive from device 0x7
2014-05-28 12:06:44  174321 | AS3935: Interrupt (0)
2014-05-28 12:06:44  174321 | I2C: Receiver-Mode
2014-05-28 12:06:44  174321 | I2C: Received 0x30
2014-05-28 12:06:44  174321 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:44  174321 | AS3935: Distance estimation recalculated
2014-05-28 12:06:44  174321 | AS3935: Interrupt (1)
2014-05-28 12:06:44  174321 | I2C: -------
2014-05-28 12:06:44  174321 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:44  174321 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:44  174321 | I2C: Send Register 0x3
2014-05-28 12:06:44  174321 | I2C: Transmitted (Read)
2014-05-28 12:06:44  174321 | I2C: Select Receive from device 0x7
2014-05-28 12:06:44  174321 | AS3935: Interrupt (0)
2014-05-28 12:06:44  174321 | I2C: Receiver-Mode
2014-05-28 12:06:44  174321 | I2C: Received 0x30
2014-05-28 12:06:44  174321 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:44  174321 | AS3935: Distance estimation recalculated
2014-05-28 12:06:44  174321 | AS3935: Interrupt (1)
2014-05-28 12:06:44  174321 | I2C: -------
2014-05-28 12:06:44  174321 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:44  174321 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:44  174321 | I2C: Send Register 0x3
2014-05-28 12:06:44  174321 | I2C: Transmitted (Read)
2014-05-28 12:06:44  174321 | I2C: Select Receive from device 0x7
2014-05-28 12:06:44  174321 | AS3935: Interrupt (0)
2014-05-28 12:06:44  174321 | I2C: Receiver-Mode
2014-05-28 12:06:44  174321 | I2C: Received 0x30
2014-05-28 12:06:44  174321 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:44  174321 | AS3935: Distance estimation recalculated
2014-05-28 12:06:45  174322 | AS3935: Interrupt (1)
2014-05-28 12:06:45  174322 | I2C: -------
2014-05-28 12:06:45  174322 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:45  174322 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:45  174322 | I2C: Send Register 0x3
2014-05-28 12:06:45  174322 | I2C: Transmitted (Read)
2014-05-28 12:06:45  174322 | I2C: Select Receive from device 0x7
2014-05-28 12:06:45  174322 | AS3935: Interrupt (0)
2014-05-28 12:06:45  174322 | I2C: Receiver-Mode
2014-05-28 12:06:45  174322 | I2C: Received 0x30
2014-05-28 12:06:45  174322 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:45  174322 | AS3935: Distance estimation recalculated
2014-05-28 12:06:45  174322 | AS3935: Interrupt (1)
2014-05-28 12:06:45  174322 | I2C: -------
2014-05-28 12:06:45  174322 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:45  174322 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:45  174322 | I2C: Send Register 0x3
2014-05-28 12:06:45  174322 | I2C: Transmitted (Read)
2014-05-28 12:06:45  174322 | I2C: Select Receive from device 0x7
2014-05-28 12:06:45  174322 | AS3935: Interrupt (0)
2014-05-28 12:06:45  174322 | I2C: Receiver-Mode
2014-05-28 12:06:45  174322 | I2C: Received 0x30
2014-05-28 12:06:45  174322 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:45  174322 | AS3935: Distance estimation recalculated
2014-05-28 12:06:46  174323 | AS3935: Interrupt (1)
2014-05-28 12:06:46  174323 | I2C: -------
2014-05-28 12:06:46  174323 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:46  174323 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:46  174323 | I2C: Send Register 0x3
2014-05-28 12:06:46  174323 | I2C: Transmitted (Read)
2014-05-28 12:06:46  174323 | I2C: Select Receive from device 0x7
2014-05-28 12:06:46  174323 | AS3935: Interrupt (0)
2014-05-28 12:06:46  174323 | I2C: Receiver-Mode
2014-05-28 12:06:46  174323 | I2C: Received 0x30
2014-05-28 12:06:46  174323 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:46  174323 | AS3935: Distance estimation recalculated
2014-05-28 12:06:46  174323 | AS3935: Interrupt (1)
2014-05-28 12:06:46  174323 | I2C: -------
2014-05-28 12:06:46  174323 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:46  174323 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:46  174323 | I2C: Send Register 0x3
2014-05-28 12:06:46  174323 | I2C: Transmitted (Read)
2014-05-28 12:06:46  174323 | I2C: Select Receive from device 0x7
2014-05-28 12:06:46  174323 | AS3935: Interrupt (0)
2014-05-28 12:06:46  174323 | I2C: Receiver-Mode
2014-05-28 12:06:46  174323 | I2C: Received 0x30
2014-05-28 12:06:46  174323 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:46  174323 | AS3935: Distance estimation recalculated
2014-05-28 12:06:47  174324 | AS3935: Interrupt (1)
2014-05-28 12:06:47  174324 | I2C: -------
2014-05-28 12:06:47  174324 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:47  174324 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:47  174324 | I2C: Send Register 0x3
2014-05-28 12:06:47  174324 | I2C: Transmitted (Read)
2014-05-28 12:06:47  174324 | I2C: Select Receive from device 0x7
2014-05-28 12:06:47  174324 | AS3935: Interrupt (0)
2014-05-28 12:06:47  174324 | I2C: Receiver-Mode
2014-05-28 12:06:47  174324 | I2C: Received 0x30
2014-05-28 12:06:47  174324 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:47  174324 | AS3935: Distance estimation recalculated
2014-05-28 12:06:49  174326 | AS3935: Interrupt (1)
2014-05-28 12:06:49  174326 | I2C: -------
2014-05-28 12:06:49  174326 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:49  174326 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:49  174326 | I2C: Send Register 0x3
2014-05-28 12:06:49  174326 | I2C: Transmitted (Read)
2014-05-28 12:06:49  174326 | I2C: Select Receive from device 0x7
2014-05-28 12:06:49  174326 | AS3935: Interrupt (0)
2014-05-28 12:06:49  174326 | I2C: Receiver-Mode
2014-05-28 12:06:49  174326 | I2C: Received 0x30
2014-05-28 12:06:49  174326 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:49  174326 | AS3935: Distance estimation recalculated
2014-05-28 12:06:49  174326 | AS3935: Interrupt (1)
2014-05-28 12:06:49  174326 | I2C: -------
2014-05-28 12:06:49  174326 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:49  174326 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:49  174326 | I2C: Send Register 0x3
2014-05-28 12:06:49  174326 | I2C: Transmitted (Read)
2014-05-28 12:06:49  174326 | I2C: Select Receive from device 0x7
2014-05-28 12:06:49  174326 | AS3935: Interrupt (0)
2014-05-28 12:06:49  174326 | I2C: Receiver-Mode
2014-05-28 12:06:49  174326 | I2C: Received 0x30
2014-05-28 12:06:49  174326 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:49  174326 | AS3935: Distance estimation recalculated
2014-05-28 12:06:50  174327 | AS3935: Interrupt (1)
2014-05-28 12:06:50  174327 | I2C: -------
2014-05-28 12:06:50  174327 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:50  174327 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:50  174327 | I2C: Send Register 0x3
2014-05-28 12:06:50  174327 | I2C: Transmitted (Read)
2014-05-28 12:06:50  174327 | I2C: Select Receive from device 0x7
2014-05-28 12:06:50  174327 | AS3935: Interrupt (0)
2014-05-28 12:06:50  174327 | I2C: Receiver-Mode
2014-05-28 12:06:50  174327 | I2C: Received 0x30
2014-05-28 12:06:50  174327 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:50  174327 | AS3935: Distance estimation recalculated
2014-05-28 12:06:50  174327 | AS3935: Interrupt (1)
2014-05-28 12:06:50  174327 | I2C: -------
2014-05-28 12:06:50  174327 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:50  174327 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:50  174327 | I2C: Send Register 0x3
2014-05-28 12:06:50  174327 | I2C: Transmitted (Read)
2014-05-28 12:06:50  174327 | I2C: Select Receive from device 0x7
2014-05-28 12:06:50  174327 | AS3935: Interrupt (0)
2014-05-28 12:06:50  174327 | I2C: Receiver-Mode
2014-05-28 12:06:50  174327 | I2C: Received 0x30
2014-05-28 12:06:50  174327 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:50  174327 | AS3935: Distance estimation recalculated
2014-05-28 12:06:51  174328 | AS3935: Interrupt (1)
2014-05-28 12:06:51  174328 | I2C: -------
2014-05-28 12:06:51  174328 | I2C: Start Read from device 0x3, register 0x3, mask 0xf
2014-05-28 12:06:51  174328 | I2C: Select Transmit to device 0x6
2014-05-28 12:06:51  174328 | I2C: Send Register 0x3
2014-05-28 12:06:51  174328 | I2C: Transmitted (Read)
2014-05-28 12:06:51  174328 | I2C: Select Receive from device 0x7
2014-05-28 12:06:51  174328 | AS3935: Interrupt (0)
2014-05-28 12:06:51  174328 | I2C: Receiver-Mode
2014-05-28 12:06:51  174328 | I2C: Received 0x30
2014-05-28 12:06:51  174328 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:51  174328 | AS3935: Distance estimation recalculated
2014-05-28 12:06:52  174329 | AS3935: Interrupt (1)
2014-05-28 12:06:52  174329 | AS3935: Interrupt (0)
2014-05-28 12:06:52  174329 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:52  174329 | AS3935: Distance estimation recalculated
2014-05-28 12:06:53  174330 | AS3935: Interrupt (1)
2014-05-28 12:06:53  174330 | AS3935: Interrupt (0)
2014-05-28 12:06:53  174330 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:53  174330 | AS3935: Distance estimation recalculated
2014-05-28 12:06:54  174331 | AS3935: Interrupt (1)
2014-05-28 12:06:54  174331 | AS3935: Interrupt (0)
2014-05-28 12:06:54  174331 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:54  174331 | AS3935: Distance estimation recalculated
2014-05-28 12:06:54  174331 | AS3935: Interrupt (1)
2014-05-28 12:06:54  174331 | AS3935: Interrupt (0)
2014-05-28 12:06:54  174331 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:54  174331 | AS3935: Distance estimation recalculated
2014-05-28 12:06:55  174332 | AS3935: Interrupt (1)
2014-05-28 12:06:55  174332 | AS3935: Interrupt (0)
2014-05-28 12:06:55  174332 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:55  174332 | AS3935: Distance estimation recalculated
2014-05-28 12:06:55  174332 | AS3935: Interrupt (1)
2014-05-28 12:06:55  174332 | AS3935: Interrupt (0)
2014-05-28 12:06:55  174332 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:55  174332 | AS3935: Distance estimation recalculated
2014-05-28 12:06:57  174334 | AS3935: Interrupt (1)
2014-05-28 12:06:57  174334 | AS3935: Interrupt (0)
2014-05-28 12:06:57  174334 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:57  174334 | AS3935: Distance estimation recalculated
2014-05-28 12:06:58  174335 | AS3935: Interrupt (1)
2014-05-28 12:06:58  174335 | AS3935: Interrupt (0)
2014-05-28 12:06:58  174335 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:58  174335 | AS3935: Distance estimation recalculated
2014-05-28 12:06:58  174335 | AS3935: Interrupt (1)
2014-05-28 12:06:58  174335 | AS3935: Interrupt (0)
2014-05-28 12:06:58  174335 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:58  174335 | AS3935: Distance estimation recalculated
2014-05-28 12:06:58  174335 | AS3935: Interrupt (1)
2014-05-28 12:06:58  174335 | AS3935: Interrupt (0)
2014-05-28 12:06:58  174335 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:58  174335 | AS3935: Distance estimation recalculated
2014-05-28 12:06:59  174336 | AS3935: Interrupt (1)
2014-05-28 12:06:59  174336 | AS3935: Interrupt (0)
2014-05-28 12:06:59  174336 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:59  174336 | AS3935: Distance estimation recalculated
2014-05-28 12:06:59  174336 | AS3935: Interrupt (1)
2014-05-28 12:06:59  174336 | AS3935: Interrupt (0)
2014-05-28 12:06:59  174336 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:06:59  174336 | AS3935: Distance estimation recalculated
2014-05-28 12:07:01  174338 | AS3935: Interrupt (1)
2014-05-28 12:07:01  174338 | AS3935: Interrupt (0)
2014-05-28 12:07:01  174338 | AS3935: Interrupt register is 0x0, pending status 0, pin 0
2014-05-28 12:07:01  174338 | AS3935: Distance estimation recalculated
2014-05-28 12:07:01  174338 | AS3935: Write registers...
2014-05-28 12:07:01  174338 |
2014-05-28 12:07:01  174338 | === AS3935 ==========================================
2014-05-28 12:07:01  174338 | AS3935: Write registers...
2014-05-28 12:07:01  174338 | AS3935: Calibrate Antenna...
2014-05-28 12:07:01  174338 | AS3935: LCO TUN_CAP=0 => Frequency 511200Hz, Deviation 2.2
2014-05-28 12:07:01  174338 | AS3935: LCO TUN_CAP=1 => Frequency 507200Hz, Deviation 1.4
2014-05-28 12:07:01  174338 | AS3935: LCO TUN_CAP=2 => Frequency 504800Hz, Deviation 1.0
2014-05-28 12:07:01  174338 | AS3935: LCO TUN_CAP=3 => Frequency 503200Hz, Deviation 0.6
2014-05-28 12:07:01  174338 | AS3935: LCO TUN_CAP=4 => Frequency 501600Hz, Deviation 0.3
2014-05-28 12:07:01  174338 | AS3935: LCO TUN_CAP=5 => Frequency 500000Hz, Deviation 0.0
2014-05-28 12:07:01  174338 | AS3935: LCO TUN_CAP=6 => Frequency 498400Hz, Deviation -0.3
2014-05-28 12:07:01  174338 | AS3935: Stop, found best frequency before
2014-05-28 12:07:01  174338 | AS3935: Found best tune-cap=5 with frequency=500000Hz => deviation=0.0%
2014-05-28 12:07:01  174338 | AS3935: Calibrate RCO...
2014-05-28 12:07:01  174338 | AS3935: CALIB_RCO accepted
2014-05-28 12:07:01  174338 | AS3935: Frequency on SRCO is 1151850Hz
2014-05-28 12:07:01  174338 | AS3935: CALIB_RCO accepted
2014-05-28 12:07:01  174338 | AS3935: Frequency on TRCO is 32500Hz
2014-05-28 12:07:01  174338 | AS3935: Init IRQ...
2014-05-28 12:07:01  174338 | =====================================================

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 03, 2014, 09:24:29 AM
I had a few minor thunderstorms pass within 15 km of my location yesterday morning. Although I visually observed no lightning, I actual received a reasonable number of strikes (13) as the storm passed nearby. The distance calculations and energy data from the AS3935 actually looked reasonable, considering the distance and intensity of the storm.

I had been setting the "Noise Floor" to the minimum of 390/28 with the "Noise Auto Raise" feature enabled, on the theory that the Auto function would raise the noise floor detection as required. I had observed the "Noise Auto Raise" function operate correctly in the past, ordinarily setting the noise floor to 630/45 during clear skies. The Auto function slowly reduces the threshold over time as the actual noise floor decreases.

As we have discussed if, the actual noise floor is above the "Noise Floor" setting, the AS3935 disables lightning detection until the actual noise floor is reduced below the "Noise Floor" threshold. This is normal operation.

On the theory that the "Noise Auto Raise" was not setting the threshold high enough during storms to keep the AS3035 in the detection range, I had reset the "Noise Floor" threshold to 1340/95, while leaving "Noise Auto Raise" enabled. I believe this keeps the minimum "Noise Floor" set by "Noise Auto Raise" to this value.

This seemed to make a considerable difference in the number of detected strikes. I will continue to monitor during the next few storms, but it appears that the setting change has awoken my AS3935.

The attached image shows my current settings.

Best regards,

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on June 03, 2014, 02:54:14 PM
I just received my Acu-Rite 02020 Lightning Detector and set a new record for voiding the warranty.
After confirming that it works, I disassembled it and confirmed that indeed it does have an AMS AS3935.
The sensing coil looks very similar to what is used in the Embedded Adventures and other development kit boards.
Here is a picture of the AS3935 lurking next to a glob-top chip (display driver?). The PCB connects to the display with a conductive rubber zebra strip.
I now have something to compare to the AS3935 interfaced to RED. It was pretty cheap, $32 from Amazon.
After re-assembly, it does still work.

With my BBQ sparker close by, it responds with a beep and an "UNABLE TO DETECT" "PLEASE RELOCATE", although I did get it to categorize a spark noise as lightning. You can toggle between "Indoor" and "Outdoor" mode by pressing the Light and Power buttons and holding for 5 seconds.

Interestingly, it shows "1 mi" for the distance on the noise, similar to the "1km" strikes that we see on RED. I'll post further results as they develop. (quiet for storms today, so no opportunities for a good test)

Greg H
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 18, 2014, 11:59:00 AM
I'm in the midst of a storm at the moment. I'm getting very good detection rates from my AS3935 with the settings shown on the attached jpg.

The trick seems to be to enable "Outdoor" detection. Even the distances are looking realistic.

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 18, 2014, 01:30:36 PM
Graphs of detections from the last round of storms, with the new settings:

http://projectmf.homelinux.com/as3935_stats.html

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on June 18, 2014, 02:57:42 PM
Outdoor. Hmmm....

I'll try it. The Acu-Rite recorded one strike at 4 miles away yesterday. There were more than that, but at least I have not been getting false strikes on it. The Acu-Rite also with AS3935 is a few inches away from the one interfaced to the RED controller.

Greg H.

Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 18, 2014, 08:12:49 PM
Getting hundreds of strikes registering on the AS3935 with the new settings mentioned above. Looking good!

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on June 18, 2014, 08:49:43 PM
I am now "Outdoors" on my settings. I'll let you know how it works. Who'da thunk it?

Greg H.
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 19, 2014, 10:26:31 AM
My area was hit with a steady string of moderate thunderstorms last night from the stationary front over Northern Illinois. It turned out to be a good test of the AS3935.

I have to say, checking the "outdoor" setting really woke the board up. Checking the "outdoor" box is supposed to REDUCE the sensitivity of the chip by using a different set of noise floor thresholds, assuming if you are outdoors, the signals will be stronger. The opposite seems to be the case.

I logged rates up to 120 strikes/minute and estimated storm distances from 1 km to 31 km. The distance estimates decreased as the storms approached and increased as they left the area.

The indoor/outdoor setting was the only setting I had not really tried changing. I am guessing the firmware has the indoor/outdoor setting reversed somehow.

Again, http://projectmf.homelinux.com/as3935_stats.html shows the last storm cell that passed through. The data is updated in real-time, so may change by the time you check it. The log .csv log file is at http://projectmf.homelinux.com/as3935_log.txt. This file may be imported into Microsoft Excel for analysis.

Regards,

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on June 19, 2014, 02:04:20 PM
I have changed my settings to match yours and hopefully some storms may pass through soon.

Is your "AS3935 Local Lightning Detection Module Statistics" page something easily implemented. How is the data collected?
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 19, 2014, 03:41:40 PM
Hi, Dave,

Detailed instructions are in this thread. The file names may be slightly different. Change paths in the scripts to suit your installation:

http://forum.blitzortung.org/showthread.php?tid=98&pid=3896#pid3896

However, I have updated and improved the scripts some. The basic procedure is the same.

You can grab the new scripts directly from my web server:

http://projectmf.homelinux.com/log_as3935.php

http://projectmf.homelinux.com/as3935_distance.html

http://projectmf.homelinux.com/as3935_energy.html

http://projectmf.homelinux.com/as3935_rate.html

http://projectmf.homelinux.com/display_as3935_data.php

http://projectmf.homelinux.com/as3935_stats.html

http://projectmf.homelinux.com/as3935_icon.jpg

Regards,

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on June 19, 2014, 08:15:21 PM
It seems that the old "auto calibration" might still be a source of noise. Whenever I ran the AS3935 in "auto cal" mode, there was a noise interrupt error message in the debug log.

However, if I looked at the log and picked the best value from the auto cal, then froze it with the numeric pick list, I no longer got the noise error message.

I am going to run this way for a while. Unfortunately, my cal sticker on the original foil envelope was lost in the move so this method will have to suffice for me.

Greg H.
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 19, 2014, 08:32:09 PM
I found the cal value arrived at by the controller (turn on AS3935 logging to see the results) matched the number on my envelope.

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 19, 2014, 08:38:25 PM
Storms closing in on my QTH - AS3935 staring to pick up lightning....

 http://projectmf.homelinux.com/as3935_stats.html

Don
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on June 21, 2014, 12:05:36 PM
We had many strikes well within 30 - 100 miles this morning. It detected only 1 strike. This strike happened to be detected while I was hitting the "save" button, so I don't know if it was the before or after settings or something in between during the save. (yellow circle is my house)
(http://www.cavecountryweather.com/lightning/Untitled.jpg)
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on June 21, 2014, 06:02:01 PM
I take my lighter to create some sparks hoping that the chip will pick up some signals. However when I click he lighter the LCD screen turns on and with each of the following clicks, the LCD scrolls through the different screens.  :-k This is with the lighter with in 10" of the chip.
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 21, 2014, 06:28:33 PM
If you have the external reset and LCD buttons installed, the leads pick up the impulse and can activate the LCD as though the button were pressed.

Picking up lots of strikes on the AS3935 now. A severe storm is about to pass through. See web site above to monitor real-time.

Don
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on June 21, 2014, 06:45:09 PM
Looks good! It has recorded 2 strikes now so that was enough to start getting the webpage going. Still working on the graphs.
http://www.cavecountryweather.com/lightning/as3935_stats.html (http://www.cavecountryweather.com/lightning/as3935_stats.html)

If I get another close storm, I will experiment more with the settings.
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on June 21, 2014, 07:14:24 PM
Don,
The http://projectmf.homelinux.com/log_as3935.php link returns an error message:

Warning: Division by zero in /volume1/web/log_as3935.php on line 18

Can you post the code?
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 21, 2014, 08:00:22 PM
Yes, for the rate calculation, that happens as the first strike in a new event will show a duration of zero. I didn't bother to trap for it or add a conditional statement to fix it. It doesn't affect the graphs.

Here's the latest code:

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("/volume1/web/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;
$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("/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);
?>
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 21, 2014, 08:03:37 PM
BTW, for the graphs, you need to download the jquery-1.11.0.min.js package in a local file. I have jquery.csv-0.71.js there as well. Not sure I am using that one. Include both in the three graphing programs to be safe. The Google Graphs .js can not be downloaded locally and must be referenced on the web.

Don
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on June 21, 2014, 08:08:05 PM
Yea, I got the .js files and thanks for the script.
Now to wait for more storms.
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 21, 2014, 08:09:25 PM
The table you have working needs a strike to generate the display file. However, the graphing programs read the last 300 lines of the log file. You can just copy mine for testing.

Don
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on June 22, 2014, 09:22:06 AM
Appreciate the help.
It logged 4 strikes today, although I don't think they are real as there are no storms in the area. At least it verified that the scripts, etc. are working.
http://www.cavecountryweather.com/AS3935lightning.php (http://www.cavecountryweather.com/AS3935lightning.php)
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 22, 2014, 10:45:22 AM
Looks good, Dave.

On that "divide by zero" error, on the first strike in an "event", the rate graph just plots a null rate. That way the start of a new event is clear from the graphs and all of the strikes align on the graphs.

I get the occasional false strike, but I have the signal threshold and spike rejection set very low. Set signal threshold to zero and you will see quite a few false detections for testing. Try setting it to 2 for better false strike rejection.

Don
WD9DMP

Glad you got it running.
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on June 22, 2014, 12:06:38 PM
I've been playing with the Tautic board for a while and gave up on it last year as it wasn't detecting strikes reliably.
I revisited it this year and have designed a 3V Coin Cell powered board with LCD screen, similar functionality to the board in the eval kit, but
based around an Atmega328p, i.e. a low powered arduino, and now have it detecting reliably.  I.E. Indoor detection at indoor settings and the defaults
for everything (2/2/2).  I've correlated strikes out to 60km (AS3935 is 40km, but it occasionally gets the estimation wrong) with it and smaller internal cloud
discharges during storms, it's been more sensitive than blitzortung in my area (by about a factor of 10) and really does give accurate
advance warning of storms and also of clouds with developing potential when close.

However it's been a lesson in frustration to get to this point, here's what I found, some of it maybe useful to someone.

1. Despite all the software having a hookup to the computer for serial over USB, don't do it.  :-)  Interference from the computer
is coupled in and receiver ends up useless.

2. Don't ground AS3935.  Many USB connections are grounded to mains ground on the 0V, another reason not to connect to a computer.
The AS3935 doesn't detect when grounded to mains ground.

3. When everything is right, it really does work well at the default settings.

4. Battery powered is better.

5. Needs good ground plane management.  All processing components should have a ground plane underneath, the antenna circuitry for the AS3935
should not.

6. Sleep processor between strikes, cuts down on noise

7. Detecting disturbers doesn't equate to detecting lightning.  I.E. You need a real storm to know if it's gonna detect lightning or not.

8. Be careful of any EMI generating components.  I had a regular 3-5V piezo buzzer (with internal oscillator), that when a strike hit,
the action of the buzzer "buzzing" would keep generating repeat strikes.  Took an RC filter and location well away from the board to solve.

9. Put enough capacitance on the Vcc.  The datasheet specifies 1uF, many boards are using 0.1uF which is not enough.

10. Don't generate any signals on 500KHz, i.e. don't used SPI with a 500KHz clock.

11. Recalibrate after every AS3935 setting change

12. I timed my calibration against the DS3231 realtime clock to get an accurate measurement

I haven't connected the AS3935 up to my RED yet and also not grounding the AS3935, but grounding the RED is contradictory, so I don't know
how to tackle that one.  I think the next thing to test will be a AS3935 without INN connected to 0V might be something to try.
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on June 22, 2014, 12:16:43 PM
This might help explain why the Acu-Rite detector seems to be working better than the AS3935 interfaced to the RED. The Acu-Rite with AS3935 is battery operated and is isolated from ground, or host processors.

http://www.wxforum.net/index.php?topic=22235.msg219697#msg219697 (http://www.wxforum.net/index.php?topic=22235.msg219697#msg219697)

Your observations about the 500KHz noise also fit with having better results with not allowing "auto" calibration and using a fixed calibration table setting.

It might be possible to have opto-isolators for the I2C lines, and float the AS3935 with a coin cell like you are suggesting, Jet.

I'll try some of your other ideas, they look reasonable to me.

Greg H.
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 22, 2014, 12:44:56 PM
There are a couple of "catch-22s" involved with the AS3935!

I noticed that grounding the controller seems to make the AS3935 deaf to lightning as well. However, I need a ground for my H-field antenna shields. The I2C bus needs the ground reference to the controller, so I can't see a way around that one.

Also, making the I2C leads longer than a few inches creates all kinds of bus errors, possibly related to the AS3935 periodic calibration routine putting the cal frequency on the IRQ line. This means that the board needs to be very near the controller, where noise pickup could be an issue. However, the auto noise threshold adjustment seems to select a fairly low value noise threshold, in indoor or outdoor modes. It may be due to the response of the AS3935 to certain kinds of noise, which do not generate an "excessive noise" interrupt but still are above the noise floor threshold. I think the reason that selecting "outdoor" helps detection is that is increases the noise floor threshold significantly, creating some immunity to impulse noise from the nearby controller.

We are stuck with the I2C bus on the controller - SPI is not supported.

Nice summary!

Regards,

Don

I've been playing with the Tautic board for a while and gave up on it last year as it wasn't detecting strikes reliably.
I revisited it this year and have designed a 3V Coin Cell powered board with LCD screen, similar functionality to the board in the eval kit, but
based around an Atmega328p, i.e. a low powered arduino, and now have it detecting reliably.  I.E. Indoor detection at indoor settings and the defaults
for everything (2/2/2).  I've correlated strikes out to 60km (AS3935 is 40km, but it occasionally gets the estimation wrong) with it and smaller internal cloud
discharges during storms, it's been more sensitive than blitzortung in my area (by about a factor of 10) and really does give accurate
advance warning of storms and also of clouds with developing potential when close.

However it's been a lesson in frustration to get to this point, here's what I found, some of it maybe useful to someone.

1. Despite all the software having a hookup to the computer for serial over USB, don't do it.  :-)  Interference from the computer
is coupled in and receiver ends up useless.

2. Don't ground AS3935.  Many USB connections are grounded to mains ground on the 0V, another reason not to connect to a computer.
The AS3935 doesn't detect when grounded to mains ground.

3. When everything is right, it really does work well at the default settings.

4. Battery powered is better.

5. Needs good ground plane management.  All processing components should have a ground plane underneath, the antenna circuitry for the AS3935
should not.

6. Sleep processor between strikes, cuts down on noise

7. Detecting disturbers doesn't equate to detecting lightning.  I.E. You need a real storm to know if it's gonna detect lightning or not.

8. Be careful of any EMI generating components.  I had a regular 3-5V piezo buzzer (with internal oscillator), that when a strike hit,
the action of the buzzer "buzzing" would keep generating repeat strikes.  Took an RC filter and location well away from the board to solve.

9. Put enough capacitance on the Vcc.  The datasheet specifies 1uF, many boards are using 0.1uF which is not enough.

10. Don't generate any signals on 500KHz, i.e. don't used SPI with a 500KHz clock.

11. Recalibrate after every AS3935 setting change

12. I timed my calibration against the DS3231 realtime clock to get an accurate measurement

I haven't connected the AS3935 up to my RED yet and also not grounding the AS3935, but grounding the RED is contradictory, so I don't know
how to tackle that one.  I think the next thing to test will be a AS3935 without INN connected to 0V might be something to try.
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on June 22, 2014, 01:00:46 PM
Your observations about the 500KHz noise also fit with having better results with not allowing "auto" calibration and using a fixed calibration table setting.

Interesting.  I'm using auto-calibration and it's stable, i.e. it always calibrates to the same value (5 in the 4 tautics I have), also across parameter changes.
(although the reason for recalibration after parameter change is not for cap value, it's for the internal oscillator).  I found that the typical
way on the Arduino of timing pulses over a delay cycle isn't accurate enough, and lead to some variance between adjacent cap settings, so I used the oscillator built into
the realtime clock as that's very accurate for timing. (more accurate than the cpu oscillator)

It might be possible to have opto-isolators for the I2C lines, and float the AS3935 with a coin cell like you are suggesting, Jet.
That's a great idea, also means the range could be increased for the I2C too.

Driving the LEDs in the optocoupler would likely require moving from coin cell to a bunch AA batteries, which
would work fine for me, because I could get the Lithium AA's, and put them and the AS3935 in the cold attic.

Found this:
http://www.nxp.com/documents/application_note/AN10364.pdf

Also, there's toslink, with that the distance could be considerably greater.   

These could be a workable solution apart from interfering with the auto cal as Don has mentioned.

If we can get the RED software to store a cal value in the AS3935 settings in the interface instead, that solves that issue
(apart from needing to externally calibrate, but that's a one off).

Another way to tackle this would be a remote AS3935 with MCU, but that would need software support at the RED end.
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 22, 2014, 01:08:17 PM
The cap cal value can be stored in the Red interface now, which disables that part of the cal routine.

The oscillator calibrations are still performed periodically.

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on June 22, 2014, 01:27:03 PM
That's good.  Is it 100KHz or 400KHz i2c on Red?
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 22, 2014, 03:23:56 PM
Default I2C speed is 50KHz, configurable up to 400KHz.

Don
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on June 22, 2014, 05:53:00 PM
Here's a solution I think may work, I like this as it's a no battery solution, with isolated 5V, isolated 0V and isolated i2C, plus handles the IRQ line.
That allows the red controller to be grounded if desired, and the AS3935 to be not grounded, but doesn't require remote power or batteries.


RED CONTROLLER DAUGHTER BOARD:

2 x P82B715TD118
(i2c Bus Extender SDA + SCL + IRQ signal, this is optional to provide longer run length)
http://www.mouser.com/ProductDetail/NXP-Semiconductors/P82B715TD118/?qs=sGAEpiMZZMvKM5ialpXrmmzVfheuROjE
CAT 5 socket


AS3935 DAUGHTER BOARD:

CAT 5 socket

Powered by 5V from the Red Controller Board:
2 x P82B715TD118
(i2c Bus Extender SDA + SCL + IRQ signal, this is optional to provide longer run length)
http://www.mouser.com/ProductDetail/NXP-Semiconductors/P82B715TD118/?qs=sGAEpiMZZMvKM5ialpXrmmzVfheuROjE

1 x ADuM5010
(Isolates 5V Supply and generates new regulated 5V supply for AS3935 and AS3935 side of the MAX14850)
http://www.mouser.com/ProductDetail/Analog-Devices/ADUM5010ARSZ-RL7/?qs=sGAEpiMZZMtitjHzVIkrqYThiPHWFX9aHiKMF61fbLU%3d

Powered by isolated 5V from ADuM5010:

1 x MAX14850
(Galvanic isolation for SDA + SCL + IRQ)
http://www.mouser.com/ProductDetail/Maxim-Integrated/MAX14850ASE+/?qs=sGAEpiMZZMtKtLvoHD9hC3S8brOmfjZV

AS3935 + associated circuitry

CAT5/6 shielded from RED to AS3935 daughter board.

Notes:
The ADuM5010 has a very high switching noise, (125MHz with 600KHz PWM).  The 600KHz is above the 500KHz listening frequency of
the AS3935, but not by much.  It will have to be tested to make sure that it's not generating EMI that interferes with the AS3935, but theoretically I think it
should work.

Maximum distance should be around 30m from the controller @ 100KHz.

I also looked at opto isolation, but that generally has a higher part count.  The galvanic isolation transceivers are relatively new and have less external part count.

Any thoughts on the above design before I pull the plug on it?

Also, can anyone with ESD / Ham experience tell me if having the AS3935 completely isolated with no charge at elevation (say in the attic / on roof) above the controller, will lead
to any build up of charge on it that could exceed the 600V isolation voltage of the MAX14850 and bridge across to the red controller due to electric field gradient?   (Obviously, direct lightning strikes excluded)

Thanks
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on June 22, 2014, 06:10:37 PM
Quote
Also, can anyone with ESD / Ham experience tell me if having the AS3935 completely isolated with no charge at elevation (say in the attic / on roof) above the controller, will lead
to any build up of charge on it that could exceed the 600V isolation voltage of the MAX14850 and bridge across to the red controller due to electric field gradient?   (Obviously, direct lightning strikes excluded)

Ground straps and benchtop mats typically have a 1M resistor in series with the ground wire. Maybe that is high enough not to cause problems, yet drain off static charges.

Greg H.
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on June 29, 2014, 02:34:54 PM
Well I think I figured out what the AS3539 really does - it keeps storms away! #-o
On 6/14 I think I may have the settings correct, but in the 2 weeks since, no storms have passed over to verify or adjust settings. During the same time though, many, many storms have passed over KY. I have received 0.04" in the past 15 days and again today, the storms are avoiding Cave Country. :???: At least the grass doesn't need cutting.
Title: Re: AS3595 not Detecting Strikes
Post by: Jumpin Joe on June 29, 2014, 03:35:42 PM
Well I think I figured out what the AS3539 really does - it keeps storms away! #-o
On 6/14 I think I may have the settings correct, but in the 2 weeks since, no storms have passed over to verify or adjust settings. During the same time though, many, many storms have passed over KY. I have received 0.04" in the past 15 days and again today, the storms are avoiding Cave Country. :???: At least the grass doesn't need cutting.

Mike and I are getting the rain and some strikes.
Title: Re: AS3595 not Detecting Strikes
Post by: Cutty Sark Sailor on June 29, 2014, 03:51:33 PM
Oh goodness.. last week was lightning awareness week...
we should have shared
"Get Blitzed and AS3935 to protect your home and well being"
"a Guaranteed lightning deterrent"...
Well I think I figured out what the AS3539 really does - it keeps storms away! #-o
On 6/14 I think I may have the settings correct, but in the 2 weeks since, no storms have passed over to verify or adjust settings. During the same time though, many, many storms have passed over KY. I have received 0.04" in the past 15 days and again today, the storms are avoiding Cave Country. :???: At least the grass doesn't need cutting.
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on June 29, 2014, 05:55:46 PM
There goes one now! I can see it out my window.
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on June 29, 2014, 06:40:36 PM
With the settings I posted before, I am getting very reliable detections on numerous storms that have passed through the last month.

Perhaps the AS3935 changes in the latest firmware will allow running with "indoor" enabled. The range isn't as good as I would like with the "outdoor", but is is acceptable at 25 kilometers or so - and it has been working.

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on June 29, 2014, 06:55:04 PM
I think it is working somewhat, but need a decent storm to tweak and verify. It did record a dozen strikes on the 28th as a heavy rain cloud passed to the west of here close by. This is with "indoor" enabled.
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on June 30, 2014, 12:49:01 PM
Here's the schematic.  Not tested yet, I have parts coming later today.  Should be good for 20-30m of extension
and it allows the Red to be grounded and the AS3935 to be ungrounded
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 01, 2014, 08:12:50 AM
Dave, I changed the rate calculation in the AS3935 alert logging PHP code to eliminate the divide by zero error on the first strike in an "event". I also set the rate to zero until the "event" duration is at least 60 seconds. This eliminates the elevated rate calculations that occur during the first minute of an "event".

Code: [Select]
if ($duration == 0) {
($rate = 0);
} else {
$rate = round(($strokes/$duration*60),2);
}
if ($duration <= 60) {
($rate = 0);
}

Complete code of log_as3935.php:

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("/volume1/web/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'];
if (
$duration == 0) {
($rate 0);
} else {
$rate round(($strokes/$duration*60),2);
}
if (
$duration <= 60) {
($rate 0);
}
$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("/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);
?>

Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on July 01, 2014, 08:19:32 AM
I will check it out when I get home tonight. While we are looking at it, the time stamp looks wrong. Is this set by the GPS?
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 01, 2014, 08:20:06 AM
I also removed the scale calculations in the graphs, which were operating on the entire log file, not just the displayed last 300 strikes. This caused the vertical scale of the graphs to be too large. The graphs look much better, allowing Google to auto-scale on the displayed set of strikes:

as3935_distance.html:

Code: [Select]
<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="refresh" content="60">
   <title>AS3935 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("as3935_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,7]);
    view.setRows(minRows,maxRows);

    var options = {
    title: "AS3935 Lightning Distance in KM\nLast 300 Strikes",
    chartArea: {height: 120, width: 900},
    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(7)},
    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>


as3935_energy.html:

Code: [Select]
<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="refresh" content="60" >
   <title>AS3935 Energy</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("as3935_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,10]);
    view.setRows(minRows,maxRows);

    var options = {
    title: "AS3935 Lightning Energy - Unitless\nLast 300 Strikes",
    chartArea: {height: 120, width: 900},
    backgroundColor: {fill: "#33CCFF"},
    hAxis: {title: data.getColumnLabel(2), slantedText: 1, slantedTextAngle: 45, textStyle: {fontSize: 10}},
    //vAxis: {title: data.getColumnLabel(10), minValue: data.getColumnRange(10).min, maxValue: data.getColumnRange(10).max},
vAxis: {title: data.getColumnLabel(10)},
    legend: 'none'

    };
   
    var chart2 = new google.visualization.ColumnChart(document.getElementById('chart2'));
    chart2.draw(view, options);
   });

   </script>

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

</body>
</html>


as3935_rate.html:

Code: [Select]
<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="refresh" content="60" >
   <title>AS3935 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("as3935_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,6]);
    view.setRows(minRows,maxRows);

    var options = {
    title: "AS3935 Lightning Event Strike Rate\nStrikes/Minute\nLast 300 Strikes",
    chartArea: {height: 120, width: 900},
    backgroundColor: {fill: "#33CCFF"},
    hAxis: {title: data.getColumnLabel(2), slantedText: 1, slantedTextAngle: 45, textStyle: {fontSize: 10}},
    //vAxis: {title: data.getColumnLabel(6), minValue: data.getColumnRange(6).min, maxValue: data.getColumnRange(6).max},
vAxis: {title: data.getColumnLabel(6)},
    legend: 'none'

    };
   
    var chart3 = new google.visualization.ColumnChart(document.getElementById('chart3'));
    chart3.draw(view, options);
   });

   </script>

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

</body>
</html>
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 01, 2014, 08:23:13 AM
I will check it out when I get home tonight. While we are looking at it, the time stamp looks wring. Is this set by the GPS?

Dave, the time is server time, the time the PHP script is run. I set me local server to sync off of the NTP server of the Red controller, so this works well for me. It also allows easier formatting of the time for Microsoft Excel post-processing.

Don
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 01, 2014, 08:27:57 AM
BTW, over 3,000 strikes detected by the AS3935 during the two rounds of severe storms last night. That's with the "outdoor" setting selected, which results in fewer false strikes and much better distance estimation by the AS3935. With "indoor" checked, almost all strikes showed as 1 km distance.

Checking "outdoor" seems to limit my AS3935 detection radius to about 30km maximum.

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 04, 2014, 06:22:06 AM
I found the new Acu-Rite Lightning Detector and posted it here http://www.wxforum.net/index.php?topic=22740.msg219002#msg219002 (http://www.wxforum.net/index.php?topic=22740.msg219002#msg219002)

I sent a message to Rhino asking if it uses the AS3935 IC from AMS. Reading between the lines in the manual and the timing of it makes me think (and hope) that it uses the AS3935. If so, I plan on parking it next to my AS3935 board interfaced to RED to see how they compare.

Greg


Hi Greg, I bought one of these some months ago, ( new lightning detector toy) and hoping it was the next Gen of detectors. The first storm we had, all my other detectors were going nuts, except this one, not a thing on it. Thru it in the box the next day thinking I wasted $ on it, very disappointed. Last night with the line of storms that came thru my area, thru another battery in it and it was working, holy cwap, it works. It was ranging pretty nicely with the online hits and triggering pretty good in time with my other detectors. Waiting later today for the next round of storms to come thru and check it out again. I was wondering the same thing, if it was using this chip in it and after reading the post of everyone stating these AS3595 units not detecting anything, I started to think that's what is in these units as well. Did you ever find out more on this unit and yes, I wish there was some sort of port that on it as well, but I guess one could make one if they knew the internals to this unit.     :-)     Frank
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on July 05, 2014, 08:17:52 PM
I've built and initially tested a remote AS3935 transmitter / receiver for Red.  Waiting for a thunderstorm to confirm, but disturbers are being detected, and autotune is working with 10meters of unshielded Cat 5E UTP.

Photos of the prototype boards:
(http://IMG_6600-2.jpg)
(http://IMG_6601-2.jpg)

The main features are:

1. AS3935 can be remote:  It's beneficial to get it away from the the Discovery Board to increase signal to noise ratio

2. Ability to Ground the Red Board whilst leaving the AS3935 board ungrounded: 
AS3935 does not receive lightning strikes well if grounded, Red board requires grounding, these requirements conflict with each other, this design solves that.

3. Isolation.  0V, 3.3V, IRQ, SDA and SCL lines all isolated between the AS3935 Remote and the Red Controller.  Isolation
is galvanic, and use Mems Transformers on chip.  This provides ground isolation too for the AS3935.  10M resistors on 3V3 and 0V couple to provide
static drain, but are optional (for complete isolation).  Also there are ESD protection diodes on both boards.

4. I2C Extension.  Boards include high current i2C line drivers, to provide extension upto 20m.  10m has been achieved in
practice with low quality unscreened CAT 5E UTP.  6m would be a reasonable limit for most CAT5/6 cables, 10m-20m would be a reasonable upper
limit with good quality screened cable.  This provides the ability to locate the AS3935 well away from the controller board to reduce
noise.

5. No requirement for a separate AS3935 daughter board, everything is on board.  SMD soldering required, can be built single
layer.  The AS3935 is the only part that requires a reflow oven /  hot plate, although I've heard of people hand soldering them.

if there's enough interest, I may order a run of boards and/or fab some.

Updated schematics.  Standard disclaimers, don't blame me if you hurt yourself, damage something etc.

Code: [Select]
2014-07-05 23:52:12     70 | AS3935: Write registers...
2014-07-05 23:52:12     70 |
2014-07-05 23:52:12     70 | === AS3935 ==========================================
2014-07-05 23:52:12     70 | AS3935: Write registers...
2014-07-05 23:52:12     70 | AS3935: Calibrate Antenna...
2014-07-05 23:52:13     71 | AS3935: LCO TUN_CAP=0 => Frequency 508000Hz, Deviation 1.6
2014-07-05 23:52:13     71 | AS3935: LCO TUN_CAP=1 => Frequency 506400Hz, Deviation 1.3
2014-07-05 23:52:13     71 | AS3935: LCO TUN_CAP=2 => Frequency 504800Hz, Deviation 1.0
2014-07-05 23:52:13     71 | AS3935: LCO TUN_CAP=3 => Frequency 503200Hz, Deviation 0.6
2014-07-05 23:52:13     71 | AS3935: LCO TUN_CAP=4 => Frequency 501600Hz, Deviation 0.3
2014-07-05 23:52:13     71 | AS3935: LCO TUN_CAP=5 => Frequency 500000Hz, Deviation 0.0
2014-07-05 23:52:13     71 | AS3935: LCO TUN_CAP=6 => Frequency 498400Hz, Deviation -0.3
2014-07-05 23:52:13     71 | AS3935: Stop, found best frequency before
2014-07-05 23:52:13     71 | AS3935: Found best tune-cap=5 with frequency=500000Hz => deviation=0.0%
2014-07-05 23:52:13     71 | AS3935: Calibrate RCO...
2014-07-05 23:52:13     71 | AS3935: CALIB_RCO accepted
2014-07-05 23:52:13     71 | AS3935: Frequency on SRCO is 1140100Hz
2014-07-05 23:52:13     71 | AS3935: CALIB_RCO accepted
2014-07-05 23:52:13     71 | AS3935: Frequency on TRCO is 32700Hz
2014-07-05 23:52:13     71 | AS3935: Init IRQ...
2014-07-05 23:52:13     71 | =====================================================
...
2014-07-05 23:57:43    166 | AS3935: Interrupt (1)
2014-07-05 23:57:43    166 | AS3935: Interrupt (0)
2014-07-05 23:57:43    166 | AS3935: Interrupt register is 0x4, pending status 0, pin 0
2014-07-05 23:57:43    166 | AS3935: Disturber detected!
2014-07-05 23:57:47    170 | AS3935: Interrupt (1)
2014-07-05 23:57:47    170 | AS3935: Interrupt (0)
2014-07-05 23:57:47    170 | AS3935: Interrupt register is 0x4, pending status 0, pin 0
2014-07-05 23:57:47    170 | AS3935: Disturber detected!
2014-07-05 23:57:48    171 | AS3935: Interrupt (1)
2014-07-05 23:57:48    171 | AS3935: Interrupt (0)
2014-07-05 23:57:48    171 | AS3935: Interrupt register is 0x4, pending status 0, pin 0
2014-07-05 23:57:48    171 | AS3935: Disturber detected!
2014-07-05 23:57:50    173 | AS3935: Interrupt (1)
2014-07-05 23:57:50    173 | AS3935: Interrupt (0)
2014-07-05 23:57:50    173 | AS3935: Interrupt register is 0x4, pending status 0, pin 0
2014-07-05 23:57:50    173 | AS3935: Disturber detected!in1:     6   ->  5
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 05, 2014, 09:53:40 PM
I found the new Acu-Rite Lightning Detector and posted it here http://www.wxforum.net/index.php?topic=22740.msg219002#msg219002 (http://www.wxforum.net/index.php?topic=22740.msg219002#msg219002)

I sent a message to Rhino asking if it uses the AS3935 IC from AMS. Reading between the lines in the manual and the timing of it makes me think (and hope) that it uses the AS3935. If so, I plan on parking it next to my AS3935 board interfaced to RED to see how they compare.

Greg


Hi Greg, I bought one of these some months ago, ( new lightning detector toy) and hoping it was the next Gen of detectors. The first storm we had, all my other detectors were going nuts, except this one, not a thing on it. Thru it in the box the next day thinking I wasted $ on it, very disappointed. Last night with the line of storms that came thru my area, thru another battery in it and it was working, holy cwap, it works. It was ranging pretty nicely with the online hits and triggering pretty good in time with my other detectors. Waiting later today for the next round of storms to come thru and check it out again. I was wondering the same thing, if it was using this chip in it and after reading the post of everyone stating these AS3595 units not detecting anything, I started to think that's what is in these units as well. Did you ever find out more on this unit and yes, I wish there was some sort of port that on it as well, but I guess one could make one if they knew the internals to this unit.     :-)     Frank

See earlier post: http://www.wxforum.net/index.php?topic=22235.msg219697#msg219697 (http://www.wxforum.net/index.php?topic=22235.msg219697#msg219697). I tore it down and the Acu-Rite does indeed use the AS3935.

Greg H.



Title: Re: AS3595 not Detecting Strikes
Post by: Jet on July 06, 2014, 08:35:49 PM
My prototype is working well.  Just had a storm go through, detected strikes out to 40km and overhead, and timing coincided with
the lightning strikes as well as distance estimation timings between strike and thunder.

Settings used were:
Tune: Auto
Noise Floor: 1100/78
Outdoor: Unchecked
Ignore Disturber: Checked
Signal Threshold: 1
Spike Rejection: 1
Red Firmware: 7.1

Detector board was placed 6m away from the Red Controller and up against a window (with Low E coating !)

It's  working better than my tautic AS3935 that's battery operated, which I suspect is due to being mounted close to the microcontroller, whereas the Red is not.

It's also working better than blitzortung which only detected 2 strikes during the storms that just rolled through, and we're currently under a severe thunderstorm warning.

Is there anywhere on blitzortung / lightningmaps.org which displays a AS3935 strike / energy history?
Title: Re: AS3595 not Detecting Strikes
Post by: Cutty Sark Sailor on July 06, 2014, 08:40:15 PM
AS3935 is actually not a part of the Blitzortung system... a nice add on for those interested, however.
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 06, 2014, 08:50:06 PM
A very cool circuit!

Mine just started working with 6" I2C connections and the board mounted in the box a few inches from the controller. I did not change the ground, power, or anything else, other than using the Outdoor setting, as I mentioned.

My history can be seen at:

http://projectmf.homelinux.com/as3935_stats.html

The .csv log of all lightning history is at:

http://projectmf.homelinux.com/as3935_log.txt

Storms are just coming into range, so there should be some new activity over the next few hours.

Regards,

Don
WD9DMP


My prototype is working well.  Just had a storm go through, detected strikes out to 40km and overhead, and timing coincided with
the lightning strikes as well as distance estimation timings between strike and thunder.

Settings used were:
Tune: Auto
Noise Floor: 1100/78
Outdoor: Unchecked
Ignore Disturber: Checked
Signal Threshold: 1
Spike Rejection: 1
Red Firmware: 7.1

Detector board was placed 6m away from the Red Controller and up against a window (with Low E coating !)

It's  working better than my tautic AS3935 that's battery operated, which I suspect is due to being mounted close to the microcontroller, whereas the Red is not.

It's also working better than blitzortung which only detected 2 strikes during the storms that just rolled through, and we're currently under a severe thunderstorm warning.

Is there anywhere on blitzortung / lightningmaps.org which displays a AS3935 strike / energy history?
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on July 07, 2014, 09:11:24 PM
Well I had a severe storm pass over. If the signal threshold was set at 0, it was picking up signals, but none seemed to correlate to what I could visually see out the window. For example I could see a strike, and it would not register. Or it would pick up a strike that I did not see and no thunder. So I set the threshold to 1 and received a few signals all at 1km, but the BO network picked up at least 20 in the close range area and I visually saw more that neither picked up.

I am thinking about remotely locating the AS3935 away from the controller. Right now it is in the basement garage which is mostly underground except for the garage doors. Will longer wires work? Is there a good place to get them pre-made? Or is something like the boards that Jet made the way to go?
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on July 08, 2014, 01:43:25 AM
Well I had a severe storm pass over. If the signal threshold was set at 0, it was picking up signals, but none seemed to correlate to what I could visually see out the window. For example I could see a strike, and it would not register. Or it would pick up a strike that I did not see and no thunder. So I set the threshold to 1 and received a few signals all at 1km, but the BO network picked up at least 20 in the close range area and I visually saw more that neither picked up.

My experience with the AS3935 so far is that, setting it too sensitive makes it less sensitive to local strikes, and make it less sensitive makes it's less sensitive to remote strikes.  When playing with it as a device on it's own (i.e. not connected to red), I've found the default settings to be the best, and there are situations where you pickup small intracloud discharges.  I haven't played with it a lot with the Red yet, but the storm I had roll through yesterday, I had accurate timing when strikes were overhead (i.e. flash, alarm alert co-incident with about 50% of the stokes I could see / hear correlation, and much better detection than BO).  Also, the distance when the storm approached and left also made sense for the level of activity / movement on radar (i.e. 20-40km out).

Well I haI am thinking about remotely locating the AS3935 away from the controller. Right now it is in the basement garage which is mostly underground except for the garage doors. Will longer wires work? Is there a good place to get them pre-made? Or is something like the boards that Jet made the way to go?

Longer wires likely won't work with I2C.  I2C is fairly low powered and assumes low capacitance in it's cabling, which means short cables.  Theorectically you should be able to get a few feet out of i2C, without any drivers, and reducing the speed should help too however I've heard reports on the red that 6 inches is about the limit until you start getting corruption.

There are a few options for the boards.  The AS3935 does not have legs, so it's the only component that's hard to solder without solder paste / reflow technique.  Everything else is 0603's, SSOPs (i.e. similar to soldering a red controller), and then there's a TSSOP which is still solderable just (with some solder wick).  The prototype I did was toaster oven reflowed, and vias / thru hole were hand soldered afterwards, only because if I was reflowing the AS3935, I might as well reflow the rest at the same time.  I have heard the AS3935 can be hand soldered, but have never tried that as it looks like it would be a pain, the pads to wrap around so it should be just about possible.

I don't really want to get into mass producing / assembling boards, but would consider ordering a few purple PCB's from OSHPark (lead time 4 weeks) and hand assembling (or part assembling) a few at close to cost for those who already have a station running and contribute their time to the community.  I.E. As pay back for the excellent resources you're contributing to.  PM me.
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on July 11, 2014, 08:38:26 AM
Since the controller was moved from the basement to the attic, we haven't had any real storms. However there are a few random signals picked up from time to time. The interface is showing signals at different ranges (27km, 31km, etc...) but on the webpage (http://www.cavecountryweather.com/AS3935lightning.php), they are all showing as 1km. We are looking at a good chance of some storms early next week and that should give a good test of the new location.
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 11, 2014, 09:06:16 AM
I continue to run the Acu-Rite lightning detector that uses the AS3935. http://www.acurite.com/lightning-detector-02020.html (http://www.acurite.com/lightning-detector-02020.html)

It seems to be working well and is not giving the false indications that the board interfaced to RED does. It is literally right next to the AS3935 interfaced to the RED.

It is either the conducted noise and grounding, or something unique to the software. I suspect the former. I don't think the chip is at fault since the Acu-Rite works well.

Greg H.

Title: Re: AS3595 not Detecting Strikes
Post by: Jet on July 11, 2014, 09:29:31 AM
It is either the conducted noise and grounding, or something unique to the software. I suspect the former. I don't think the chip is at fault since the Acu-Rite works well.

I would suspect both noise and grounding.  The Discovery board pumps out considerable noise, and grounding an AS3935 I've found to seriously reduce the number of strikes that are detected as lightning, whilst still detecting disturbers fine.

The best approach I've found to using these in equipment is; sleep the microprocessor for most of the time (cuts down on Noise), and battery operate the device
(solves the grounding issue and removes coupled noise from the PSU).

Also, double check any boards you're using with the Red, have the INN pin on the AS3935 tied to 0V.  The Tautic schematic does not, although the Tautic board itself does, and some boards have been based on the Tautic schematic.
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 11, 2014, 11:29:49 AM
Dave, my web page graphs track the distance (and other data) shown on the Controller Status page exactly. There may be an issue with the scripts, possibly an extraneous line feed somewhere.

If I set the "indoor" setting, I get very little distance discrimination. All strikes show as around 1 km. Setting the "Outdoor" box provides much better distance discrimination. My current settings are attached.

The latest storm results can be seen at:

http://projectmf.homelinux.com/as3935_stats.html

Note the distance ranges and rates. I expanded the graphs to show the last 1000 strikes. I also fixed the scaling issue that was scaling the graphs on all values in the log file, not just the last 1000 strikes.

I'm running with 6" I2C leads and 150KHz I2C clock. The board is powered from the 3.3VDC pin on the 'DISCOVERY board (Important! Don't use the 5VDC pin!). The controller is grounded.

Regards,

Don



Since the controller was moved from the basement to the attic, we haven't had any real storms. However there are a few random signals picked up from time to time. The interface is showing signals at different ranges (27km, 31km, etc...) but on the webpage (http://www.cavecountryweather.com/AS3935lightning.php), they are all showing as 1km. We are looking at a good chance of some storms early next week and that should give a good test of the new location.
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 11, 2014, 01:23:53 PM
It is either the conducted noise and grounding, or something unique to the software. I suspect the former. I don't think the chip is at fault since the Acu-Rite works well.

I would suspect both noise and grounding.  The Discovery board pumps out considerable noise, and grounding an AS3935 I've found to seriously reduce the number of strikes that are detected as lightning, whilst still detecting disturbers fine.

The best approach I've found to using these in equipment is; sleep the microprocessor for most of the time (cuts down on Noise), and battery operate the device
(solves the grounding issue and removes coupled noise from the PSU).

Also, double check any boards you're using with the Red, have the INN pin on the AS3935 tied to 0V.  The Tautic schematic does not, although the Tautic board itself does, and some boards have been based on the Tautic schematic.

Jet,

I am using the Embedded Adventures board. I just checked the board manual and the schematic shows a solid connection to ground for INN. http://www.embeddedadventures.com/datasheets/MOD-1016_hw_v4_doc_v2.pdf (http://www.embeddedadventures.com/datasheets/MOD-1016_hw_v4_doc_v2.pdf)

Greg H.
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 11, 2014, 09:32:52 PM
I continue to run the Acu-Rite lightning detector that uses the AS3935. http://www.acurite.com/lightning-detector-02020.html (http://www.acurite.com/lightning-detector-02020.html)

It seems to be working well and is not giving the false indications that the board interfaced to RED does. It is literally right next to the AS3935 interfaced to the RED.

It is either the conducted noise and grounding, or something unique to the software. I suspect the former. I don't think the chip is at fault since the Acu-Rite works well.

Greg H.

Interesting topic, I also bought one of the Embedded Adventures board and another Acu-Rite lightning detector at the same time. Would be interested on the software being used for the board and how you got them lightning strike charts generated for your page. Thanks, will be watching this thread for more info.  :-)
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on July 12, 2014, 12:16:32 PM
Jet,

I am using the Embedded Adventures board. I just checked the board manual and the schematic shows a solid connection to ground for INN. http://www.embeddedadventures.com/datasheets/MOD-1016_hw_v4_doc_v2.pdf (http://www.embeddedadventures.com/datasheets/MOD-1016_hw_v4_doc_v2.pdf)

Greg H.

You may want to try the approach I used then, i.e. isolate everything from the Red and mount the AS3935 a distance from the Red.
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 12, 2014, 12:30:14 PM
Jet,

I am using the Embedded Adventures board. I just checked the board manual and the schematic shows a solid connection to ground for INN. http://www.embeddedadventures.com/datasheets/MOD-1016_hw_v4_doc_v2.pdf (http://www.embeddedadventures.com/datasheets/MOD-1016_hw_v4_doc_v2.pdf)

Greg H.

I think that it is a good idea. I thought of a similar approach myself, but unlike you didn't have the gumption (or time) to pursue it. I'll add it to the "to do" list...

Greg H.


You may want to try the approach I used then, i.e. isolate everything from the Red and mount the AS3935 a distance from the Red.
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 12, 2014, 01:49:47 PM
On the Embedded Adventures boards, how long did it take to receive this board and how did people order them? I ordered mine thru Amazon and still no ship date shown and I ordered it on the 7th, the same time I ordered another Acu-Rite unit and that's almost here.  Frank  :? 
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 12, 2014, 02:28:12 PM
I ordered mine directly from Embedded Adventures last December. I don't recall exactly how long it took, it came USPS.

Greg H.

Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 12, 2014, 07:59:27 PM
Ok, thanks, just seems strange that I cannot get any emails back from them. I emailed them directly and thru Amazon and no response. On Amazon, it stated 2 left, and I ordered one and it updated saying one left. But yet to see it shipped or any word from them. Guess I'll have to wait..   :?
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 14, 2014, 09:12:29 PM
This is nuts, I haven't heard a word from the seller at all. I emailed, thru Amazon, directly on their site, and even called and no answers at all. I really wanted one of them boards to play with and hopefully generate some of the charts and graphs everyone else is doing once I figure out how they are doing this and the software they are using as well. But until I either hear from them or Amazon, I don't have one to try out. Anyone know if Embedded Adventures is still offering these or if they are in business still? I see this board and others listed, but now support and emails back    #-o
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on July 14, 2014, 09:17:15 PM
Did you try their US or UK number?  Looks like they're UK homed.
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 14, 2014, 09:23:45 PM
Did you try their US or UK number?  Looks like they're UK homed.

I tried he US number since it stated if ordered in US then it would come from NY. Are there any other version of these boards out there besides this one, this is painfull. Anyone know of someone that workds there of has had contact with them here on the forum?   ](*,)
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on July 14, 2014, 09:36:18 PM
I tried he US number since it stated if ordered in US then it would come from NY. Are there any other version of these boards out there besides this one, this is painfull. Anyone know of someone that workds there of has had contact with them here on the forum?   ](*,)

If you want to still order from them, try the UK number (EST + 5 hours).  Often places which are homed in another country have distributers for other countries, and the distributers are often not a reflection of the company, so it's worth trying both.

Tautic are the other sellers: https://www.tindie.com/products/TAUTIC/as3935-lightning-sensor-board/ although you'll need to solder 2 resistors for I2C on the back.

If you get stuck, I've got some spare Tautic ones I'm no longer using, which I don't mind selling.  PM me if you have problems sourcing one.
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 14, 2014, 09:49:13 PM
I can try to call them directly and see what happens. I checked the link you posted, boy, with the shipping, its almost twice the cost of the one I ordered  :shock: but if all else fails, I will contact you via PM. Is there any difference between this one and the one I ordered? Thank you !  :-)
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on July 14, 2014, 10:33:44 PM
Is there any difference between this one and the one I ordered? Thank you !  :-)

The Tautic defaults to SPI, the Embedded defaults to I2C.  Embedded V4 is I2C address 0x03, the Embedded V2 is I2C address 0x00.

To get the Tautic to do I2C, you solder 2 pull-up resistors to the Tautic board in the blank slots for them, and tie the SI pin to 3.3V.

Otherwise, the boards are pretty much the same, just the basics to get the chip working with an MCU.

I've tried out the Tautic with the Red Controller and it works...

By works, I mean as much as any of the AS3935 boards work with the Red, i.e. communicates, detects disturbers and occasionally detects lightning with varying degrees of success :-)
Title: Re: AS3595 not Detecting Strikes
Post by: werk_ag on July 14, 2014, 11:04:15 PM
I also ordered mine directly from Embedded Adventures. It takes 3 weeks to arrive to Portugal.
What is strange is that I thought I was ordering from a company in UK, but the board was sent from the USA.
It is a V4 version.
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on July 15, 2014, 06:11:42 AM
Since the controller was moved from the basement to the attic, we haven't had any real storms. However there are a few random signals picked up from time to time. The interface is showing signals at different ranges (27km, 31km, etc...) but on the webpage (http://www.cavecountryweather.com/AS3935lightning.php), they are all showing as 1km. We are looking at a good chance of some storms early next week and that should give a good test of the new location.
We had a small storm pass through last night and it appears that AS3935 is much happier in its new location in the attic. Also cleared the log file and started over. Everything appears to be working well - Thanks for the help!
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 15, 2014, 07:57:36 PM
I also ordered mine directly from Embedded Adventures. It takes 3 weeks to arrive to Portugal.
What is strange is that I thought I was ordering from a company in UK, but the board was sent from the USA.
It is a V4 version.

Ok on the 3 weeks for delivery, but would be nice if there was some sort of comms from them stating this other than the estimated delivery time is 4 weeks. But when Amazon emails me saying my card is not charged now since the seller has not indicated a ship notice yet, I hope this doesn't hold up my order from them. Amazon is now checking on this with the seller and I guess from what they said, the seller has 2 days to respond to them. I'll give it til the end of the week. States shipping from NY for me and I'm only one state over from there..  :shock:
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 15, 2014, 08:08:12 PM
I've had two deliveries the past month on AS3935 boards ordered directly from Embedded Adventures, so they are shipping product. The boards were actually ordered from others for whom I am building systems. I believe they both arrived within two weeks of ordering. Both were shipments to my US address from the New York distributor.

Best,

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 15, 2014, 08:13:00 PM
Hum, ok, maybe I'll let it ride for a week. Perhaps on Amazon it won't show shipped and will just show up in the 2 week window. I'm in Mass so the next state over, maybe I'll see it by the end of this week. What kind of systems are you building?  Thanks
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 18, 2014, 08:00:46 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    :-)
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 18, 2014, 08:51:32 PM
Frank,

I wrote some scripts that process data sent to my Linux server from the Blitzortung Red controller on every strike detection from the AS3935. Of course, the board needs to be connected via I2C to the Blitzortung controller.

The scripts create a comma-delimited CSV file and also produce Google charts of strike rate, distance and energy of each strike.

Don
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 18, 2014, 09:02:05 PM
Oh ok Don, is this the only way so far or perhaps there are others out there that maybe wrote a small program for capturing the data and even in a graphical format or am I just reaching for the stars at this early point of development of these boards coming out. Guess I'll be learning once I get a board, someday... thanks   :-)
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 23, 2014, 11:24:54 AM
Yes, for the rate calculation, that happens as the first strike in a new event will show a duration of zero. I didn't bother to trap for it or add a conditional statement to fix it. It doesn't affect the graphs.

Here's the latest code:

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("/volume1/web/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;
$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("/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);
?>

Don,

Could you post the most recent updates to this script? I looked here and at BO and can't find it. I think that there were some changes since this post. Maybe some for 7.2?

I am missing some fields and your output looks more complete. Thanks.

This is the simple text-style output with the bright green backround.

http://www.sunrisesideweather.com/as3935display.php (http://www.sunrisesideweather.com/as3935display.php)

You can see that I am missing data in a lot of fields now and I would like to fix that.


Greg H.
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 23, 2014, 08:58:17 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 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
Title: Re: AS3595 not Detecting Strikes
Post by: Josiah on July 23, 2014, 10:45:50 PM
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

Over all, I would think that they would all have pretty close to the same performance. I've asked the same question your asking now. Its been awhile since I've fiddled around with them but I'll tell you what I can remember.

From a Schematic point of view:
Comparing the data sheets from the manufacturer of the AS3935 to the Data sheets on the PCB modules, It looks like they all use pretty much the same Schematic. The few differences that I do see are related to if the PCB was setup for I2C or SPI use.

From a Layout point and Component of view:
There's not very many components to rearrange so the differences there are again minimal.
The Component values used on the PCBs are all the same as whats recommended in by the AS3935 manufacturer.

To connect them to a PC without having a micro-controller, You could use a Serial to SPI or I2C adapter. I haven't personally tried one of these though.

If you really want to see what the differences are I would recommend doing what I did and start looking at the Data sheets. As for differences in performance, I don't know if your going to find much. For anyone to really know which one works the best is going to require them to have all three just for comparison purposes. My guess on them performing close to the same is based on the fact that they all use the AS3935 chip which does have some tuning ability for the Antenna circuit. Which between the AS3935 Chip and Antenna, that's where all the detection work is being done.

Just my $0.02 worth, I don't know if this is any help to you.
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 23, 2014, 11:02:11 PM
These are the latest scripts. You also need the following libraries present in the directory with the scripts. Search in Google and download from the Web:

jquery-1.11.0.min.js
jquery.csv-0.71.js


This is the script to call from the "Actions" section of the controller Settings page. Adjust the paths to the log file (as3935_log.txt) and text display file (as3935_display.txt) to suit the local path on the machine running the Apache web server - log_as3935.php:

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("/volume1/web/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("/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);
?>



This is the .html that reads the as3935_log.txt CSV file and displays the Distance graph - as3935_distance.html:

Code: [Select]
<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="refresh" content="60">
   <title>AS3935 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("as3935_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,7]);
    view.setRows(minRows,maxRows);

    var options = {
    title: "AS3935 Lightning Distance in KM\nLast 300 Strikes",
    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(7)},
    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>


This is the .html that reads the as3935_log.txt CSV file and displays the Energy graph - as3935_energy.html:

Code: [Select]
<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="refresh" content="60" >
   <title>AS3935 Energy</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("as3935_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,10]);
    view.setRows(minRows,maxRows);

    var options = {
    title: "AS3935 Lightning Energy - Unitless\nLast 300 Strikes",
    chartArea: {height: 120, width: 900},
    backgroundColor: {fill: "#33CCFF"},
    hAxis: {title: data.getColumnLabel(2), slantedText: 1, slantedTextAngle: 45, textStyle: {fontSize: 10}},
    //vAxis: {title: data.getColumnLabel(10), minValue: data.getColumnRange(10).min, maxValue: data.getColumnRange(10).max},
vAxis: {title: data.getColumnLabel(10)},
    legend: 'none'

    };
   
    var chart2 = new google.visualization.ColumnChart(document.getElementById('chart2'));
    chart2.draw(view, options);
   });

   </script>

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

</body>
</html>


This is the .html that reads the as3935_log.txt CSV file and displays the Rate graph - as3935_rate.html:

Code: [Select]
<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="refresh" content="60" >
   <title>AS3935 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("as3935_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,6]);
    view.setRows(minRows,maxRows);

    var options = {
    title: "AS3935 Lightning Event Strike Rate\nStrikes/Minute\nLast 300 Strikes",
    chartArea: {height: 120, width: 900},
    backgroundColor: {fill: "#33CCFF"},
    hAxis: {title: data.getColumnLabel(2), slantedText: 1, slantedTextAngle: 45, textStyle: {fontSize: 10}},
    //vAxis: {title: data.getColumnLabel(6), minValue: data.getColumnRange(6).min, maxValue: data.getColumnRange(6).max},
vAxis: {title: data.getColumnLabel(6)},
    legend: 'none'

    };
   
    var chart3 = new google.visualization.ColumnChart(document.getElementById('chart3'));
    chart3.draw(view, options);
   });

   </script>

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

</body>
</html>

This html formats the as3935_display.txt for proper display on a web page. It must have a .php suffix - display_as3935_data.php:

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

</body>
</html>

This ties it all together on a single web page  - as3935_stats.html:

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

<center>

<p><b><font size="5" color="blue">AS3935 Local Lightning Detection Module Statistics</font></b></p>
<p><b>Text updates every 5 seconds. Graphs upate every minute. Times in US Central local time.</b></p>
<p>The AS3935 chip-based detector module detects local lightning strikes independently of the primary Blitzortung hardware, although
the Blitzortung controller communicates with the module and gathers data for each detected strike. The
chip on the board performs detection, distance estimates to the leading edge of the storm front, and a measure
of relative energy received for each strike. The module does not provide direction or position information.</p>
<iframe src="display_as3935_data.php" height=335 width=545 scrolling=no frameborder=0>  margin=auto display=block align=middle</iframe></br>
<iframe src="as3935_distance.html" height=335 width=1125 scrolling=no frameborder=0 margin=auto display=block></iframe>
<iframe src="as3935_energy.html" height=335 width=1125 scrolling=no frameborder=0 margin=auto display=block></iframe>
<iframe src="as3935_rate.html" height=335 width=1125 scrolling=no frameborder=0 margin=auto display=block></iframe>

</center>

</body>
</html>

Regards,

Don
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 24, 2014, 08:38:21 AM
Thanks for posting the scripts, Don.

I assume that the plots and data fields will be blank until the next time I get some activity from the AS3935. After twiddling with the paths and permissions, I have it working. (pending the next strikes!)

Your banner at the top of the page refers to Central time, but I am seeing UTC. Is this a server function? I didn't find anything in the scripts for time zone.

Greg H.

Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 24, 2014, 09:13:06 AM
You're welcome!

If you manually call the log_as3935.php script from a web browser, it will add an entry to the log file with date and time fields, but no valid strike data. This will make your graphs plot a bunch of empty data points. Your log file seems to have many of these empty data entries.

You might want to delete the as3935_log.txt or move it to a backup file. The script will create a new file on the first call from the controller on an AS3935 lightning event. You can also manually delete the entries with no valid lightning data with a text editor. Be sure not to leave any extra newlines in the text file, or the graphing scripts won't load the log file properly. You also need to leave the newline at the end of the log file.

I'm also updating the script to log Blitzortung server alerts in a separate log file and display a set of graphs for those events. I'm still testing those scripts.

Best,

Don
WD9DMP

Thanks for posting the scripts, Don.

I assume that the plots and data fields will be blank until the next time I get some activity from the AS3935. After twiddling with the paths and permissions, I have it working. (pending the next strikes!)

Greg H.
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 24, 2014, 09:39:14 AM
The script that writes the log file does not use the time stamp that the Controller appends when it calls the script, but calculates the time and date when it is called using the PHP "date" function. On my Linux server, a Synology NAS, the PHP "date" function returns the UTC adjusted with the local timezone. I do not think this is typical Linux behavior, though. The Synology NAS Linux variant does things differently. A more conventional Linux server will probably return UTC.

The reason I did not use the embedded timestamp from the controller is to make the formatting of the date and time easier using the PHP "date" function (first few lines of the script).

Yes, the "last strike" text data will not get updated until a strike is detected. If you have valid strike data in the log file, the graphing scripts will load the entire log file, but only display the last 300 events. If their are less than 300 events in the log, all of the entries will be displayed with wider bars on the graph.

Changing the graphing script to display much over 300 strikes seems not to work very well, likely because the Google API can't make the bars narrow enough to display all of the strikes with the graph dimensions I have specified in the scripts.

Best,

Don
WD9DMP

I assume that the plots and data fields will be blank until the next time I get some activity from the AS3935. After twiddling with the paths and permissions, I have it working. (pending the next strikes!)

Your banner at the top of the page refers to Central time, but I am seeing UTC. Is this a server function? I didn't find anything in the scripts for time zone.

Greg H.
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 24, 2014, 09:47:53 AM
The script that writes the log file does not use the time stamp that the Controller appends when it calls the script, but calculates the time and date when it is called using the PHP "date" function. On my Linux server, a Synology NAS, the PHP "date" function returns the UTC adjusted with the local timezone. I do not think this is typical Linux behavior, though. The Synology NAS Linux variant does things differently. A more conventional Linux server will probably return UTC.

The reason I did not use the embedded timestamp from the controller is to make the formatting of the date and time easier using the PHP "date" function (first few lines of the script).

Yes, the "last strike" text data will not get updated until a strike is detected. If you have valid strike data in the log file, the graphing scripts will load the entire log file, but only display the last 300 events. If their are less than 300 events in the log, all of the entries will be displayed with wider bars on the graph.

Changing the graphing script to display much over 300 strikes seems not to work very well, likely because the Google API can't make the bars narrow enough to display all of the strikes with the graph dimensions I have specified in the scripts.

Best,

Don
WD9DMP

I assume that the plots and data fields will be blank until the next time I get some activity from the AS3935. After twiddling with the paths and permissions, I have it working. (pending the next strikes!)

Your banner at the top of the page refers to Central time, but I am seeing UTC. Is this a server function? I didn't find anything in the scripts for time zone.

Greg H.

OK, thanks again. I just removed the reference to Central Time. I will just wait for some strikes, since this is the expected behavior.

Greg
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 24, 2014, 10:40:21 AM
You can test the graphs and text display by entering this URL in your browser. The URL will feed dummy data to the script. Substitute the domain of your web server and the path to your script, if necessary:

Code: [Select]
http://my.domain.com/log_as3935.php?strokes=25&disturbers=0&duration=180&dist=31&dist_min=1&dist_max=50&energy=28251&energy_min=5432&energy_max=50123&strokes_all=350&disturbers_all=0&events=13

Regards,

Don
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 24, 2014, 11:47:35 AM
BTW, the updated logging script now sets the lightning rate to zero if a strike occurs within the first 60 seconds of a new lightning "event". A new "event" is started by the Controller after some period of lightning inactivity.

The reason for this is that the rate calculation (number of event strikes / event duration) is not really valid until at least 60 seconds have elapsed. Before this was done, there were some very high strike rates being calculated that were not representative of the actual rate.

Each of the bars on the three graphs are aligned across the graphs, as new data is calculated after each strike. There will be a few zero-rate plots on the rate graph for any strikes occurring within 60 seconds of the start of a new "event".

The graphs show only individual strikes and are event-driven. They do not graph the events over a regular time interval. As the lightning rate increases, more plots will be shown.

Best,

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 24, 2014, 12:46:48 PM
You can test the graphs and text display by entering this URL in your browser. The URL will feed dummy data to the script. Substitute the domain of your web server and the path to your script, if necessary:

Code: [Select]
http://my.domain.com/log_as3935.php?strokes=25&disturbers=0&duration=180&dist=31&dist_min=1&dist_max=50&energy=28251&energy_min=5432&energy_max=50123&strokes_all=350&disturbers_all=0&events=13

Regards,

Don

I ran this and see the updated text:

Quote
Last Strike
==== ======
Latest Strike:.................07/24/2014 16:37:16
Latest Strike Distance:........31 KM
Latest Strike Energy:..........28251

Last Event
==== =====
Number of Strikes in Event:....25
Lightning Event Duration:......180 Seconds
Current Event Strike Rate:.....8.33 Strikes/Minute
Shortest Distance to Strike:...1 KM
Longest Distance to Strike:....50 KM
Lowest Strike Intensity:.......5432
Highest Strike Intensity:......50123
Total strikes since reboot:....350

but, the graphs area is still blank.... :-k

I have checked permissions and paths.

Greg H.

Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on July 24, 2014, 01:41:08 PM
I am using the same scripts and had to do 2 additional steps.
I had to manually create and name the "as3935.txt" (http://www.cavecountryweather.com/lightning/as3935.txt) (my filename) in notepad then add this and upload it. Then change the file permissions.
Code: [Select]
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
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 24, 2014, 03:49:17 PM
Your log file at http://www.sunrisesideweather.com/as3935_log.txt is missing the first column header line. The graphs will not display without the first header line.

Just delete as3935_log.txt and run the URL I posted with the dummy data a dozen times or so. If the log file is deleted, the script will create a new file with the correct header.

Or, add this as the first line in your existing log file:

Code: [Select]
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

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 24, 2014, 04:25:58 PM
Sorry, Don. Sometimes I confuse my web sites.
I actually have it at http://www.miraculon.net/froula/as3935_log.txt (http://www.miraculon.net/froula/as3935_log.txt). (directory name in in your honor...)
I now have that header row, but no graphics yet.
Here is the link to the main script: http://miraculon.net/froula/as3935_stats.html (http://miraculon.net/froula/as3935_stats.html)

Greg H.

Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 24, 2014, 05:05:56 PM
I ran the JS debugger on your main page and it showed these errors:

Code: [Select]
Failed to load resource: the server responded with a status of 404 (Not Found) http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery-1.11.0.min.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery.csv-0.71.js
Uncaught ReferenceError: $ is not defined miraculon.net/froula/as3935_energy.html:16
Uncaught ReferenceError: $ is not defined miraculon.net/froula/as3935_rate.html:16
Uncaught ReferenceError: $ is not defined miraculon.net/froula/as3935_distance.html:16
GET http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery.csv-0.71.js 404 (Not Found) as3935_distance.html:8
GET http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery-1.11.0.min.js 404 (Not Found) as3935_distance.html:7
Uncaught ReferenceError: $ is not defined as3935_energy.html:16
Uncaught ReferenceError: $ is not defined as3935_distance.html:16
Uncaught ReferenceError: $ is not defined as3935_rate.html:16

It appears you need to download the two .js packages and put them in the web/froula/ directory. The graphing scripts need those libraries to work.

You can grab them here:

http://jquery.com/download/
https://code.google.com/p/jquery-csv/downloads/detail?name=jquery.csv-0.71.js&can=2&q=


Best,

Don
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 24, 2014, 05:28:25 PM
Also, the first line of data in the CSV log file looks like two concatenated lines run together.

Delete the log file, then run this url from a browser. Hit refresh a few dozen times to create a new file and to load up the log file with data.

Code: [Select]
http://miraculon.net/froula//log_as3935.php?strokes=25&disturbers=0&duration=180&dist=31&dist_min=1&dist_max=50&energy=28251&energy_min=5432&energy_max=50123&strokes_all=350&disturbers_all=0&events=13

A small bug is anybody can write bum data into your log if they can access the php logging script ( as I just did)!

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on July 24, 2014, 07:23:05 PM
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

Over all, I would think that they would all have pretty close to the same performance. I've asked the same question your asking now. Its been awhile since I've fiddled around with them but I'll tell you what I can remember.

From a Schematic point of view:
Comparing the data sheets from the manufacturer of the AS3935 to the Data sheets on the PCB modules, It looks like they all use pretty much the same Schematic. The few differences that I do see are related to if the PCB was setup for I2C or SPI use.

From a Layout point and Component of view:
There's not very many components to rearrange so the differences there are again minimal.
The Component values used on the PCBs are all the same as whats recommended in by the AS3935 manufacturer.

To connect them to a PC without having a micro-controller, You could use a Serial to SPI or I2C adapter. I haven't personally tried one of these though.

If you really want to see what the differences are I would recommend doing what I did and start looking at the Data sheets. As for differences in performance, I don't know if your going to find much. For anyone to really know which one works the best is going to require them to have all three just for comparison purposes. My guess on them performing close to the same is based on the fact that they all use the AS3935 chip which does have some tuning ability for the Antenna circuit. Which between the AS3935 Chip and Antenna, that's where all the detection work is being done.

Just my $0.02 worth, I don't know if this is any help to you.

Hi Josiah, thanks for the info and thoughts. With 3 of them out there now, maybe others have tried them and noticed any differences.   :-)
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on July 24, 2014, 09:44:24 PM
The script that writes the log file does not use the time stamp that the Controller appends when it calls the script, but calculates the time and date when it is called using the PHP "date" function. On my Linux server, a Synology NAS, the PHP "date" function returns the UTC adjusted with the local timezone. I do not think this is typical Linux behavior, though. The Synology NAS Linux variant does things differently. A more conventional Linux server will probably return UTC.
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?
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 24, 2014, 09:57:19 PM
Dave, do you have a link to your installation?

Do
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins on July 24, 2014, 09:58:37 PM
yep (http://www.cavecountryweather.com/AS3935lightning.php)  :grin:
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 24, 2014, 10:03:20 PM
I ran the JS debugger on your main page and it showed these errors:

Code: [Select]
Failed to load resource: the server responded with a status of 404 (Not Found) http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery-1.11.0.min.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery.csv-0.71.js
Uncaught ReferenceError: $ is not defined miraculon.net/froula/as3935_energy.html:16
Uncaught ReferenceError: $ is not defined miraculon.net/froula/as3935_rate.html:16
Uncaught ReferenceError: $ is not defined miraculon.net/froula/as3935_distance.html:16
GET http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery.csv-0.71.js 404 (Not Found) as3935_distance.html:8
GET http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery-1.11.0.min.js 404 (Not Found) as3935_distance.html:7
Uncaught ReferenceError: $ is not defined as3935_energy.html:16
Uncaught ReferenceError: $ is not defined as3935_distance.html:16
Uncaught ReferenceError: $ is not defined as3935_rate.html:16

It appears you need to download the two .js packages and put them in the web/froula/ directory. The graphing scripts need those libraries to work.

You can grab them here:

http://jquery.com/download/
https://code.google.com/p/jquery-csv/downloads/detail?name=jquery.csv-0.71.js&can=2&q=


Best,

Don

That is where I have the files. The jquery-1.11.0.min.js wasn't showing, the 1.11.1 one was. I went to the all versions page and downloaded jQuery Core 1.11.0 - uncompressed, minified.

I am looking at the two .js files sitting in the froula directory. Still no graphs...

Greg H.



Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 24, 2014, 10:04:43 PM
I ran the JS debugger on your main page and it showed these errors:

Code: [Select]
Failed to load resource: the server responded with a status of 404 (Not Found) http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery-1.11.0.min.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery.csv-0.71.js
Uncaught ReferenceError: $ is not defined miraculon.net/froula/as3935_energy.html:16
Uncaught ReferenceError: $ is not defined miraculon.net/froula/as3935_rate.html:16
Uncaught ReferenceError: $ is not defined miraculon.net/froula/as3935_distance.html:16
GET http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery.csv-0.71.js 404 (Not Found) as3935_distance.html:8
GET http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery-1.11.0.min.js 404 (Not Found) as3935_distance.html:7
Uncaught ReferenceError: $ is not defined as3935_energy.html:16
Uncaught ReferenceError: $ is not defined as3935_distance.html:16
Uncaught ReferenceError: $ is not defined as3935_rate.html:16

It appears you need to download the two .js packages and put them in the web/froula/ directory. The graphing scripts need those libraries to work.

You can grab them here:

http://jquery.com/download/
https://code.google.com/p/jquery-csv/downloads/detail?name=jquery.csv-0.71.js&can=2&q=


Best,

Don

That is where I have the files. The jquery-1.11.0.min.js wasn't showing, the 1.11.1 one was. I went to the all versions page and downloaded jQuery Core 1.11.0 - uncompressed, minified.

I am looking at the two .js files sitting in the froula directory. Still no graphs...

Greg H.

I just did a wget on my linux box and it finds them, but the browser claims it can't. I also moved them up a directory and changed the script URL calls to the full http://www.miraculon.net/jquery.....js src links.

Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 24, 2014, 10:20:14 PM
Greg, all three of the scripts (rate, distance, and energy) are not able to load the .js package files. They all return this error:

Code: [Select]
GET http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery.csv-0.71.js 404 (Not Found) as3935_rate.html:8
GET http://miraculon.net/virtual/users/e17373-19178/web/froula/jquery-1.11.0.min.js 404 (Not Found) as3935_rate.html:7
Uncaught ReferenceError: $ is not defined

Perhaps you need to set executable permissions on the .js files, as they seem to be present in the web/froula/ directory.

Try to chmod 777 those two .js files.

Also, try to just specify the package file names in the three scripts without the fully-qualified path. For example, change the lines in each of the three files from:

Code: [Select]
<script src="/virtual/users/e17373-19178/web/froula//jquery-1.11.0.min.js"></script>
<script src="/virtual/users/e17373-19178/web/froula//jquery.csv-0.71.js"></script>

to

Code: [Select]
<script src="./jquery-1.11.0.min.js"></script>
<script src="./jquery.csv-0.71.js"></script>

Don
WD9DMP

Sorry, Don. Sometimes I confuse my web sites.
I actually have it at http://www.miraculon.net/froula/as3935_log.txt (http://www.miraculon.net/froula/as3935_log.txt). (directory name in in your honor...)
I now have that header row, but no graphics yet.
Here is the link to the main script: http://miraculon.net/froula/as3935_stats.html (http://miraculon.net/froula/as3935_stats.html)

Greg H.
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon on July 24, 2014, 10:35:02 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
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula 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
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula 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
Title: Re: AS3595 not Detecting Strikes
Post by: Dr Obbins 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!
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon 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.



Title: Re: AS3595 not Detecting Strikes
Post by: dfroula on July 27, 2014, 12:17:40 AM
Greg, can you post your log_as3935.php script here, in a code block?

Don
WD9DMP
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon 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);
?>

Title: Re: AS3595 not Detecting Strikes
Post by: dfroula 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
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon 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.

Title: Re: AS3595 not Detecting Strikes
Post by: miraculon 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:

Title: Re: AS3595 not Detecting Strikes
Post by: dfroula 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.
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon 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.

Title: Re: AS3595 not Detecting Strikes
Post by: dfroula 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
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula 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
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon 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.

Title: Re: AS3595 not Detecting Strikes
Post by: dfroula 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
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon 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.

Title: Re: AS3595 not Detecting Strikes
Post by: dfroula 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
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula 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
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon 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
Title: Re: AS3595 not Detecting Strikes
Post by: dfroula 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>
Title: Re: AS3595 not Detecting Strikes
Post by: miraculon 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.
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 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
Title: Re: AS3595 not Detecting Strikes
Post by: Jet 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
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 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:
Title: Re: AS3595 not Detecting Strikes
Post by: Jet 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:
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on August 08, 2014, 02:01:08 PM
Hi Jet, thats exactly what I want to do, run it as standalone device and hoping there have been others that are doing this, have some sort of software to display the info and also provide data to the PC to use on a website. Granted it doesn't have direction, but at least shows lightning is within a watched window of view and even have it alert. There has to be others that have made or done up projects on the IC/PCB unit by know..   Where can I find out more on this "Striker" software and is there anyone on the board doing this?  Thanks for the info  :)
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on August 08, 2014, 02:27:30 PM
Hi Jet, thats exactly what I want to do, run it as standalone device and hoping there have been others that are doing this, have some sort of software to display the info and also provide data to the PC to use on a website. Granted it doesn't have direction, but at least shows lightning is within a watched window of view and even have it alert. There has to be others that have made or done up projects on the IC/PCB unit by know..
I.E. Something like the attached image.  It has everything minus the remote web logging.  If you wanted to do the remote web logging, you'd want to add a ATmega2560 and a wifi shield.  You could also use a Raspberry Pi instead.

Where can I find out more on this "Striker" software and is there anyone on the board doing this?  Thanks for the info  :)
You can search google for "striker AS3935" and it's the top link.
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on August 08, 2014, 08:17:06 PM
Yup,that's what I'm talking about  :grin: that looks like another pcb with the chip installed on it. But that's that the idea thou and using the embedded pcb I have to read the data from it to the display with come circuitry. I'll check into that, looks cool. Thanks Frank
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on August 09, 2014, 02:58:37 PM
Here's a photo of the Low Noise Electrically Isolated AS3935 lightning detector I've designed / built specifically for the Red.

I've got 3 in total + the prototype.  1 is for me and 1 is earmarked for another forum member.  I have 2 left over, a Purple one, plus the prototype (electrically the same, just doesn't look as good). 

PM me if you're having AS3935 detection issues and wish to try this alternate design out or want to remotely mount the AS3935 away from the controller.  Design schematic can be found earlier in this thread if you wish to build one yourself.
Title: Re: AS3595 not Detecting Strikes
Post by: W3DRM on August 09, 2014, 10:43:34 PM
Wow Jet, they look great. Some very nice looking workmanship.  =D&gt;
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on August 15, 2014, 03:09:26 PM
I've found an undocumented register 0x33 for the AS3935 and is referenced in this code in AMS's demo code:

Code: [Select]
            if(_RB15 == 0)                      // Debouncing switch
            {
                as3935ModifyRegister(0x33, 0x01, 0x01, NULL);       // Short Antenna

Anybody seen this and have some information on when the Antenna needs to be shorted and why?
Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on August 15, 2014, 06:26:02 PM
Hi Jet, thats exactly what I want to do, run it as standalone device and hoping there have been others that are doing this, have some sort of software to display the info and also provide data to the PC to use on a website. Granted it doesn't have direction, but at least shows lightning is within a watched window of view and even have it alert. There has to be others that have made or done up projects on the IC/PCB unit by know..
I.E. Something like the attached image.  It has everything minus the remote web logging.  If you wanted to do the remote web logging, you'd want to add a ATmega2560 and a wifi shield.  You could also use a Raspberry Pi instead.

Where can I find out more on this "Striker" software and is there anyone on the board doing this?  Thanks for the info  :)
You can search google for "striker AS3935" and it's the top link.

I would love to get one of those stand alone units, then I could add a Raspberry Pi to it   :-)
Title: Re: AS3595 not Detecting Strikes
Post by: Jet on August 16, 2014, 03:28:49 AM
I would love to get one of those stand alone units, then I could add a Raspberry Pi to it   :-)

That stand alone unit won't help you.  It's standalone, not designed to hookup to anything else.  If you want to log to a web server, you'll need more program space / ram, which means the same design but with a atmega 2560 instead of a atmega 328p and a wifi shield, that would give you wifi to log to a webserver.

The other option (and easier and likely cheaper for you) is you connect your existing embedded AS3935 board to a Raspberry PI and the PI can be your web server, and you can add an HDMI or composite monitor / screen for visual output and USB keyboard for control.  As someone else has already written the software for you and detailed the wiring, it'll be your easiest option.

Title: Re: AS3595 not Detecting Strikes
Post by: Frank57 on August 16, 2014, 08:48:32 AM
Hi Jet, got it. I wasn't thinking and with everything I have been reading on the net, for some reason I was thinking this one had connections to another board for sending the data out. I was going by this >""It has everything minus the remote web logging.  If you wanted to do the remote web logging, you'd want to add a ATmega2560 and a wifi shield.  You could also use a Raspberry Pi instead.""<  #-o  Yet, I still like this unit as its small and has a nice size display. I'm reading up on this Raspberry Pi stuff now and found some nice, and not to expensive units out here and a attachment display board with 7 inch display as well. Could be an interesting project, but some learning to do. Thank you   :-)
Title: Re: AS3595 not Detecting Strikes
Post by: Michaelpt on April 28, 2015, 02:59:00 PM
hi everybody

 I just connected the AS3595 sensor, and it seems to be working

I am not very good when it comes to scripts could somebody please help me on how I get the data from this little device
onto my webpage my dyslexia is getting the better of me I really appreciate any help

H field and the E field plus AS3595 sensor
station number 1297   Cheddleton Nr.Leek uk
www.weather-above.com


Thank you
mick
Title: Re: AS3595 not Detecting Strikes
Post by: mischmerz on January 27, 2020, 07:58:33 PM
I know .. somewhat late. I just wanted to write that I went through the same problems with reliability issues. However - I hooked the AS3595 to an ESP8266 and most libraries don support that. I modified a SparkFun lib, but had either plenty of Lightning reports even without any thunderstorm, or none with a heavy storm above.

I finally traced my problem to the proximity of the AS3595 to the ESP chip. With a clearance of about 2 inches between both, I have very few disturbers (2 or 3 per minute) . A spark from a lighter reports a disturber, using the lightning simulator (Playing With Fusion) reports a strike.

Now waiting for a real life storm.

All the posts in this thread helped me to find the problem. Thank you.

Michaela


Title: Re: AS3595 not Detecting Strikes
Post by: amino1958 on October 22, 2021, 02:29:06 PM
I know .. somewhat late. I just wanted to write that I went through the same problems with reliability issues. However - I hooked the AS3595 to an ESP8266 and most libraries don support that. I modified a SparkFun lib, but had either plenty of Lightning reports even without any thunderstorm, or none with a heavy storm above.

I finally traced my problem to the proximity of the AS3595 to the ESP chip. With a clearance of about 2 inches between both, I have very few disturbers (2 or 3 per minute) . A spark from a lighter reports a disturber, using the lightning simulator (Playing With Fusion) reports a strike.

Now waiting for a real life storm.

All the posts in this thread helped me to find the problem. Thank you.

Michaela

Hi... I'm a year later than you  :grin: and have just started working with this chip.
Can you please tell me what register settings you used? The default settings don't seem to work very well and rather than waste time trying various combinations it would be great if you could share you info.
Thanks!
Title: Re: AS3595 not Detecting Strikes
Post by: Cutty Sark Sailor on October 22, 2021, 04:46:54 PM
PLEASE NOTE FYI 
:D
No offense intended for anyone,... just to emphasize that this device is NOT part of, or related to the Blitzortung project,  other than the deprecated,obsolete experiment using System Red design and distribution, prior to 2016.

And it may be that another round of discussion may be beginning which could confuse the 'association'  issue.The AS3935 was only used as 'experimental' adjunct to the no longer produced Blitzortung System RED family of controllers.

As far as discussion, the Blitzortung board here may not be the appropriate place for general discussion of this module, other than the original application with the old System Red controllers. ;)

 It is NOT supported by Blitzortung, created NO data used  by Blitzortong, and served NO FUNCTION with any Blitzortung systems, other than a curiosity for operators. MOST were abandoned by Blitzortung operators, and very few operators achieved any type of useful 'localized' data.

It only remains in the RED firmware to support the few RED system operators utilizing it.
It has not been included or referenced in ANY Blitzortung system designed and/or released since 2015. Only the older Red systems.

It is NOT included in any current (BLUE) system compatibility, or firmware,.

Mike