Unable to get measures from VL53L4CX
Hello,
I'm in doing a project to measure the distance of my car from the wall. I'm in the software development phase using an ESP32 and a VL53L4CX to measure the distance.
I'm using ESPHome to develop the entire thing and due to the reason there is no specific driver for this distance sensor I started to develop one.
I copied source code from github stm32duino VL53L4CX repository and perform a few modifications to deal with GPIOPin instead of pin numbers and I2CDevice instead of Wire. It took me a couple of days to finish all required changes but I'm able to send and receive data using the I2C.
Following the code structure in the examples, I'm able to successfully perform the calls to InitSensor() and StartMeasurement(). I've log files where I check the possible error codes on every call, and the initialisation phase is executed without any errors. This includes calls to:
sensor_vl53l4cx_sat.InitSensor(0x52);
sensor_vl53l4cx_sat.VL53L4CX_StartMeasurement();
But later, inside the update() method, every call to
VL53L4CX_GetMeasurementDataReady() returns 00 and no distance measure is ever available.
Also If I debug I2C communication, reading register 0x0031 returns 0x03, what means there is no data available.
I've never been able to test if the device works properly as I never received a valid measure.
What could be wrong?
Thank you for your help
Note: the links have 'colon', 'slash' and 'dot' because new users cannot add links.
