Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input/output error #22

Open
wvanbreukelen opened this issue Apr 8, 2016 · 10 comments
Open

Input/output error #22

wvanbreukelen opened this issue Apr 8, 2016 · 10 comments

Comments

@wvanbreukelen
Copy link
Contributor

Hi there,

I was testing out my sensor with your library, but I ran into an issue.
When I try to simulate lightning using a lighter, I mostly gave the following error:

Traceback (most recent call last):
File "lightning_web.py", line 38, in register_strike
reason = sensor.get_interrupt()
File "/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 48, in get_interrupt
self.read_data()
File "/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 228, in read_data
self.registers = self.i2cbus.read_i2c_block_data(self.address, 0x00)
IOError: [Errno 5] Input/output error

I thought of some fixes by myself, like changing 0x00 to 0x03 (i am using the Embedding Systems V8 version), but I doubt this would fix the issue.

Can you think of any solution to solve this problem?

@pcfens
Copy link
Owner

pcfens commented Apr 8, 2016

The 0x00 there is which register is being read off of the sensor, not the sensor address (Raspberry Pi's were having some trouble with repeated starts when I wrote this library and I haven't revisited it).

Does everything before simulating lightning work? Does this always fail when you simulate lightning or just intermittently?

@wvanbreukelen
Copy link
Contributor Author

It does it intermittently. When no IOError is thrown, it shows up as an disturber. It might be the same issue as #1

@pcfens
Copy link
Owner

pcfens commented Apr 8, 2016

That wouldn't surprise me. I've also found a thread on the RPi forums that addresses a similar issue - maybe that helps?

@pcfens
Copy link
Owner

pcfens commented Jul 26, 2016

Hi @wvanbreukelen - Did you have any success fixing this? If you did, I'd like to close this issue. Thanks!

@sesykes71
Copy link

Phil,

I am late to this thread but I seem to have the same problem that @wvanbreukelen has. I am using a piezo effect lighter to simulate the lightning. As you can see it detects what it thinks is lightning sometimes. i2cdetect, always detects the board so I don't understand the Errno 5 which I think suggests that it doesn't see the module.
Any suggestions? I have two Pi's, a 2 and a 3, they both act the same.

Regards,
Steve

Waiting for lightning - or at least something that looks like it
Noise level too high - adjusting
We sensed lightning!
It was 1km away. (01:00:15 - 2016/08/30)

Traceback (most recent call last):
File "RaspberryPi-AS3935/demo.py", line 23, in handle_interrupt
reason = sensor.get_interrupt()
File "/home/pi/RaspberryPi-AS3935/RPi_AS3935/RPi_AS3935.py", line 48, in get_interrupt
self.read_data()
File "/home/pi/RaspberryPi-AS3935/RPi_AS3935/RPi_AS3935.py", line 234, in read_data
self.registers = self.i2cbus.read_i2c_block_data(self.address, 0x00)
IOError: [Errno 5] Input/output error
Traceback (most recent call last):
File "RaspberryPi-AS3935/demo.py", line 23, in handle_interrupt
reason = sensor.get_interrupt()
File "/home/pi/RaspberryPi-AS3935/RPi_AS3935/RPi_AS3935.py", line 48, in get_interrupt
self.read_data()
File "/home/pi/RaspberryPi-AS3935/RPi_AS3935/RPi_AS3935.py", line 234, in read_data
self.registers = self.i2cbus.read_i2c_block_data(self.address, 0x00)
IOError: [Errno 5] Input/output error

@dlitchfield
Copy link

Hi,

I'm getting a similar error to the others above. When simulating using a piezo lighter, about half the time I get lightning detected and the other half the same error message as wvanbreukelen and sesykes71.

Would really appreciate some help!

@pcfens
Copy link
Owner

pcfens commented Feb 17, 2017

Does there appear to be any pattern associated with issue? I haven't been able to cause the error to pop back up.

Just brainstorming, but is your Pi connected directly to the sensor? Are there other devices on the I2C bus? Is there more than 12 inches of wire separating the sensor and Pi (some I2C devices can't drive longer distances of wire)?

@dlitchfield
Copy link

Hi, Thanks for coming back to me. No there doesn't seem to be any pattern. Since I last played with this, I now only get at best a single disturber message and then only the error message.

As for your specific suggestions - the Pi is connected via a breadboard to the sensor with no other devices on the I2C bus. There is less than 12" of wire.

Embedded Adventures sent a replacement sensor but the same error is occurring. I have also tried it on a second Pi 3, with an identical error.

@jrleeman
Copy link

Wondering if this is pathological timing of interference on the communication from the spark? Catching it with a try/except to retry communication could work?

@ggggson
Copy link

ggggson commented Nov 12, 2018

there,

I was testing out my sensor with your library, but I ran into an issue.
When I try to simulate lightning using a lighter, I mostly gave the following error:

Traceback (most recent call last):
File "lightning_web.py", line 38, in register_strike
reason = sensor.get_interrupt()
File "/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 48, in get_interrupt
self.read_data()
File "/usr/local/lib/python2.7/dist-packages/RPi_AS3935/RPi_AS3935.py", line 228, in read_data
self.registers = self.i2cbus.read_i2c_block_data(self.address, 0x00)
IOError: [Errno 5] Input/output error

I thought of some fixes by myself, like changing 0x00 to 0x03 (i am using the Embedding Systems V8 version), but I doubt this would fix the issue.

Can you think of any solution to solve this problem?

I have the same reason ,I find my pi cannot connect to as3935.I make a i2c to connect wo as3935,but when i used "i2cdectect -y 1" ,I could get nothing .could you give me some message ,thank you.
my e-mail:346236337@qq.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants