2024-07-12 05:43 AM - last edited on 2024-07-12 06:21 AM by Peter BENSCH
Hello,
I am developing a sensor board using the Raspberry Pi Zero 2W with the VL53L5CX IC by itself, not a breakout board. However, I am running into a problem when trying to read in the sensor data using a simple test script offered by Pimorini. I also have the VL53L5CX breakout board from Pimorini which I connect to the same pins and run the same script and it works just fine.
Here is the error:
Uploading firmware, please wait...
Exception ignored on calling ctypes callback function: <function VL53L5CX.__init__.<locals>._i2c_write at 0x7fac3ca0c0>
Traceback (most recent call last):
File "/home/pi/dronepi/env/lib/python3.11/site-packages/vl53l5cx_ctypes/__init__.py", line 125, in _i2c_write
self._i2c.i2c_rdwr(msg_w)
File "/home/pi/dronepi/env/lib/python3.11/site-packages/smbus2/smbus2.py", line 658, in i2c_rdwr
ioctl(self.fd, I2C_RDWR, ioctl_data)
OSError: [Errno 121] Remote I/O error
Exception ignored on calling ctypes callback function: <function VL53L5CX.__init__.<locals>._i2c_write at 0x7fac3ca0c0>
Traceback (most recent call last):
File "/home/pi/dronepi/env/lib/python3.11/site-packages/vl53l5cx_ctypes/__init__.py", line 125, in _i2c_write
self._i2c.i2c_rdwr(msg_w)
File "/home/pi/dronepi/env/lib/python3.11/site-packages/smbus2/smbus2.py", line 658, in i2c_rdwr
ioctl(self.fd, I2C_RDWR, ioctl_data)
OSError: [Errno 5] Input/output error
Exception ignored on calling ctypes callback function: <function VL53L5CX.__init__.<locals>._i2c_write at 0x7fac3ca0c0>
Traceback (most recent call last):
File "/home/pi/dronepi/env/lib/python3.11/site-packages/vl53l5cx_ctypes/__init__.py", line 125, in _i2c_write
self._i2c.i2c_rdwr(msg_w)
File "/home/pi/dronepi/env/lib/python3.11/site-packages/smbus2/smbus2.py", line 658, in i2c_rdwr
ioctl(self.fd, I2C_RDWR, ioctl_data)
OSError: [Errno 5] Input/output error
The OSError: [Errno 5] then repeats every loop.
I encounter the exact same OSError: [Errno 121] remote I/O error when running the example script from a similar Python wrapper for the VL53L5CX STM driver: link. Where the self._i2c.i2c_rdwr(msg_w) fails.
I am pretty sure my schematic is correct, as I have made sure it is identical to both the typical application schematic in the STM VL53L5CX Datasheet as well as the open-sourced schematic by SparkFun
And the SDA and SCL lines are pulled up to 3.3V using 2.2k ohm resistors elsewhere in the schematic.
Considering these things I have tried, I have concluded that the error must be either software-related, or my wiring is wrong (and I cannot see how it is wrong, maybe someone can see some dumb mistake I made that I cannot).
Does anyone have an answer or an idea as to why this error would occur? I am unfamiliar with the low-level I2C communications programming so I find this particularly difficult to debug.
Any and all help would be greatly appreciated. Please let me know if there is any other information I can provide.
Sincerely,
Andrew