pcfens / RaspberryPi-AS3935

A basic library for working with the AS3935 that's connected to the Raspberry Pi.
Other
52 stars 24 forks source link

Help about new issue raised after latest update #20

Closed Karmagit closed 9 years ago

Karmagit commented 9 years ago

Hope you could help me to better identify the problem. I personalized your python example to receive strike alert notifications and it worked fine from november up to last week when I removed the Vantage Pro2 weather station and installed instead the Envoy console. The Davis side worked fine, but now, a week later I'm realizing that the AS3935 is not working anymore. Now I realized that since I finished the installation it started to try adjusting due to noise level too high nearly continuosly (1800 times in 1h30min!) and then stopped (and I think it was not able anymore to load on RasPi boot). Now if I try to run it from telnet i get the following message:

eusotec@raspberrypi:/home/pi/logs$ sudo /etc/init.d/Run_BlitzS start Starting BlitzSensor eusotec@raspberrypi:/home/pi/logs$ Traceback (most recent call last): File "/usr/local/bin/BlitzSensor.py", line 36, in sensor.calibrate(tun_cap=0x05) File "/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 19, in calibrate self.set_byte(0x08, (self.registers[0x08] & 0xF0) | tun_cap) File "/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 107, in set_byte self.i2cbus.write_byte_data(self.address, register, value) IOError: [Errno 5] Input/output error

if I

sudo i2cdetect -y 1

I see randomly 03 adress popping up, but is not costant

I have also a CO2 sensor collecting CO2 values every hour which is also i2c connected to the raspi and running with a separate python program which is still collecting data in a regular way and was totally unaffected (also in the interval when the AS3935 was continuosly adjusting). So I'm guessing the i2c wiring is still fine.

Maybe I made a also a raspi update/upgrade in that occasion (not sure 100%) which I never made before since the last september installation.

Do you have any idea or suggestion about the cause ot the issue? (I'll be able to check it phisically only next week and I'm missing a very good time of the year for lightnings so any help would be much appreciated!)

Carlo

pcfens commented 9 years ago

Hi Carlo, Assuming 0x03 is the expected address of your sensor:

Karmagit commented 9 years ago

Hi Phil, thank you for your quick answer.

I can’t powercycle it now as it’s in the country.

Everything had been working fine for so many months that I can’t imagine it tied with the actual wiring (2 m).

The problem raised the last time I physically worked with the RasPi to change the Davis weather receiver.

Can you confirm that a problem due to applying updates to the RasPi can be totally excluded?

Anyway updating/upgrading the Pi should not have upgraded your library (or has it?).

As I've seen you made some update (in case I get confirmation my actual version has not updated) what is the best way to update your library to the latest?

pip install RPi_AS3935

on a previous installation will be enough?

Should I change something in my script due to your updates?

Sorry anyway for the very noobish questions and thanks once more for your library!

Carlo

