adafruit / Adafruit_VL53L0X

Arduino library for Adafruit VL53L0X
149 stars 118 forks source link

No timeout implemented in code #23

Closed Daybreakerflint closed 2 years ago

Daybreakerflint commented 5 years ago

The TOF sensor is currently due to my lack of understanding, hanging in a loop where it does not work properly. I enabled debug mode and 'fiddled' around with the sensor untill the error occured.

sVL53L0X: PerformSingleRangingMeasurement Range Status: 8 : No Update RANGE IGNORE THRESHOLD: 15.60 Measured distance: 1

Between the PerformSingleRangingMeasurment and Range Status pass +30 Seconds.

A timeout if that error occurs would be great! Thank you.

PassiSchoppi commented 2 years ago

I have the same issue. Did you manage to fix it somehow?

caternuson commented 2 years ago

Can you provide complete example code that can be used to demonstrate the issue?

PassiSchoppi commented 2 years ago

The example code examples/vl53l0x/vl53l0x.ino with one simple sensor connected as described in this tutorial. The issue first happened to me after smacking the sensor on the table… I think you can replicate it more consistently by just pulling it off and then plugging it back in… The issue is not really with the sensor but how the API reacts. For me the whole program on the Arduino just stops completely. I would rather like to have it so that the API tells me that the sensor wasn‘t reachable so that i can either try to reconnect by resetting all i2c addresses or by just escaping the sensor value to be like a default or something. Does that make sense? If you want to I can try to send you a video demonstrating the issue.

caternuson commented 2 years ago

The issue first happened to me after smacking the sensor on the table… I think you can replicate it more consistently by just pulling it off and then plugging it back in

That is essentially a hot plug. That is not supported by I2C.

Closing issue for now.

@Daybreakerflint If you can recreate your issue and post more details about how to recreate it, we can reopen this issue and take a look.