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

IOError: [Errno 121] Remote I/O error #29

Open
DarKOrange75 opened this issue Mar 26, 2021 · 7 comments
Open

IOError: [Errno 121] Remote I/O error #29

DarKOrange75 opened this issue Mar 26, 2021 · 7 comments

Comments

@DarKOrange75
Copy link

Hi,

I can't get it to work, I am running it it with a raspberry A+ and as soon as I test it with a piezo I get this error:

Traceback (most recent call last):
File "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 121] Remote I/O error

Thank you for your help !

@pcfens
Copy link
Owner

pcfens commented Mar 30, 2021

Did you remember to enable the I2C device driver?

You may also need to set the I2C bus to 1.

@DarKOrange75
Copy link
Author

DarKOrange75 commented Mar 31, 2021

Thank you for your answer, I2C bus was set to 1, the AS3935 is detected with i2cdetect -y 1 in position 3
What do you mean by enable the I2C device driver?

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00: 03 -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- 36 -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

@pcfens
Copy link
Owner

pcfens commented Apr 3, 2021

By driver I mean the kernel module - that i2cdetect works makes me think it's working as expected.

Can you try running the python script as root (or using sudo)? I doubt that's it, but it'd be good to confirm.

@pawelKapl
Copy link

Same here, i2c is detecting module as 03 on bus 1. And getting very same error, with sudo too. Running on Raspberry Pi 2b.

@DarKOrange75
Copy link
Author

Same error when running the script with sudo.

@zanzeoo
Copy link

zanzeoo commented May 5, 2021

same

File "demo.py", line 17, in
sensor.calibrate(tun_cap=0x0F)
File "/home/pi/RaspberryPi-AS3935/RPi_AS3935/RPi_AS3935.py", line 24, in calibrate
self.set_byte(0x08, (self.registers[0x08] & 0xF0) | tun_cap)
File "/home/pi/RaspberryPi-AS3935/RPi_AS3935/RPi_AS3935.py", line 222, in set_byte
self.i2cbus.write_byte_data(self.address, register, value)
IOError: [Errno 121] Remote I/O error

@pawelKapl
Copy link

Hey guys i noticed something interesting. Sensor is actually starting working when GND of Raspberry or sensor ground is connected to earth, or u just touch it with a finger. This might explain why for example sensor can work with LAN cable, but not on wifi.

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

4 participants