Da: Phil Fenstermacher [mailto:notifications@github.com] Inviato: mercoledì 20 maggio 2015 04:05 A: pcfens/RaspberryPi-AS3935 Cc: Karmagit Oggetto: Re: [RaspberryPi-AS3935] Help about new issue raised after latest update (#20)

Hi Carlo, Assuming 0x03 is the expected address of your sensor:

— Reply to this email directly or view it on GitHub https://github.com/pcfens/RaspberryPi-AS3935/issues/20#issuecomment-103723000 . https://github.com/notifications/beacon/AFX-HxDfpbHn7-znbR-fDmQUpi2fC2EDks5oK-NIgaJpZM4Egy0m.gif

pcfens commented 9 years ago

Since the issue popped up after physically messing with things, and that i2cdetect is showing intermittent failures, I suspect the problem is with either the wiring or connections. The maximum wire length is dependent on wire capacitance. At 2m it's certainly something I would look in to though.

I can't rule out an update to the Pi breaking things, though I think it's very unlikely given the intermittent behavior.

The error that you're getting is at a lower level than the library, and I haven't changed any of the underlying libraries or anything else that should break backwards compatibility. If you'd like to test with an older version you can install it using pip install RPi-AS3935==0.1.0 (valid versions are 0.0.2-0.0.9, 0.1.0, 0.1.1)

Karmagit commented 9 years ago

Thanks again for your precious assistance, this saved me much troubles!

                           installed version resulted being still 0.0.2. Now upgraded to 0.1.1 as it seems this is not the problem and actually (as expected) hasn’t solved.

I tend to exclude i2c issue as it has worked for a long time and now the CO2 sensor (which is also i2c) is currently reporting OK.

I’ll powercycle it, just in case substitute the sensor, and I’ll let you know.

Carlo

Da: Phil Fenstermacher [mailto:notifications@github.com] Inviato: mercoledì 20 maggio 2015 15:14 A: pcfens/RaspberryPi-AS3935 Cc: Karmagit Oggetto: Re: [RaspberryPi-AS3935] Help about new issue raised after latest update (#20)

Since the issue popped up after physically messing with things, and that i2cdetect is showing intermittent failures, I suspect the problem is with either the wiring or connections. The maximum wire length is dependent on wire capacitance. At 2m it's certainly something I would look in to though.

I can't rule out an update to the Pi breaking things, though I think it's very unlikely given the intermittent behavior.

The error that you're getting is at a lower level than the library, and I haven't changed any of the underlying libraries or anything else that should break backwards compatibility. If you'd like to test with an older version you can install it using pip install RPi-AS3935==0.1.0 (valid versions are 0.0.2-0.0.9, 0.1.0, 0.1.1)

— Reply to this email directly or view it on GitHub https://github.com/pcfens/RaspberryPi-AS3935/issues/20#issuecomment-103880370 . https://github.com/notifications/beacon/AFX-HwVpHJXMLEfACqpZPicf7vZHqbNgks5oLIAWgaJpZM4Egy0m.gif

pcfens commented 9 years ago

Try testing it with only one device on the bus too, there's always the chance that another device isn't behaving as expected.

Let us know what you find - it's always helpful in case others run in to the same issue. I'll leave the issue open a while longer until we know that the software here can be ruled out (though I'm happy to try and help even if the error isn't with this library).

Karmagit commented 9 years ago

Very very much appreciated!

Da: Phil Fenstermacher [mailto:notifications@github.com] Inviato: mercoledì 20 maggio 2015 16:17 A: pcfens/RaspberryPi-AS3935 Cc: Karmagit Oggetto: Re: [RaspberryPi-AS3935] Help about new issue raised after latest update (#20)

Try testing it with only one device on the bus too, there's always the chance that another device isn't behaving as expected.

Let us know what you find - it's always helpful in case others run in to the same issue. I'll leave the issue open a while longer until we know that the software here can be ruled out (though I'm happy to try and help even if the error isn't with this library).

— Reply to this email directly or view it on GitHub https://github.com/pcfens/RaspberryPi-AS3935/issues/20#issuecomment-103902466 . https://github.com/notifications/beacon/AFX-H8Wl1bA6e2BesJCmrpR9O-FDtNriks5oLI7EgaJpZM4Egy0m.gif

Karmagit commented 9 years ago

Powercycle solved the issue! Sorry for all of the troubles. Working on it remotely forced me to focus only ont the possible causes that could be remotely solved. Disconnecting phisically from the plug for a short while had been enough to solve all of the issue! Thanks for the support!

pcfens commented 9 years ago

Glad to hear a full reset took care of it, and thanks for letting us know - I'm sure it'll help someone in the future.

I'm kind of curious to know if calling the reset method would have done the same thing or not. If you ever find yourself having issues again it's probably worth a try.

Karmagit commented 9 years ago

In case I'll try that for sure and let you know. Thanks again