[weewx-user] Re: AS3935 Lightening Detector

2019-09-19 Thread J D
Hi Dan,
I greatly modified the python code that I got from here
https://github.com/pcfens/RaspberryPi-AS3935/tree/8f624b1588ba54977a596c1409800a286ea445b0
I also think it is the basics for the weewx extension.
I do not use the weewx extension since I wrote my own program to control 
the detectors since I run three of the them. But IMHO if I was using the 
weewx extension I would comment out the code in the interrupt handler for 
changing the noise setting and just log that it happen or write code that 
lowers the setting after a couple of minutes. I also would comment out the 
code for setting the disturber mask and again just log them when they 
happen. In my code I actually just log every 10 disturber interrupts to cut 
down on the log entries. The device real weakness is disturbers and 
handling them makes all the difference in how well the device will work. 
For tuning I looked at a "c" program but then wrote my own in python that 
tries to handle dealing with measuring timing using a RP and python and the 
device.  Also when I talk about heat swings i mean from 70 to 130 degrees 
since my system has direct sun on it.
Thanks Jerry

On Thursday, September 19, 2019 at 4:50:22 AM UTC-7, dan Forster wrote:
>
> Jerry,
>
> Sorry for not coming back sooner, I have been traveling with work.
>
> Many thanks for your comments. You are far ahead of me with regards to 
> working these little lightning detector boards out and getting the best 
> from them.
>
> A quick question, what code do you use/alter to cause a re-tune and 
> disable the noise threshold (like squelch I suppose in amateur radio)? I 
> noticed the board does get warm and slightly deaf due to the 500Khz tuning 
> cap being affected by this heat.
>
> Cheers,
>
> Dan
>
>
>
> On Saturday, 14 September 2019 14:16:14 UTC-4, J D wrote:
>>
>> Hi Dan,
>> Nice write up of your work.
>>
>> Here are a couple items to help with the correctness of the device.
>> If you are using the very common python code found on the net there are a 
>> number of issues with it.
>> The big one is the disturber mask part.  In the specs when a disturber is 
>> detected the device turns off for a 1.5 seconds. It also sends the 
>> interrupt. If you are using the python code the interrupt handler turns on 
>> the mask interrupt bit in the device. So now no more interrupts but the 
>> device still turns off and this is bad. Also to make things worse very far 
>> away lightning is sometimes detected as a disturber. So IMHO I would 
>> disable the setting of the mask bit and if you are having a lot of issues 
>> with disturbers either move the device or change the Watchdog setting, or 
>> the AFE setting or the Spike setting or the Noise setting to reduce the 
>> number of disturbers. This is not a perfect solution since changing the 
>> settings reduces the device sensitivity but at least it does not turn it 
>> off for a 1.5 seconds.
>> The next problem is the Noise threshold part of the python code. The 
>> problem here is noise can come and go but the code only raises the Noise 
>> Threshold there is no code for lowering it. Again IMHO I found that it is 
>> best to disable this code and if the noise is truly an issue manually raise 
>> the Noise threshold or put in timer code that lowers it to see if the noise 
>> is still high.
>> Another code issue is that there is no auto calibrate of the tune cap. 
>> There does exist a "c" version for auto tune and I have written my own 
>> python version of auto tune. Auto tune IMHO is only needed if you have the 
>> device outside where there are large temp swings. I have found that as the 
>> devices get hot the tune cap value needs to go higher to keep it as close 
>> as possible to 500khz. The specs state that the other oscillators are temp 
>> compensated but nothing about the 500khz oscillator.  Usually the change is 
>> just one or two steps up or down. So I run the auto-tune 3 times a day 
>> (morning, noon,night) and if the device is detecting lightning then I skip 
>> the auto-tune for that time.
>> Thanks Jerry
>>
>>
>> On Saturday, September 14, 2019 at 8:21:02 AM UTC-7, dan Forster wrote:
>>>
>>>
>>>
>>>
>>>
>>> Sorry I have not been about and replying to board messages. Started some 
>>> DIY project which turned out larger than expected...
>>>
>>> This is how I got my AS3935 to work in Weewx. It may not bee 100% 
>>> correct, but it is now working on two pi's really well. Note if you think 
>>> you are going to run this on 6" pieces of cable, so its close to the pi, 
>>> indoors, next to all your gizzmos, the lightning will bite your bum for 
>>> this thing sees it. Its best run in a low noise environment (away from 
>>> power supplies, cheap LED lights, computer screens, etc). From what I can 
>>> gather, its a 500khz receiver and some clever logic, so like any radio, it 
>>> likes to be able to see the sky. I will start from scratch so you can get 
>>> going from a new pi sdcard/AS3935 board
>>>
>>> This is the detection 

[weewx-user] Re: AS3935 Lightening Detector

2019-09-19 Thread dan Forster
Jerry,

Sorry for not coming back sooner, I have been traveling with work.

Many thanks for your comments. You are far ahead of me with regards to 
working these little lightning detector boards out and getting the best 
from them.

A quick question, what code do you use/alter to cause a re-tune and disable 
the noise threshold (like squelch I suppose in amateur radio)? I noticed 
the board does get warm and slightly deaf due to the 500Khz tuning cap 
being affected by this heat.

Cheers,

Dan



On Saturday, 14 September 2019 14:16:14 UTC-4, J D wrote:
>
> Hi Dan,
> Nice write up of your work.
>
> Here are a couple items to help with the correctness of the device.
> If you are using the very common python code found on the net there are a 
> number of issues with it.
> The big one is the disturber mask part.  In the specs when a disturber is 
> detected the device turns off for a 1.5 seconds. It also sends the 
> interrupt. If you are using the python code the interrupt handler turns on 
> the mask interrupt bit in the device. So now no more interrupts but the 
> device still turns off and this is bad. Also to make things worse very far 
> away lightning is sometimes detected as a disturber. So IMHO I would 
> disable the setting of the mask bit and if you are having a lot of issues 
> with disturbers either move the device or change the Watchdog setting, or 
> the AFE setting or the Spike setting or the Noise setting to reduce the 
> number of disturbers. This is not a perfect solution since changing the 
> settings reduces the device sensitivity but at least it does not turn it 
> off for a 1.5 seconds.
> The next problem is the Noise threshold part of the python code. The 
> problem here is noise can come and go but the code only raises the Noise 
> Threshold there is no code for lowering it. Again IMHO I found that it is 
> best to disable this code and if the noise is truly an issue manually raise 
> the Noise threshold or put in timer code that lowers it to see if the noise 
> is still high.
> Another code issue is that there is no auto calibrate of the tune cap. 
> There does exist a "c" version for auto tune and I have written my own 
> python version of auto tune. Auto tune IMHO is only needed if you have the 
> device outside where there are large temp swings. I have found that as the 
> devices get hot the tune cap value needs to go higher to keep it as close 
> as possible to 500khz. The specs state that the other oscillators are temp 
> compensated but nothing about the 500khz oscillator.  Usually the change is 
> just one or two steps up or down. So I run the auto-tune 3 times a day 
> (morning, noon,night) and if the device is detecting lightning then I skip 
> the auto-tune for that time.
> Thanks Jerry
>
>
> On Saturday, September 14, 2019 at 8:21:02 AM UTC-7, dan Forster wrote:
>>
>>
>>
>>
>>
>> Sorry I have not been about and replying to board messages. Started some 
>> DIY project which turned out larger than expected...
>>
>> This is how I got my AS3935 to work in Weewx. It may not bee 100% 
>> correct, but it is now working on two pi's really well. Note if you think 
>> you are going to run this on 6" pieces of cable, so its close to the pi, 
>> indoors, next to all your gizzmos, the lightning will bite your bum for 
>> this thing sees it. Its best run in a low noise environment (away from 
>> power supplies, cheap LED lights, computer screens, etc). From what I can 
>> gather, its a 500khz receiver and some clever logic, so like any radio, it 
>> likes to be able to see the sky. I will start from scratch so you can get 
>> going from a new pi sdcard/AS3935 board
>>
>> This is the detection board I use - 
>> https://www.ebay.co.uk/itm/AS3935-Lightning-Strike-Storm-Distances-Detector-I2C-SPI-Sensor-Programmable/333265065400?_trkparms=ispr%3D1=item4d982555b8:g:VWUAAOSw1NNdKCt2=AQAEAAAB4BPxNw%2BVj6nta7CKEs3N0qX6knsPaWu2HyFk9u1VHKBpz81ghsTUEAWuMAkGOyv6nDm%2FfHF6ZNRVWUmyw6fMizGZ%2BYp4db2m9KpEC601RxylniwLIMm1Yna7V1VtB3WNTdeLsrOFmUXb8ykzBxZK2B3hLzfgKkhHP80k%2BXuEpKA7AgDyaSN%2FJluRWLSOUQ88THmlkf3DW0W6wL2mUZW5Sp9gkMFWxvt2OpppfyNs2YHI%2B2C%2Ftbi5YMd%2BCv5q6K300H7lsatLWwQEkE6kv1YXLLis4zt4NUw58qFrTss5O%2B%2FnahobycDwpibwG%2B%2Bj8LZ5Hn3HJgTc8sQFNyhu%2Bm6M2RUolopnAvcJu%2BWCVgM%2Fz3fr0O7l1u%2FZ1cd64SuOKVm%2FvCNIDddFrgZNW0gbMjAVxwlS11mmQuiIowAqFlf6d16f7t1yrCXjHYPZyTEqdNhTNpycb1IGseu6FoaXpJquvoB4nZrnPvn0qe7P1xPdyHVfNXh224r8jd4NDdC0jCDVDJlJD8ilWZKXe6%2Fb5sNQIoJqw5tWlPbv5gbq%2FC%2BdpTM%2BJMKdeeAPfLpHN%2FpirKMAKcbKuW6wydhGa7aa%2BRk6SnCsySeIvixE2%2Fet4FPn%2BRvEQVFVNg2M1L4tkPkpFW6bdA%3D%3D=333265065400e9f0e246d5364032ab0e55b879590ef8
>>  
>> - they seem fairly tough little things to be honest and can seemingly 
>> withstand lots of abuse - (I must have changed every wire ((not power pins 
>> of course)) in my experimentation's).
>>
>>
>> Using RPi 3 board - using this image 
>> https://downloads.raspberrypi.org/raspbian/images/raspbian-2018-11-15/. 
>> Its not the latest - I prefer something tried and 

[weewx-user] Re: AS3935 Lightening Detector

2019-09-14 Thread J D
Hi Dan,
Nice write up of your work.

Here are a couple items to help with the correctness of the device.
If you are using the very common python code found on the net there are a 
number of issues with it.
The big one is the disturber mask part.  In the specs when a disturber is 
detected the device turns off for a 1.5 seconds. It also sends the 
interrupt. If you are using the python code the interrupt handler turns on 
the mask interrupt bit in the device. So now no more interrupts but the 
device still turns off and this is bad. Also to make things worse very far 
away lightning is sometimes detected as a disturber. So IMHO I would 
disable the setting of the mask bit and if you are having a lot of issues 
with disturbers either move the device or change the Watchdog setting, or 
the AFE setting or the Spike setting or the Noise setting to reduce the 
number of disturbers. This is not a perfect solution since changing the 
settings reduces the device sensitivity but at least it does not turn it 
off for a 1.5 seconds.
The next problem is the Noise threshold part of the python code. The 
problem here is noise can come and go but the code only raises the Noise 
Threshold there is no code for lowering it. Again IMHO I found that it is 
best to disable this code and if the noise is truly an issue manually raise 
the Noise threshold or put in timer code that lowers it to see if the noise 
is still high.
Another code issue is that there is no auto calibrate of the tune cap. 
There does exist a "c" version for auto tune and I have written my own 
python version of auto tune. Auto tune IMHO is only needed if you have the 
device outside where there are large temp swings. I have found that as the 
devices get hot the tune cap value needs to go higher to keep it as close 
as possible to 500khz. The specs state that the other oscillators are temp 
compensated but nothing about the 500khz oscillator.  Usually the change is 
just one or two steps up or down. So I run the auto-tune 3 times a day 
(morning, noon,night) and if the device is detecting lightning then I skip 
the auto-tune for that time.
Thanks Jerry


On Saturday, September 14, 2019 at 8:21:02 AM UTC-7, dan Forster wrote:
>
>
>
>
>
> Sorry I have not been about and replying to board messages. Started some 
> DIY project which turned out larger than expected...
>
> This is how I got my AS3935 to work in Weewx. It may not bee 100% correct, 
> but it is now working on two pi's really well. Note if you think you are 
> going to run this on 6" pieces of cable, so its close to the pi, indoors, 
> next to all your gizzmos, the lightning will bite your bum for this thing 
> sees it. Its best run in a low noise environment (away from power supplies, 
> cheap LED lights, computer screens, etc). From what I can gather, its a 
> 500khz receiver and some clever logic, so like any radio, it likes to be 
> able to see the sky. I will start from scratch so you can get going from a 
> new pi sdcard/AS3935 board
>
> This is the detection board I use - 
> https://www.ebay.co.uk/itm/AS3935-Lightning-Strike-Storm-Distances-Detector-I2C-SPI-Sensor-Programmable/333265065400?_trkparms=ispr%3D1=item4d982555b8:g:VWUAAOSw1NNdKCt2=AQAEAAAB4BPxNw%2BVj6nta7CKEs3N0qX6knsPaWu2HyFk9u1VHKBpz81ghsTUEAWuMAkGOyv6nDm%2FfHF6ZNRVWUmyw6fMizGZ%2BYp4db2m9KpEC601RxylniwLIMm1Yna7V1VtB3WNTdeLsrOFmUXb8ykzBxZK2B3hLzfgKkhHP80k%2BXuEpKA7AgDyaSN%2FJluRWLSOUQ88THmlkf3DW0W6wL2mUZW5Sp9gkMFWxvt2OpppfyNs2YHI%2B2C%2Ftbi5YMd%2BCv5q6K300H7lsatLWwQEkE6kv1YXLLis4zt4NUw58qFrTss5O%2B%2FnahobycDwpibwG%2B%2Bj8LZ5Hn3HJgTc8sQFNyhu%2Bm6M2RUolopnAvcJu%2BWCVgM%2Fz3fr0O7l1u%2FZ1cd64SuOKVm%2FvCNIDddFrgZNW0gbMjAVxwlS11mmQuiIowAqFlf6d16f7t1yrCXjHYPZyTEqdNhTNpycb1IGseu6FoaXpJquvoB4nZrnPvn0qe7P1xPdyHVfNXh224r8jd4NDdC0jCDVDJlJD8ilWZKXe6%2Fb5sNQIoJqw5tWlPbv5gbq%2FC%2BdpTM%2BJMKdeeAPfLpHN%2FpirKMAKcbKuW6wydhGa7aa%2BRk6SnCsySeIvixE2%2Fet4FPn%2BRvEQVFVNg2M1L4tkPkpFW6bdA%3D%3D=333265065400e9f0e246d5364032ab0e55b879590ef8
>  
> - they seem fairly tough little things to be honest and can seemingly 
> withstand lots of abuse - (I must have changed every wire ((not power pins 
> of course)) in my experimentation's).
>
>
> Using RPi 3 board - using this image 
> https://downloads.raspberrypi.org/raspbian/images/raspbian-2018-11-15/. 
> Its not the latest - I prefer something tried and tested and sort of bug 
> free. NOTE - once the image is burnt to sdcard (
> https://www.balena.io/etcher/ makes prepping sdcards a cup of tea - DONT 
> buy cheap sdcards, they will make the system crawl like a snail), eject 
> card, then reinsert to the same MAC/WIN PC you just prepped card on, then 
> add a little file called ssh (make with a text editor) with no extension 
> (so thats no full stop after ssh file name - just a file called ssh) to the 
> bootable partition (the partition you see when you insert this rpi OS ready 
> sdcard into a MAC/WIN machine). This enables ssh access as default. I dont 
> use a desktop on the pi, just ssh.
>
> Put new 

[weewx-user] Re: AS3935 Lightening Detector

2019-09-14 Thread dan Forster




Sorry I have not been about and replying to board messages. Started some 
DIY project which turned out larger than expected...

This is how I got my AS3935 to work in Weewx. It may not bee 100% correct, 
but it is now working on two pi's really well. Note if you think you are 
going to run this on 6" pieces of cable, so its close to the pi, indoors, 
next to all your gizzmos, the lightning will bite your bum for this thing 
sees it. Its best run in a low noise environment (away from power supplies, 
cheap LED lights, computer screens, etc). From what I can gather, its a 
500khz receiver and some clever logic, so like any radio, it likes to be 
able to see the sky. I will start from scratch so you can get going from a 
new pi sdcard/AS3935 board

This is the detection board I use - 
https://www.ebay.co.uk/itm/AS3935-Lightning-Strike-Storm-Distances-Detector-I2C-SPI-Sensor-Programmable/333265065400?_trkparms=ispr%3D1=item4d982555b8:g:VWUAAOSw1NNdKCt2=AQAEAAAB4BPxNw%2BVj6nta7CKEs3N0qX6knsPaWu2HyFk9u1VHKBpz81ghsTUEAWuMAkGOyv6nDm%2FfHF6ZNRVWUmyw6fMizGZ%2BYp4db2m9KpEC601RxylniwLIMm1Yna7V1VtB3WNTdeLsrOFmUXb8ykzBxZK2B3hLzfgKkhHP80k%2BXuEpKA7AgDyaSN%2FJluRWLSOUQ88THmlkf3DW0W6wL2mUZW5Sp9gkMFWxvt2OpppfyNs2YHI%2B2C%2Ftbi5YMd%2BCv5q6K300H7lsatLWwQEkE6kv1YXLLis4zt4NUw58qFrTss5O%2B%2FnahobycDwpibwG%2B%2Bj8LZ5Hn3HJgTc8sQFNyhu%2Bm6M2RUolopnAvcJu%2BWCVgM%2Fz3fr0O7l1u%2FZ1cd64SuOKVm%2FvCNIDddFrgZNW0gbMjAVxwlS11mmQuiIowAqFlf6d16f7t1yrCXjHYPZyTEqdNhTNpycb1IGseu6FoaXpJquvoB4nZrnPvn0qe7P1xPdyHVfNXh224r8jd4NDdC0jCDVDJlJD8ilWZKXe6%2Fb5sNQIoJqw5tWlPbv5gbq%2FC%2BdpTM%2BJMKdeeAPfLpHN%2FpirKMAKcbKuW6wydhGa7aa%2BRk6SnCsySeIvixE2%2Fet4FPn%2BRvEQVFVNg2M1L4tkPkpFW6bdA%3D%3D=333265065400e9f0e246d5364032ab0e55b879590ef8
 
- they seem fairly tough little things to be honest and can seemingly 
withstand lots of abuse - (I must have changed every wire ((not power pins 
of course)) in my experimentation's).


Using RPi 3 board - using this image 
https://downloads.raspberrypi.org/raspbian/images/raspbian-2018-11-15/. Its 
not the latest - I prefer something tried and tested and sort of bug free. 
NOTE - once the image is burnt to sdcard (https://www.balena.io/etcher/ 
makes prepping sdcards a cup of tea - DONT buy cheap sdcards, they will 
make the system crawl like a snail), eject card, then reinsert to the same 
MAC/WIN PC you just prepped card on, then add a little file called ssh 
(make with a text editor) with no extension (so thats no full stop after 
ssh file name - just a file called ssh) to the bootable partition (the 
partition you see when you insert this rpi OS ready sdcard into a MAC/WIN 
machine). This enables ssh access as default. I dont use a desktop on the 
pi, just ssh.

Put new card in pi - boot - log in via ssh

run sudo rpi- config = enable IC2 and expand filesystem, change your locale 
and give the pi a hostname that makes sense (then it can be any IP it wants 
to be, you can easily look up on your LAN using hostname - easier to 
remember than IP addresses. Reboot pi.

Update the pi when its rebooted (sudo apt-get update - and sudo apt-get 
upgrade). I also change the default pi password, just to be safe (note to 
use this new password when you reboot pi!).

Reboot pi - ssh in (I run everything from my home pi directory unless 
otherwise stated)

Install apache2 -  sudo apt-get install apache2 -y  (I like this to be on 
the pi so weewx sees it on install).

Install weewx as follows (or any other way that you like, this adds the 
repository to the pi so updating and installation is real easy).

wget -qO - http://weewx.com/keys.html | sudo apt-key add -
wget -qO - http://weewx.com/apt/weewx.list | sudo te e 
/etc/apt/sources.list.d/weewx.list
sudo apt-get update
sudo apt-get install weewx

Now when you do a sudo apt-get update/upgrade, weewx gets updated too.

Power down you pi

Wire up your as3935 module (earth yourself first for a few seconds, the 
little pcb is static sensitive).

Board VDD = 3.0VDC - PIN # 1 - RED
Board GND = Ground - PIN # 6 - BLACK
Board SCK/SCL = SCL - PIN # 5 - GPIO 3 - WHITE
Board MOSI/SDA = SDA - PIN # 3 - GPIO 2 - GREEN
Board IRQ = Pin #11 - GPIO 17 - YELLOW
Board SI = 3.0VDC - Pin #17 for i2c - RED
Board A0 and A1 = 3.0VDC - Pin #17

I use a soldering iron to make the last 3 connections above to pin #17 
(modify some push on connections with the soldering iron rather than solder 
anything directly to the pi) - ditto push on connections for the AS3935 
board.

The reason to put 3V on A0 and A1 is to give it an address that can read by 
by ic2-tools.

Power up your pi and ssh in.

Type - sudo apt-get install i2c-tools

Type i2cdetect -y 1

You should now see the module show up as address 03 (if you don't use the 
address pins of the module A0 and A1 - you leave then unconnected for 
instance - the module will have an address that wont show on ic2detect).

I then install the python library using - sudo pip install RPi_AS3935 this 
makes the module directly accessible by python.

I then install 

[weewx-user] Re: AS3935 Lightening Detector

2019-09-05 Thread J D
Hi,
They are really all the same. I have a number of them. The two I am 
currently using together are
https://www.playingwithfusion.com/productview.php?pdid=22
https://www.mikroe.com/thunder-click

And a third one standalone as a control on its own pi.
https://shop.switchdoc.com/products/the-thunder-board-i2c-lightning-detector-grove-connectors

If your's works most of the time then making the code change would be the 
easiest. Also note some of the I2C devices do not play well with other I2C 
devices. That is why I am using the thunder-click since it uses the SPI 
bus. I had to modify the python code to support SPI bus since all I found 
was I2C bus code.
Good Luck
Jerry

On Thursday, September 5, 2019 at 6:02:54 AM UTC-7, Mikael Fredriksson 
wrote:
>
> Hi Jerry!
>
> Thank you for your answer.
> I've tried changing all wires and looked for any bad connections. But no 
> success.
> I guess it's a faulty sensor so I will buy another one and see if i'm 
> lucky with that.
> The sensor I used is a CJMCU AS3935.
> Is there another recommended sensor to use with Weewx? Or are they almost 
> all the same?
>
> /Mikael
>
> Den söndag 1 september 2019 kl. 17:21:07 UTC+2 skrev J D:
>>
>> Hi,
>> I have seen this a number of times with these sensors, what I have done 
>> is the following to make it less of an issue
>> Checking for loose wires or wires not making good contact at either the 
>> GPIO pins or the device..
>> Power cycle the system.
>> Replacing the device.
>> Making sure there are no other devices with the same bus and address 
>> being used
>> Putting a while loop with a fixed loop count and a try except around the 
>> i2cbus read and sleeping for a second or two before trying the read again.. 
>> (This is the best solution and if it is still failing after 10-20 seconds 
>> of trying then there is probably a hardware failure most likely the device 
>> or a loose connection.
>> Thanks Jerry
>>
>> On Sunday, September 1, 2019 at 4:24:17 AM UTC-7, Mikael Fredriksson 
>> wrote:
>>>
>>> Hi!
>>>
>>> Got a new issue with my as3935.
>>> Running weewx 3.9.1
>>>
>>>
>>> Got this in my log when starting weewx:
>>>
>>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Debug is 1
>>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Initializing engine
>>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading station type 
>>> FineOffsetUSB (weewx.drivers.fousb)
>>> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: driver version is 1.9
>>> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: polling mode is PERIODIC
>>> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: polling interval is 60
>>> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: found station on USB bus= 
>>> device=
>>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading service 
>>> weewx.engine.StdTimeSynch
>>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Finished loading service 
>>> weewx.engine.StdTimeSynch
>>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading service 
>>> user.as3935.AS3935
>>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: service version is 0.6
>>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: address=0x03
>>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: bus=1
>>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: indoors=False
>>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: noise_floor=0
>>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: calibration=0x06
>>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: pin=17
>>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: data_binding=None
>>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: binding=archive
>>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Caught unrecoverable 
>>> exception in engine:
>>> Sep  1 11:42:05 raspberrypi weewx[570]:   [Errno 121] I/O-fel på 
>>> fjärrmaskin
>>> Sep  1 11:42:05 raspberrypi weewx[570]:   Traceback (most recent 
>>> call last):
>>> Sep  1 11:42:05 raspberrypi weewx[570]: File 
>>> "/usr/share/weewx/weewx/engine.py", line 884, in main
>>> Sep  1 11:42:05 raspberrypi weewx[570]:   engine = 
>>> engine_class(config_dict)
>>> Sep  1 11:42:05 raspberrypi weewx[570]: File 
>>> "/usr/share/weewx/weewx/engine.py", line 78, in __init__
>>> Sep  1 11:42:05 raspberrypi weewx[570]:   
>>> self.loadServices(config_dict)
>>> Sep  1 11:42:05 raspberrypi weewx[570]: File 
>>> "/usr/share/weewx/weewx/engine.py", line 142, in loadServices
>>> Sep  1 11:42:05 raspberrypi weewx[570]:   
>>> self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
>>> Sep  1 11:42:05 raspberrypi weewx[570]: File 
>>> "/usr/share/weewx/user/as3935.py", line 154, in __init__
>>> Sep  1 11:42:05 raspberrypi weewx[570]:   
>>> self.sensor.set_indoors(indoors)
>>> Sep  1 11:42:05 raspberrypi weewx[570]: File 
>>> "/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 
>>> 162, in set_indoors
>>> Sep  1 11:42:05 

[weewx-user] Re: AS3935 Lightening Detector

2019-09-05 Thread Mikael Fredriksson
Hi Jerry!

Thank you for your answer.
I've tried changing all wires and looked for any bad connections. But no 
success.
I guess it's a faulty sensor so I will buy another one and see if i'm lucky 
with that.
The sensor I used is a CJMCU AS3935.
Is there another recommended sensor to use with Weewx? Or are they almost 
all the same?

/Mikael

Den söndag 1 september 2019 kl. 17:21:07 UTC+2 skrev J D:
>
> Hi,
> I have seen this a number of times with these sensors, what I have done is 
> the following to make it less of an issue
> Checking for loose wires or wires not making good contact at either the 
> GPIO pins or the device..
> Power cycle the system.
> Replacing the device.
> Making sure there are no other devices with the same bus and address being 
> used
> Putting a while loop with a fixed loop count and a try except around the 
> i2cbus read and sleeping for a second or two before trying the read again.. 
> (This is the best solution and if it is still failing after 10-20 seconds 
> of trying then there is probably a hardware failure most likely the device 
> or a loose connection.
> Thanks Jerry
>
> On Sunday, September 1, 2019 at 4:24:17 AM UTC-7, Mikael Fredriksson wrote:
>>
>> Hi!
>>
>> Got a new issue with my as3935.
>> Running weewx 3.9.1
>>
>>
>> Got this in my log when starting weewx:
>>
>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Debug is 1
>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Initializing engine
>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading station type 
>> FineOffsetUSB (weewx.drivers.fousb)
>> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: driver version is 1.9
>> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: polling mode is PERIODIC
>> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: polling interval is 60
>> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: found station on USB bus= 
>> device=
>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading service 
>> weewx.engine.StdTimeSynch
>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Finished loading service 
>> weewx.engine.StdTimeSynch
>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading service 
>> user.as3935.AS3935
>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: service version is 0.6
>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: address=0x03
>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: bus=1
>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: indoors=False
>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: noise_floor=0
>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: calibration=0x06
>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: pin=17
>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: data_binding=None
>> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: binding=archive
>> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Caught unrecoverable 
>> exception in engine:
>> Sep  1 11:42:05 raspberrypi weewx[570]:   [Errno 121] I/O-fel på 
>> fjärrmaskin
>> Sep  1 11:42:05 raspberrypi weewx[570]:   Traceback (most recent 
>> call last):
>> Sep  1 11:42:05 raspberrypi weewx[570]: File 
>> "/usr/share/weewx/weewx/engine.py", line 884, in main
>> Sep  1 11:42:05 raspberrypi weewx[570]:   engine = 
>> engine_class(config_dict)
>> Sep  1 11:42:05 raspberrypi weewx[570]: File 
>> "/usr/share/weewx/weewx/engine.py", line 78, in __init__
>> Sep  1 11:42:05 raspberrypi weewx[570]:   
>> self.loadServices(config_dict)
>> Sep  1 11:42:05 raspberrypi weewx[570]: File 
>> "/usr/share/weewx/weewx/engine.py", line 142, in loadServices
>> Sep  1 11:42:05 raspberrypi weewx[570]:   
>> self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
>> Sep  1 11:42:05 raspberrypi weewx[570]: File 
>> "/usr/share/weewx/user/as3935.py", line 154, in __init__
>> Sep  1 11:42:05 raspberrypi weewx[570]:   
>> self.sensor.set_indoors(indoors)
>> Sep  1 11:42:05 raspberrypi weewx[570]: File 
>> "/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 
>> 162, in set_indoors
>> Sep  1 11:42:05 raspberrypi weewx[570]:   self.read_data()
>> Sep  1 11:42:05 raspberrypi weewx[570]: File 
>> "/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 
>> 234, in read_data
>> Sep  1 11:42:05 raspberrypi weewx[570]:   self.registers = 
>> self.i2cbus.read_i2c_block_data(self.address, 0x00)
>> Sep  1 11:42:05 raspberrypi weewx[570]:   IOError: [Errno 121] 
>> I/O-fel på fjärrmaskin
>> Sep  1 11:42:05 raspberrypi weewx[570]:   Exiting.
>> Sep  1 11:44:34 raspberrypi systemd[1]: Stopping LSB: weewx weather 
>> system...
>>
>> Haven´t changed anything and suddenly I got an I/O error on the machine.
>>
>> If I run "sudo i2cdetect -y 1" several times in a row I sometimes get 
>> 0x03 but every other time I just get --.
>>
>>
>> Any clue what this could be or how to debug?
>>
>> Got it connected to my 

[weewx-user] Re: AS3935 Lightening Detector

2019-09-01 Thread J D
Hi,
I have seen this a number of times with these sensors, what I have done is 
the following to make it less of an issue
Checking for loose wires or wires not making good contact at either the 
GPIO pins or the device..
Power cycle the system.
Replacing the device.
Making sure there are no other devices with the same bus and address being 
used
Putting a while loop with a fixed loop count and a try except around the 
i2cbus read and sleeping for a second or two before trying the read again.. 
(This is the best solution and if it is still failing after 10-20 seconds 
of trying then there is probably a hardware failure most likely the device 
or a loose connection.
Thanks Jerry

On Sunday, September 1, 2019 at 4:24:17 AM UTC-7, Mikael Fredriksson wrote:
>
> Hi!
>
> Got a new issue with my as3935.
> Running weewx 3.9.1
>
>
> Got this in my log when starting weewx:
>
> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Debug is 1
> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Initializing engine
> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading station type 
> FineOffsetUSB (weewx.drivers.fousb)
> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: driver version is 1.9
> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: polling mode is PERIODIC
> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: polling interval is 60
> Sep  1 11:42:05 raspberrypi weewx[570]: fousb: found station on USB bus= 
> device=
> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading service 
> weewx.engine.StdTimeSynch
> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Finished loading service 
> weewx.engine.StdTimeSynch
> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading service 
> user.as3935.AS3935
> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: service version is 0.6
> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: address=0x03
> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: bus=1
> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: indoors=False
> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: noise_floor=0
> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: calibration=0x06
> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: pin=17
> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: data_binding=None
> Sep  1 11:42:05 raspberrypi weewx[570]: as3935: binding=archive
> Sep  1 11:42:05 raspberrypi weewx[570]: engine: Caught unrecoverable 
> exception in engine:
> Sep  1 11:42:05 raspberrypi weewx[570]:   [Errno 121] I/O-fel på 
> fjärrmaskin
> Sep  1 11:42:05 raspberrypi weewx[570]:   Traceback (most recent 
> call last):
> Sep  1 11:42:05 raspberrypi weewx[570]: File 
> "/usr/share/weewx/weewx/engine.py", line 884, in main
> Sep  1 11:42:05 raspberrypi weewx[570]:   engine = 
> engine_class(config_dict)
> Sep  1 11:42:05 raspberrypi weewx[570]: File 
> "/usr/share/weewx/weewx/engine.py", line 78, in __init__
> Sep  1 11:42:05 raspberrypi weewx[570]:   
> self.loadServices(config_dict)
> Sep  1 11:42:05 raspberrypi weewx[570]: File 
> "/usr/share/weewx/weewx/engine.py", line 142, in loadServices
> Sep  1 11:42:05 raspberrypi weewx[570]:   
> self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
> Sep  1 11:42:05 raspberrypi weewx[570]: File 
> "/usr/share/weewx/user/as3935.py", line 154, in __init__
> Sep  1 11:42:05 raspberrypi weewx[570]:   
> self.sensor.set_indoors(indoors)
> Sep  1 11:42:05 raspberrypi weewx[570]: File 
> "/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 
> 162, in set_indoors
> Sep  1 11:42:05 raspberrypi weewx[570]:   self.read_data()
> Sep  1 11:42:05 raspberrypi weewx[570]: File 
> "/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 
> 234, in read_data
> Sep  1 11:42:05 raspberrypi weewx[570]:   self.registers = 
> self.i2cbus.read_i2c_block_data(self.address, 0x00)
> Sep  1 11:42:05 raspberrypi weewx[570]:   IOError: [Errno 121] 
> I/O-fel på fjärrmaskin
> Sep  1 11:42:05 raspberrypi weewx[570]:   Exiting.
> Sep  1 11:44:34 raspberrypi systemd[1]: Stopping LSB: weewx weather 
> system...
>
> Haven´t changed anything and suddenly I got an I/O error on the machine.
>
> If I run "sudo i2cdetect -y 1" several times in a row I sometimes get 0x03 
> but every other time I just get --.
>
>
> Any clue what this could be or how to debug?
>
> Got it connected to my raspberry pi like this:
>
>   VCC -> 3.3V
> GND -> GND
> SCL -> PIN 5
> MOSI -> PIN 3
> SI -> 3.3V
> IRQ -> PIN 11
> A0 -> 3.3V
> A1 -> 3.3V
>
>
> /Mikael
>
> Den måndag 8 juli 2019 kl. 10:48:22 UTC+2 skrev dan Forster:
>>
>> Hi,
>>
>> I bought one of these from eBay  - *MA5532 AS3935 2.4V to 5.5V Lightning 
>> Fulmine Sensor Breakout SPI/I2C Antenna*. I have connected it all up and 
>> have it working fine, confirmed by using the demo script and install 

[weewx-user] Re: AS3935 Lightening Detector

2019-09-01 Thread Mikael Fredriksson
Hi!

Got a new issue with my as3935.
Running weewx 3.9.1


Got this in my log when starting weewx:

Sep  1 11:42:05 raspberrypi weewx[570]: engine: Debug is 1
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Initializing engine
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading station type 
FineOffsetUSB (weewx.drivers.fousb)
Sep  1 11:42:05 raspberrypi weewx[570]: fousb: driver version is 1.9
Sep  1 11:42:05 raspberrypi weewx[570]: fousb: polling mode is PERIODIC
Sep  1 11:42:05 raspberrypi weewx[570]: fousb: polling interval is 60
Sep  1 11:42:05 raspberrypi weewx[570]: fousb: found station on USB bus= 
device=
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading service 
weewx.engine.StdTimeSynch
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Finished loading service 
weewx.engine.StdTimeSynch
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading service 
user.as3935.AS3935
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: service version is 0.6
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: address=0x03
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: bus=1
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: indoors=False
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: noise_floor=0
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: calibration=0x06
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: pin=17
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: data_binding=None
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: binding=archive
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Caught unrecoverable 
exception in engine:
Sep  1 11:42:05 raspberrypi weewx[570]:   [Errno 121] I/O-fel på 
fjärrmaskin
Sep  1 11:42:05 raspberrypi weewx[570]:   Traceback (most recent 
call last):
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/share/weewx/weewx/engine.py", line 884, in main
Sep  1 11:42:05 raspberrypi weewx[570]:   engine = 
engine_class(config_dict)
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/share/weewx/weewx/engine.py", line 78, in __init__
Sep  1 11:42:05 raspberrypi weewx[570]:   
self.loadServices(config_dict)
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/share/weewx/weewx/engine.py", line 142, in loadServices
Sep  1 11:42:05 raspberrypi weewx[570]:   
self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/share/weewx/user/as3935.py", line 154, in __init__
Sep  1 11:42:05 raspberrypi weewx[570]:   
self.sensor.set_indoors(indoors)
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 
162, in set_indoors
Sep  1 11:42:05 raspberrypi weewx[570]:   self.read_data()
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 
234, in read_data
Sep  1 11:42:05 raspberrypi weewx[570]:   self.registers = 
self.i2cbus.read_i2c_block_data(self.address, 0x00)
Sep  1 11:42:05 raspberrypi weewx[570]:   IOError: [Errno 121] 
I/O-fel på fjärrmaskin
Sep  1 11:42:05 raspberrypi weewx[570]:   Exiting.
Sep  1 11:44:34 raspberrypi systemd[1]: Stopping LSB: weewx weather 
system...

Haven´t changed anything and suddenly I got an I/O error on the machine.

If I run "sudo i2cdetect -y 1" several times in a row I sometimes get 0x03 
but every other time I just get --.


Any clue what this could be or how to debug?

Got it connected to my raspberry pi like this:

  VCC -> 3.3V
GND -> GND
SCL -> PIN 5
MOSI -> PIN 3
SI -> 3.3V
IRQ -> PIN 11
A0 -> 3.3V
A1 -> 3.3V


/Mikael

Den måndag 8 juli 2019 kl. 10:48:22 UTC+2 skrev dan Forster:
>
> Hi,
>
> I bought one of these from eBay  - *MA5532 AS3935 2.4V to 5.5V Lightning 
> Fulmine Sensor Breakout SPI/I2C Antenna*. I have connected it all up and 
> have it working fine, confirmed by using the demo script and install 
> instructions supplied here *https://github.com/pcfens/RaspberryPi-AS3935 
> .* I can see that a few 
> people had problems connecting the module, so I have attached a picture of 
> how I have wired to get it working perfectly (note one address line has to 
> be set to common ground and the address is 00x0 *NOT 00x3)*.
>
> I then followed these instructions 
> *https://github.com/weewx/weewx/wiki/as3935 
> * in order that it can be 
> used within my weewx weather station. I have managed to do everything as it 
> says on this page, including the part at the bottom of the page with 
> regards to the extra sqlite database holding the lightening detector data 
> (which I confirmed exists in the same place as the weewx db).
>
>  
>
> Now I am using the Seasons skin and would like to get help on adding the 
> two new lightening detector values 

[weewx-user] Re: AS3935 Lightening Detector

2019-09-01 Thread Mikael Fredriksson
Hi!

Got a new issue.

Got this in my log when starting weewx:

Sep  1 11:42:05 raspberrypi weewx[570]: engine: Debug is 1
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Initializing engine
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading station type 
FineOffsetUSB (weewx.drivers.fousb)
Sep  1 11:42:05 raspberrypi weewx[570]: fousb: driver version is 1.9
Sep  1 11:42:05 raspberrypi weewx[570]: fousb: polling mode is PERIODIC
Sep  1 11:42:05 raspberrypi weewx[570]: fousb: polling interval is 60
Sep  1 11:42:05 raspberrypi weewx[570]: fousb: found station on USB bus= 
device=
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading service 
weewx.engine.StdTimeSynch
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Finished loading service 
weewx.engine.StdTimeSynch
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Loading service 
user.as3935.AS3935
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: service version is 0.6
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: address=0x03
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: bus=1
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: indoors=False
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: noise_floor=0
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: calibration=0x06
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: pin=17
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: data_binding=None
Sep  1 11:42:05 raspberrypi weewx[570]: as3935: binding=archive
Sep  1 11:42:05 raspberrypi weewx[570]: engine: Caught unrecoverable 
exception in engine:
Sep  1 11:42:05 raspberrypi weewx[570]:   [Errno 121] I/O-fel på 
fjärrmaskin
Sep  1 11:42:05 raspberrypi weewx[570]:   Traceback (most recent 
call last):
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/share/weewx/weewx/engine.py", line 884, in main
Sep  1 11:42:05 raspberrypi weewx[570]:   engine = 
engine_class(config_dict)
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/share/weewx/weewx/engine.py", line 78, in __init__
Sep  1 11:42:05 raspberrypi weewx[570]:   
self.loadServices(config_dict)
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/share/weewx/weewx/engine.py", line 142, in loadServices
Sep  1 11:42:05 raspberrypi weewx[570]:   
self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/share/weewx/user/as3935.py", line 154, in __init__
Sep  1 11:42:05 raspberrypi weewx[570]:   
self.sensor.set_indoors(indoors)
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 
162, in set_indoors
Sep  1 11:42:05 raspberrypi weewx[570]:   self.read_data()
Sep  1 11:42:05 raspberrypi weewx[570]: File 
"/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 
234, in read_data
Sep  1 11:42:05 raspberrypi weewx[570]:   self.registers = 
self.i2cbus.read_i2c_block_data(self.address, 0x00)
Sep  1 11:42:05 raspberrypi weewx[570]:   IOError: [Errno 121] 
I/O-fel på fjärrmaskin
Sep  1 11:42:05 raspberrypi weewx[570]:   Exiting.
Sep  1 11:44:34 raspberrypi systemd[1]: Stopping LSB: weewx weather 
system...

Haven´t changed anything and suddenly I got an I/O error on the machine.

Any clue what this could be or how to debug?

Got it connected to my raspberry pi like this:

  VCC -> 3.3V
GND -> GND
SCL -> PIN 5
MOSI -> PIN 3
SI -> 3.3V

A0 -> 3.3V
A1 -> 3.3V


Den måndag 8 juli 2019 kl. 10:48:22 UTC+2 skrev dan Forster:
>
> Hi,
>
> I bought one of these from eBay  - *MA5532 AS3935 2.4V to 5.5V Lightning 
> Fulmine Sensor Breakout SPI/I2C Antenna*. I have connected it all up and 
> have it working fine, confirmed by using the demo script and install 
> instructions supplied here *https://github.com/pcfens/RaspberryPi-AS3935 
> .* I can see that a few 
> people had problems connecting the module, so I have attached a picture of 
> how I have wired to get it working perfectly (note one address line has to 
> be set to common ground and the address is 00x0 *NOT 00x3)*.
>
> I then followed these instructions 
> *https://github.com/weewx/weewx/wiki/as3935 
> * in order that it can be 
> used within my weewx weather station. I have managed to do everything as it 
> says on this page, including the part at the bottom of the page with 
> regards to the extra sqlite database holding the lightening detector data 
> (which I confirmed exists in the same place as the weewx db).
>
>  
>
> Now I am using the Seasons skin and would like to get help on adding the 
> two new lightening detector values (lightning_strikes and avg_distance)into 
> the Seasons skin web page (at the bottom of the Current Conditions list). I 
> think the file I need to alter is 

[weewx-user] Re: AS3935 Lightening Detector

2019-08-24 Thread J D
Hi,
I have this one and I know many others also do. They all "work" about the 
same, biggest difference is the Tune Cap value.  For the most part these 
devices are "toys" meaning that I would not tie any critical responses to 
what these sensors report. Also there is plenty of software for using these 
sensors but even there are a number of "flaws" in what the software does 
and what the data sheets try to explain. I use multiple sensors from 
different vendors so I can cross check the responses and decrease the 
number of incorrect responses. Also the Tune Cap changes with temperature 
so if you are using them outside then is best you auto tune them at 
different times of the day.
Thanks Jerry

On Saturday, August 24, 2019 at 10:02:37 AM UTC-7, Steve2Q wrote:
>
> Dan..do you think that this one works the same? 
> https://www.ebay.com/itm/AS3935-Digital-Lightning-Sensor-Breakout-3V-5V-Arduino-RPi-compatible-/233228596198
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/6813e387-6ebf-46d7-9838-9e799e73fe66%40googlegroups.com.


[weewx-user] Re: AS3935 Lightening Detector

2019-08-24 Thread Steve2Q
Dan..do you think that this one works the same? 
https://www.ebay.com/itm/AS3935-Digital-Lightning-Sensor-Breakout-3V-5V-Arduino-RPi-compatible-/233228596198

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/f5f920cb-3a90-49d4-b003-190de76a15c7%40googlegroups.com.


[weewx-user] Re: AS3935 Lightening Detector

2019-08-10 Thread Ian Rich
Hi Dan, you are a lifesaver! - I bought this exact model and have spent 
days trying to dig out information about how wire it for IC2 correctly.

In fact I had thrown it in the back of the drawer and bought a different 
type with which I have had more success. - I just wired exactly as you 
detailed and it works like a charm :)
I now have a backup unit for my dev/test weewx box.

Many thanks for providing this information! 

Kind regards,

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/10eb100a-da52-4418-8bd7-fc9e4319d358%40googlegroups.com.


[weewx-user] Re: AS3935 Lightening Detector

2019-07-10 Thread Mikael Fredriksson
Dan,

thanks for your answer!

I now have the AS3935 running and sending data to my database. Working on 
other issues, wrote about them in my post "AS3935 database issue"
Planning on moving it outside because of the interference with things 
inside the house,

Mikael

Den tisdag 9 juli 2019 kl. 10:44:32 UTC+2 skrev dan Forster:
>
> Mikael,
>
>  
>
> The two pads A0 and A1 are for setting the base address and are not 
> allowed to float (not documented very well so this stumped me for ages). 
> Your setup is exactly (all be it with a different base address) the same as 
> mine by the looks of things.
>
>  
>
> When you stop and then restart start weewx using: -
>
>  
>
> *sudo /etc/init.d/weewx stop*
>
> *sudo /etc/init.d/weewx start*
>
>  
>
> and then issue this command quickly: -
>
>  
>
> *tail -f /var/log/syslog*
>
>  
>
> you should see the AS3935 load and adjust itself for noise. Bear in mind 
> where you are using this board, it is sensitive to noise around 500khz, 
> which can occur many places inside a house (bad and cheap LED lamps are 
> very noisy). If you can use outside in a weatherproof housing you would 
> experience less interference (Google about long cables from the board to 
> your PC, this needs to be done correctly too).
>
>  
>
> Take care
>
>  
>
> Dan.
>
>
> On Monday, 8 July 2019 19:53:04 UTC+1, Mikael Fredriksson wrote:
>>
>> Hi!
>>
>> I have another issue with this setup, but that´s in another question. 
>>
>> I saw your connections and they differ from mine quite much so I wonder 
>> which one is correct?! 
>>
>> I´ve been told to connect like this:
>>
>> VCC -> 3,3V
>> GND -> GND
>> SCL -> PIN 5
>> MOSI -> PIN 3
>> SI -> 3,3V
>> A0 -> 3,3V
>> A1 -> 3,3V
>>
>> And I got respones when running demo.py
>> And also in syslog weewx seeing lightning or maybe its something that 
>> looks like lightning. But it seems to react to something anyway.
>> You can read about my database issue in my own question, and if you have 
>> some answer to that it would be great! 
>> I´m not very good at linux so there is much trail :)
>> I hope someone can help you with your question!
>>
>> Den måndag 8 juli 2019 kl. 10:48:22 UTC+2 skrev dan Forster:
>>>
>>> Hi,
>>>
>>> I bought one of these from eBay  - *MA5532 AS3935 2.4V to 5.5V 
>>> Lightning Fulmine Sensor Breakout SPI/I2C Antenna*. I have connected it 
>>> all up and have it working fine, confirmed by using the demo script and 
>>> install instructions supplied here 
>>> *https://github.com/pcfens/RaspberryPi-AS3935 
>>> .* I can see that a few 
>>> people had problems connecting the module, so I have attached a picture of 
>>> how I have wired to get it working perfectly (note one address line has to 
>>> be set to common ground and the address is 00x0 *NOT 00x3)*.
>>>
>>> I then followed these instructions 
>>> *https://github.com/weewx/weewx/wiki/as3935 
>>> * in order that it can be 
>>> used within my weewx weather station. I have managed to do everything as it 
>>> says on this page, including the part at the bottom of the page with 
>>> regards to the extra sqlite database holding the lightening detector data 
>>> (which I confirmed exists in the same place as the weewx db).
>>>
>>>  
>>>
>>> Now I am using the Seasons skin and would like to get help on adding the 
>>> two new lightening detector values (lightning_strikes and avg_distance)into 
>>> the Seasons skin web page (at the bottom of the Current Conditions list). I 
>>> think the file I need to alter is /etc/weewx/skins/Seasons/current.inc.
>>>
>>>  
>>>
>>> I am OK with electronics and getting better at Linux, but I am terrible 
>>> at HTML. Any pointers would be greatly appreciated...
>>>
>>>  
>>>
>>> Dan
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/02b9a6e1-dae0-4b6e-b9b3-b64f15495af6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: AS3935 Lightening Detector

2019-07-10 Thread dan Forster
Cheers Gary, I didnt think to do this... Dan

On Tuesday, 9 July 2019 22:31:31 UTC+1, gjr80 wrote:
>
> > and then issue this command quickly: - 
> > 
> > tail -f /var/log/syslog 
>
> You can also open a second (or third or fourth etc) terminal window and 
> run tail -f in that terminal; much easier to monitor what is going on and 
> you don’t miss the first so many lines. 
>
> Gary

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/ad540899-35b7-4eda-a74c-0b24af7c0f36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: AS3935 Lightening Detector

2019-07-09 Thread gjr80
> and then issue this command quickly: -
>
> tail -f /var/log/syslog

You can also open a second (or third or fourth etc) terminal window and run 
tail -f in that terminal; much easier to monitor what is going on and you don’t 
miss the first so many lines.

Gary

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/aa53fd40-6b7b-409b-b8e5-9edbf8b0f8dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: AS3935 Lightening Detector

2019-07-09 Thread dan Forster
 

Mikael,

 

The two pads A0 and A1 are for setting the base address and are not allowed 
to float (not documented very well so this stumped me for ages). Your setup 
is exactly (all be it with a different base address) the same as mine by 
the looks of things.

 

When you stop and then restart start weewx using: -

 

*sudo /etc/init.d/weewx stop*

*sudo /etc/init.d/weewx start*

 

and then issue this command quickly: -

 

*tail -f /var/log/syslog*

 

you should see the AS3935 load and adjust itself for noise. Bear in mind 
where you are using this board, it is sensitive to noise around 500khz, 
which can occur many places inside a house (bad and cheap LED lamps are 
very noisy). If you can use outside in a weatherproof housing you would 
experience less interference (Google about long cables from the board to 
your PC, this needs to be done correctly too).

 

Take care

 

Dan.


On Monday, 8 July 2019 19:53:04 UTC+1, Mikael Fredriksson wrote:
>
> Hi!
>
> I have another issue with this setup, but that´s in another question. 
>
> I saw your connections and they differ from mine quite much so I wonder 
> which one is correct?! 
>
> I´ve been told to connect like this:
>
> VCC -> 3,3V
> GND -> GND
> SCL -> PIN 5
> MOSI -> PIN 3
> SI -> 3,3V
> A0 -> 3,3V
> A1 -> 3,3V
>
> And I got respones when running demo.py
> And also in syslog weewx seeing lightning or maybe its something that 
> looks like lightning. But it seems to react to something anyway.
> You can read about my database issue in my own question, and if you have 
> some answer to that it would be great! 
> I´m not very good at linux so there is much trail :)
> I hope someone can help you with your question!
>
> Den måndag 8 juli 2019 kl. 10:48:22 UTC+2 skrev dan Forster:
>>
>> Hi,
>>
>> I bought one of these from eBay  - *MA5532 AS3935 2.4V to 5.5V Lightning 
>> Fulmine Sensor Breakout SPI/I2C Antenna*. I have connected it all up and 
>> have it working fine, confirmed by using the demo script and install 
>> instructions supplied here *https://github.com/pcfens/RaspberryPi-AS3935 
>> .* I can see that a few 
>> people had problems connecting the module, so I have attached a picture of 
>> how I have wired to get it working perfectly (note one address line has to 
>> be set to common ground and the address is 00x0 *NOT 00x3)*.
>>
>> I then followed these instructions 
>> *https://github.com/weewx/weewx/wiki/as3935 
>> * in order that it can be 
>> used within my weewx weather station. I have managed to do everything as it 
>> says on this page, including the part at the bottom of the page with 
>> regards to the extra sqlite database holding the lightening detector data 
>> (which I confirmed exists in the same place as the weewx db).
>>
>>  
>>
>> Now I am using the Seasons skin and would like to get help on adding the 
>> two new lightening detector values (lightning_strikes and avg_distance)into 
>> the Seasons skin web page (at the bottom of the Current Conditions list). I 
>> think the file I need to alter is /etc/weewx/skins/Seasons/current.inc.
>>
>>  
>>
>> I am OK with electronics and getting better at Linux, but I am terrible 
>> at HTML. Any pointers would be greatly appreciated...
>>
>>  
>>
>> Dan
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/37aa5f7a-56c0-4b93-90e0-df58e782604d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: AS3935 Lightening Detector

2019-07-08 Thread Mikael Fredriksson
Hi!

I have another issue with this setup, but that´s in another question. 

I saw your connections and they differ from mine quite much so I wonder 
which one is correct?! 

I´ve been told to connect like this:

VCC -> 3,3V
GND -> GND
SCL -> PIN 5
MOSI -> PIN 3
SI -> 3,3V
A0 -> 3,3V
A1 -> 3,3V

And I got respones when running demo.py
And also in syslog weewx seeing lightning or maybe its something that looks 
like lightning. But it seems to react to something anyway.
You can read about my database issue in my own question, and if you have 
some answer to that it would be great! 
I´m not very good at linux so there is much trail :)
I hope someone can help you with your question!

Den måndag 8 juli 2019 kl. 10:48:22 UTC+2 skrev dan Forster:
>
> Hi,
>
> I bought one of these from eBay  - *MA5532 AS3935 2.4V to 5.5V Lightning 
> Fulmine Sensor Breakout SPI/I2C Antenna*. I have connected it all up and 
> have it working fine, confirmed by using the demo script and install 
> instructions supplied here *https://github.com/pcfens/RaspberryPi-AS3935 
> .* I can see that a few 
> people had problems connecting the module, so I have attached a picture of 
> how I have wired to get it working perfectly (note one address line has to 
> be set to common ground and the address is 00x0 *NOT 00x3)*.
>
> I then followed these instructions 
> *https://github.com/weewx/weewx/wiki/as3935 
> * in order that it can be 
> used within my weewx weather station. I have managed to do everything as it 
> says on this page, including the part at the bottom of the page with 
> regards to the extra sqlite database holding the lightening detector data 
> (which I confirmed exists in the same place as the weewx db).
>
>  
>
> Now I am using the Seasons skin and would like to get help on adding the 
> two new lightening detector values (lightning_strikes and avg_distance)into 
> the Seasons skin web page (at the bottom of the Current Conditions list). I 
> think the file I need to alter is /etc/weewx/skins/Seasons/current.inc.
>
>  
>
> I am OK with electronics and getting better at Linux, but I am terrible at 
> HTML. Any pointers would be greatly appreciated...
>
>  
>
> Dan
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/136660ca-b992-45e3-9b6b-e882b3263057%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.