Vl53L5CX - cause of stop_ranging() to fail
I am encountering a strange problem on the VL53L5CX sensor. Here is the rundown of my setup:
- 3 sensors
- each gets initialised and new i2c address is set so they can run simultaneously
- turn all sensors on and wait for external input
The external input is simply an interrupt from a pin (yes I do block interrupt calls while this process is running so theres no overlap). Upon this interrupt being fired the following occurs:
- Each sensor sent the start_ranging() command
- each sensor takes 10 measurements (this is done by looping over each sensor and calling the check_ranging_data() command and then get_ranging_data() )
- after 10 measurements each sensor is sent the stop_ranging() command
This is where the problem occurs, the first 2 sensors have no problem stopping, then the final sensor seems to timeout during this function call and returns an error 49 (decimal). What would cause the stop_ranging() command to fail? How does it even fail? How is it more complicated than to just stop all ranging processes on the sensor MCU? Even if there was no ranging process running on the sensor, the stop_ranging() command shouldn't fail - because it would simply stop what's already stopped. Is there something I'm missing here?
Now that error code might not be exactly right as it changes when the I2C bus has an error. But I'm inclined to believe the I2C bus is fine due to the fact it gets through the entire process before failing. The final call to stop_ranging() on the 3rd sensor is literally the last step.
