i am working on esp32 with SHT30 temperature sensor, after 2 hour or 3 hour getting issue like
[E][esp32-hal-i2c.c:161] i2cWrite(): Busy Timeout! Addr: 44
here is my code:
-> Initialised clock and Wire Begin here:
** Wire.begin(21,22);**
** Wire.setTimeout(500);**
** Wire.setClock(100000);**
->function to get i2c data
void get_i2c_data(){
unsigned int data[6]; **
** // Start I2C Transmission
** Serial.println("----------------------Begin 1TXtion");**
** Wire.beginTransmission(I2CAddr);**
** Serial.println("----------------------Begin 2TXtion");**
** // Send measurement command**
** Wire.write(0x2C);**
** Wire.write(0x06);**
** delay(500);**
** // Stop I2C transmission**
if (Wire.endTransmission(true)!=0) {
** Serial.println("----------------------Faild to end TXtion");**
** // return; **
}
** delay(500);**
** // Request 6 bytes of data**
//Serial.print("I2C state");
// Serial.println( Wire.requestFrom(I2CAddr, 6));
if(Wire.requestFrom(I2CAddr, 6) == 6){
** Serial.println("-------------------------------Reading i2c address");**
** // Read 6 bytes of data**
** // cTemp msb, cTemp lsb, cTemp crc, humidity msb, humidity lsb, humidity crc**
** if (Wire.available() == 6)**
** { temp_available = 1;**
** data[0] = Wire.read();**
** data[1] = Wire.read();**
** data[2] = Wire.read();**
** data[3] = Wire.read();**
** data[4] = Wire.read();**
** data[5] = Wire.read();**
** }**
** else{**
** temp_available = 0;**
** }**
** if (Wire.available()!=0) {**
** Serial.println("----------------------i2c Not available");**
** return;**
** }**
** Serial.printf("Hex Temp: %x, %x, %x,%x, %x, %x\r\n",data[0],data[1],data[2],data[3],data[4],data[5]);**
__ float cTemp = ((((data[0] << 8) | data[1]) * 175) / 65535.0) - 45;__
** Serial.printf("VTemp");**
** Serial.println(cTemp);**
** temperature_fromSensor_celcius = (cTemp - 4);**
float temp_Farenheit = (temperature_fromSensor_celcius * 1.8) + 32;
temperature_fromSensor = (temperature_fromSensor_celcius * 1.8) + 32;
float humidity_sens = ((((data[3] << 8) | data[4]) * 100) / 65535.0) + 10;
humidity_fromSensor = ((((data[3] << 8) | data[4]) * 100) / 65535.0);
** humidity_fromSensor = humidity_fromSensor + 10;**
}
I even tried to use Wire.reset() function when i got this issue but still no use. please help me to solve this.
how to solve this issue