-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Description
When the TCA is connected to the i2c device and the device throws an OSError then the TCA library has a chance to deadlock. I am unable to reproduce this error without the TCA library.
Traceback (most recent call last):
File "RowTest1.py", line 32, in <module>
res += "|O" if square.value == False else "|X" # Reads value of sensor square over i2c
File "/home/pi/SmartChessboard/env/lib/python3.7/site-packages/adafruit_mcp230xx/digital_inout.py", line 80, in value
return _get_bit(self._mcp.gpio, self._pin)
File "/home/pi/SmartChessboard/env/lib/python3.7/site-packages/adafruit_mcp230xx/mcp23017.py", line 63, in gpio
return self._read_u16le(_MCP23017_GPIOA)
File "/home/pi/SmartChessboard/env/lib/python3.7/site-packages/adafruit_mcp230xx/mcp230xx.py", line 36, in _read_u16le
with self._device as i2c:
File "/home/pi/SmartChessboard/env/lib/python3.7/site-packages/adafruit_bus_device/i2c_device.py", line 137, in __enter__
while not self.i2c.try_lock():
File "/home/pi/SmartChessboard/env/lib/python3.7/site-packages/adafruit_tca9548a.py", line 47, in try_lock
while not self.tca.i2c.try_lock():
KeyboardInterrupt
The issue: #8 describes the exact same issue. This issue was resolved by the user by simply not using the TCA. Unfortunately this is not an option for me. Furthermore simply adding a sleep time before the next i2c request does not avoid the deadlock
Metadata
Metadata
Assignees
Labels
No labels