Troubleshooting

SEN0626 : I2S Error TimeOut

userHead Jean-Philippe.Encausse 2025-08-29 22:09:31 22 Views0 Replies

Playing with SEN0626 (Gesture Recognition) connected to a Sparkle Motion (LED Strip ESP-32) got I2S errors with or without the library

 

✅  The device is detected on 0x72
✅  The device works (detect face = led, detect gesture = led)
❌  The I2C loop fail with library exemple or direct access


E (605881) i2c.master: I2C software timeout
E (605881) i2c.master: s_i2c_synchronous_transaction(924): I2C transaction failed
E (605882) i2c.master: i2c_master_multi_buffer_transmit(1186): I2C transaction failed
[605895][E][esp32-hal-i2c-ng.c:265] i2cWrite(): i2c_master_transmit failed: [259] ESP_ERR_INVALID_STATE`


I don't understand what to do ? 
- Wires are OK because I see the 0x72.
- Code and Pin seems to be OK and I just follow the demo code (or direct access with ChatGPT)
- Hardware is OK the camera do it's internal job


Doc:
SEN0626 : https://wiki.dfrobot.com/SKU_SEN0626_Gesture_and_Face_Detection_Module
Library: https://github.com/DFRobot/DFRobot_GestureFaceDetection
Sparkle Motion : https://learn.adafruit.com/adafruit-sparkle-motion-mini/pinouts

 

Code:
#include "DFRobot_GestureFaceDetection.h"
#define DEVICE_ID 0x72
DFRobot_GestureFaceDetection_I2C gfd(DEVICE_ID);

void setupSEN0626() {
 delay(5000);
 gfd.begin(&Wire);

 while (!gfd.begin()) {
   Serial.println("Communication with device failed, please check connection");
   delay(1000);
 }
 Serial.print("face detection threshold: ");
 Serial.println(gfd.getFaceDetectThres());

 Serial.print("gesture detection threshold: ");
 Serial.println(gfd.getGestureDetectThres());

 Serial.print("gesture detection range: ");
 Serial.println(gfd.getDetectThres());
}

char buffSen0626[100];
void loopSEN0626() {
 if (gfd.getFaceNumber() <= 0) { return; }
 uint16_t faceScore = gfd.getFaceScore();
 uint16_t faceX = gfd.getFaceLocationX();
 uint16_t faceY = gfd.getFaceLocationY();
 
 sprintf(buffSen0626, "detect face at (x = %d, y = %d, score = %d)\n", faceX, faceY, faceScore);
 Serial.print(buffSen0626);

 uint16_t gestureType = gfd.getGestureType();
 uint16_t gestureScore = gfd.getGestureScore();
 sprintf(buffSen0626, "detect gesture %d, score = %d\n", gestureType, gestureScore);
 Serial.print(buffSen0626);

 delay(500);
}