SparkFun Thing Plus - ESP32-S2 WROOM ---- DEFECTIVE?

Hi,

I opened by new esp32-s2 thing plus today and uploaded the initial blink program. I get the increased brightness and 1Hz blink on the LED and also the Hello World! to the Serial Monitor. I then downloaded the libraries for the VL53L5 and VL53L1, opened my break out board plastic packages, plugged in my qwiic cable (also new) and uploaded the demo sketches (distance array sketch for the L5 and distance read for the L1). In both cases I got “Sensor failed to begin. Please check wiring. Freezing…” to the serial terminal.

Is it a defective ESP32 or do you have any other ideas on things to try? Unfortunately I don’t have my scope right now so I don’t have many other ways of checking the I2C bus other than taking it in faith that it is working (or in this case, not).

Jordan

Double check the board definitions and correct COM/rate are selected; are you hooking them up one at a time?

Correct board definition – “sparkfun esp32-s2 thing plus”

Correct comm port or else I wouldn’t see the “hello world”

No, I know they have the same 0x52 address so I can only done one at a time unless I programmatically change the address or use a MUX. In this case, even with one, the sample code cannot detect the sensors which seems like it would point to the host, not the sensors…

Serial.printf("distance sensor %d\r\n", distanceSensor.checkID());
Serial.printf("sensor begin = %d\r\n", distanceSensor.begin());

The output is true (1) for the ID and false (0) for sensor init. So I2C is working but whatever is taking place within the VL53L1X_SensorInit(); function isn’t working. Thoughts?

Correction. The L1X is at 0x29. I know I can communicate with it:

  1. I can read the ID

  2. If I send the following I get an acknowledgement with no error (returns 0 == success)

uint8_t address = 0x29;
Wire.beginTransmission(address);
uint8_t error = Wire.endTransmission();

Does this point to a SW issue such as a library implementation error? I have tried 100kHz and 400kHz and that change doesn’t result in a successful .begin() return either.

distanceSensor.startRanging();
    delay(100); 
    uint32_t distance = distanceSensor.getDistance();
    Serial.printf("distance = %d\r\n", distance);

I get a value back even without calling init on the sensor. I don’t know what is wrong with the init function but that is what is causing the errors in the sparkfun demo code and my code.

I downloaded the adafruit library for the L1X and their demo code works out of the box. Seems like this should be investigated some more to find a fix.