Working with a Raspberry PI and interfacing with an Adafruit MMA8451 Accelerometer board. I am trying a fresh installation of Buster after I had all this working on Stretch. I have installed all the latest libraries and done all the latest updates. I am able to have the MMA8451 show up using
sudo i2cdetect -y 1
at its correct location of 0x1D. When I try the example programs I normally get back this big block of error codes:
Traceback (most recent call last):
File "Downloads/simpletest.py", line 15, in <module>
sensor = adafruit_mma8451.MMA8451(i2c)
File "/usr/local/lib/python3.7/dist-packages/adafruit_mma8451.py", line 103, in __init__
while self._read_u8(_MMA8451_REG_CTRL_REG2) & 0x40 > 0:
File "/usr/local/lib/python3.7/dist-packages/adafruit_mma8451.py", line 134, in _read_u8
self._read_into(address, self._BUFFER, count=1)
File "/usr/local/lib/python3.7/dist-packages/adafruit_mma8451.py", line 130, in _read_into
in_end=count)
File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 150, in write_then_readinto
in_start=in_start, in_end=in_end)
File "/usr/local/lib/python3.7/dist-packages/busio.py", line 89, in writeto_then_readfrom
in_start=in_start, in_end=in_end, stop=stop)
File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 61, in writeto_then_readfrom
readin = self._i2c_bus.read_i2c_block_data(address, buffer_out[out_start:out_end], in_end-in_start)
File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 227, in read_i2c_block_data
ioctl(self._device.fileno(), I2C_RDWR, request)
OSError: [Errno 121] Remote I/O error
The maddening thing is that occasionally the whole thing will work. Is there something I can check? I had this working before so I believe it is a software issue rather than a hardware issue. I have tried both a Raspberry PI 3 and Raspberry PI 4 board, both have given the same error numerous times.