We have the sensor connected to the I2C pins on a RPi4 running the newest Bullseye OS.
We used the simple example for testing the device found here:
https://github.com/adafruit/Adafruit_Ci ... pletest.py
And after running successfully for awhile, we keep getting this error and the script exits:
Traceback (most recent call last):
File "pew2.py", line 35, in <module>
read = vl53.range
File "/usr/local/lib/python3.7/dist-packages/adafruit_vl53l0x.py", line 530, in range
return self.read_range()
File "/usr/local/lib/python3.7/dist-packages/adafruit_vl53l0x.py", line 575, in read_range
while not self.data_ready:
File "/usr/local/lib/python3.7/dist-packages/adafruit_vl53l0x.py", line 538, in data_ready
self._data_ready = self._read_u8(_RESULT_INTERRUPT_STATUS) & 0x07 != 0
File "/usr/local/lib/python3.7/dist-packages/adafruit_vl53l0x.py", line 312, in _read_u8
self._device.readinto(self._BUFFER, end=1)
File "/home/gladis/.local/lib/python3.7/site-packages/adafruit_bus_device/i2c_device.py", line 80, in readinto
self.i2c.readfrom_into(self.device_address, buf, start=start, end=end)
File "/home/gladis/.local/lib/python3.7/site-packages/busio.py", line 159, in readfrom_into
return self._i2c.readfrom_into(address, buffer, stop=stop)
File "/home/gladis/.local/lib/python3.7/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 59, in readfrom_into
readin = self._i2c_bus.read_bytes(address, end - start)
File "/home/gladis/.local/lib/python3.7/site-packages/Adafruit_PureIO/smbus.py", line 181, in read_bytes
return self._device.read(number)
OSError: [Errno 121] Remote I/O error
If we try and run the script again we get this error:
Traceback (most recent call last):
File "pew2.py", line 15, in <module>
vl53 = adafruit_vl53l0x.VL53L0X(i2c)
File "/usr/local/lib/python3.7/dist-packages/adafruit_vl53l0x.py", line 152, in __init__
self._read_u8(0xC0) != 0xEE
File "/usr/local/lib/python3.7/dist-packages/adafruit_vl53l0x.py", line 311, in _read_u8
self._device.write(self._BUFFER, end=1)
File "/home/gladis/.local/lib/python3.7/site-packages/adafruit_bus_device/i2c_device.py", line 99, in write
self.i2c.writeto(self.device_address, buf, start=start, end=end)
File "/home/gladis/.local/lib/python3.7/site-packages/busio.py", line 168, in writeto
return self._i2c.writeto(address, memoryview(buffer)[start:end], stop=stop)
File "/home/gladis/.local/lib/python3.7/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 52, in writeto
self._i2c_bus.write_bytes(address, buffer[start:end])
File "/home/gladis/.local/lib/python3.7/site-packages/Adafruit_PureIO/smbus.py", line 314, in write_bytes
self._device.write(buf)
OSError: [Errno 121] Remote I/O error
The issue is not resolved until we unplug and re-plug in the sensor.
ADAFRUIT TOF VL53L0X ERROR
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_carter
- Posts: 29473
- Joined: Tue Nov 29, 2016 2:45 pm
Re: ADAFRUIT TOF VL53L0X ERROR
Please post a photo showing how everything is connected. It could be a connection issue. Also, appears your code is not exactly the example code?
Please be positive and constructive with your questions and comments.