Hi all,
I'm using this HAT: https://sequentmicrosystems.com/products/16-universal-inputs-card-for-raspberry-pi
reading the input very frequently (1Hz, forever) and my application works fine for several hours.
However, in a random way apparently, I get in my Python application the following exception:
When this happens... the Raspberry is totally unable to even restore I2C communications with the HAT.
Any attempt to read data through I2C results in the same error in journalctl:
Even a reboot of the Raspberry PI does not work :-(
I'm really lost on how to fix this.
Last time it happened I think I did a complete power cycle (unplugged the power adapter and plugged it back).
A few more notes:
* I didn't connect anything to GPIO lines related to SDA and SCL, beyond the SequentMicrossytem HAT
* I'm using a Raspberry Model B+ from 2014
* I'm using Raspbian 12 (bookworm), with kernel
I'm using this HAT: https://sequentmicrosystems.com/products/16-universal-inputs-card-for-raspberry-pi
reading the input very frequently (1Hz, forever) and my application works fine for several hours.
However, in a random way apparently, I get in my Python application the following exception:
and in the journalctl I can see:Mar 02 10:40:32 raspberrypi python3[1298]: | Traceback (most recent call last):
Mar 02 10:40:32 raspberrypi python3[1298]: | File "/root/ha-alarm-raspy2mqtt-venv/lib/python3.11/site-packages/lib16inpind/__init__.py", line 35, in readAll
Mar 02 10:40:32 raspberrypi python3[1298]: | val = bus.read_word_data(hw_add, INPUTS16_INPORT_REG_ADD)
Mar 02 10:40:32 raspberrypi python3[1298]: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 02 10:40:32 raspberrypi python3[1298]: | File "/root/ha-alarm-raspy2mqtt-venv/lib/python3.11/site-packages/smbus2/smbus2.py", line 474, in read_word_data
Mar 02 10:40:32 raspberrypi python3[1298]: | ioctl(self.fd, I2C_SMBUS, msg)
Mar 02 10:40:32 raspberrypi python3[1298]: | TimeoutError: [Errno 110] Connection timed out
Mar 02 10:40:32 raspberrypi python3[1298]: |
Mar 02 10:40:32 raspberrypi python3[1298]: | During handling of the above exception, another exception occurred:
Mar 02 10:40:32 raspberrypi python3[1298]: |
Mar 02 10:40:32 raspberrypi python3[1298]: | Traceback (most recent call last):
Mar 02 10:40:32 raspberrypi python3[1298]: | File "/root/ha-alarm-raspy2mqtt/raspy2mqtt/raspy2mqtt.py", line 415, in sample_and_publish_optoisolated_inputs
Mar 02 10:40:32 raspberrypi python3[1298]: | sampled_values_as_int = lib16inpind.readAll(SEQMICRO_INPUTHAT_STACK_LEVEL)
Mar 02 10:40:32 raspberrypi python3[1298]: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 02 10:40:32 raspberrypi python3[1298]: | File "/root/ha-alarm-raspy2mqtt-venv/lib/python3.11/site-packages/lib16inpind/__init__.py", line 38, in readAll
Mar 02 10:40:32 raspberrypi python3[1298]: | raise Exception(e)
Mar 02 10:40:32 raspberrypi python3[1298]: | Exception: [Errno 110] Connection timed out
Mar 02 10:40:32 raspberrypi kernel: i2c-bcm2835 20804000.i2c: i2c transfer timed out
When this happens... the Raspberry is totally unable to even restore I2C communications with the HAT.
Any attempt to read data through I2C results in the same error in journalctl:
Mar 02 23:35:04 raspberrypi kernel: i2c-bcm2835 20804000.i2c: i2c transfer timed out
Mar 02 23:35:05 raspberrypi kernel: i2c-bcm2835 20804000.i2c: i2c transfer timed out
Mar 02 23:35:06 raspberrypi kernel: i2c-bcm2835 20804000.i2c: i2c transfer timed out
Mar 02 23:35:07 raspberrypi kernel: i2c-bcm2835 20804000.i2c: i2c transfer timed out
Even a reboot of the Raspberry PI does not work :-(
I'm really lost on how to fix this.
Last time it happened I think I did a complete power cycle (unplugged the power adapter and plugged it back).
A few more notes:
* I didn't connect anything to GPIO lines related to SDA and SCL, beyond the SequentMicrossytem HAT
* I'm using a Raspberry Model B+ from 2014
* I'm using Raspbian 12 (bookworm), with kernel
Linux raspberrypi 6.1.0-rpi7-rpi-v6 #1 Raspbian 1:6.1.63-1+rpt1 (2023-11-24) armv6l GNU/Linux