Skip to content

"OSError: [Errno 121] Remote I/O error" on subsequent runs #1

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

Closed
aurimasv opened this issue Aug 9, 2020 · 2 comments
Closed

"OSError: [Errno 121] Remote I/O error" on subsequent runs #1

aurimasv opened this issue Aug 9, 2020 · 2 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@aurimasv
Copy link

aurimasv commented Aug 9, 2020

I'm trying to run the code from Adafruit documentation as well as a slight modification below (to try and deinit the I2C /shrug) on a Raspberry Pi.

import busio
import board
import adafruit_shtc3

with busio.I2C(board.SCL, board.SDA) as i2c:
    sht = adafruit_shtc3.SHTC3(i2c)
    print("Temperature: %0.1f C Humidity: %0.1f %%rH" % sht.measurements)

The first time I run this after the sensor is connected it works fine:

$ ./shtc3.py
Temperature: 28.1 C Humidity: 47.0 %rH

However all subsequent runs throw OSError: [Errno 121] Remote I/O error until the sensor is disconnected and reconnected.

 $ ./shtc3.py
Traceback (most recent call last):
  File "./shtc3.py", line 12, in <module>
    sht = adafruit_shtc3.SHTC3(i2c)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_shtc3.py", line 93, in __init__
    self.reset()
  File "/usr/local/lib/python3.7/dist-packages/adafruit_shtc3.py", line 120, in reset
    self._write_command(_SHTC3_SOFTRESET)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_shtc3.py", line 103, in _write_command
    i2c.write(self._buffer, start=0, end=2)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 102, in write
    self.i2c.writeto(self.device_address, buf, start=start, end=end)
  File "/usr/local/lib/python3.7/dist-packages/busio.py", line 115, in writeto
    return self._i2c.writeto(address, memoryview(buffer)[start:end], stop=stop)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 49, in writeto
    self._i2c_bus.write_bytes(address, buffer[start:end])
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 308, in write_bytes
    self._device.write(buf)
OSError: [Errno 121] Remote I/O error

This seems like a similar issue for a different sensor: adafruit/Adafruit_CircuitPython_MLX90393#8

@aurimasv
Copy link
Author

aurimasv commented Aug 9, 2020

In case this is helpful, i2cdetect output before and after running the script is the same.

$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

@siddacious siddacious added the wontfix This will not be worked on label Aug 10, 2020
@siddacious
Copy link
Contributor

@aurimasv Unfortunately the SHTC3 will not reconnect via I2C after an initial connection unless it is power cycled by disconnecting and reconnecting power.

I've spend quite a while looking for solutions to no avail, so I've updated the guide documentation to mention this behavior. I'm going to close this ticket as a known issue as a 'wontfix' but really it means "cantfix".

Should one of us find a solution, we'll gladly re-open or at least mention the fix here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants