cancel
Showing results for 
Search instead for 
Did you mean: 

Range Status 6 with VL53L1X

HHaje.1
Associate II

Hi

I'm getting range status 6 while I'm reading the sensor, which corresponds to (No Update) Status.

Test code (kept the necessary debugging prints):

int16_t getDistance(void)
{
    int status = VL53L1_StartMeasurement(Dev);
	uint8_t firstTimeInterrupt = 1;
	static VL53L1_RangingMeasurementData_t RangingData;
    do /* interrupt mode */
    {
        __WFI();
        // SENSOR_DEBUGF("got an interrupt,IntCount=%d\n", IntCount));
        if (IntCount != 0)
        { // Is this necessary ? >> yes.
            IntCount = 0;
            if (firstTimeInterrupt == 0)
            {
                status = VL53L1_GetRangingMeasurementData(Dev, &RangingData);
                if (status == 0)
                {
                    Serial.printf("Status:%d\tD=%d\tSignalC=%u\tAmbientC=%u\n", RangingData.RangeStatus, RangingData.RangeMilliMeter,
                                  RangingData.SignalRateRtnMegaCps / 65536.0, RangingData.AmbientRateRtnMegaCps / 65336.0);
                }
                status = VL53L1_ClearInterruptAndStartMeasurement(Dev);
                return RangingData.RangeMilliMeter;
            }
            else
            { /* Must not read data at the first interrupt, must clear interrupt and start measurement */
                status = VL53L1_ClearInterruptAndStartMeasurement(Dev);
                firstTimeInterrupt = 0;
            }
        }
    } while (1);
}

What's interesting is the sensor reads and correctly prints the range:

> Status:6    D=60  SignalC=0    AmbientC=1076956160

The used library is: STSW-IMG007_v2.4.5.

2 REPLIES 2
Anne BIGOT
ST Employee

Hello,

Technically you are using a VL53L1CB. You can find the UM of the API here.

A status 6 means VL53L1_RANGESTATUS_RANGE_VALID_NO_WRAP _CHECK_FAIL. It will always happen on the first range. In order to check for the WRAP one needs two ranges. This is just a warning telling you might have a wrap, we don't know. After the second range, you should get more normal responses.


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'

Thank you again for your information,

  @Anne BIGOT

This is somehow shocking to me, as we've bought modules claimed to be VL53L1X, in which we've proceeded upon.

As of this article, it's 8 meters long instead of 4, is there any tradeoffs?

As we could need longer than 2-3 meters to measure water levels, perhaps VL53L1CB is the answer, am I correct?

I think I'd need to convert my project to use STSW-IMG019 instead of STSW-IMG007, right?

One last question: Where can I find more information about the wrapping range states?

Thank you again.

Hamza