You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
importbusioimportboardimportadafruit_shtc3withbusio.I2C(board.SCL, board.SDA) asi2c:
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
@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.
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.
The first time I run this after the sensor is connected it works fine:
However all subsequent runs throw
OSError: [Errno 121] Remote I/O error
until the sensor is disconnected and reconnected.This seems like a similar issue for a different sensor: adafruit/Adafruit_CircuitPython_MLX90393#8
The text was updated successfully, but these errors were encountered: