Reading temperature, humidity and pressure using BME688 connected to ESP8266

I have connected BME688 to ESP866 using i2c. I configured esphome yaml configuration. After the binary is flashed, ESP866 boots up however complains stating communication failed. I have the i2c pins configured correctly.

My configuration is here.

Device logs

[17:39:07.640][I][app:077]: Running through setup()
[17:39:07.644][C][component:208]: Setup logger took 0ms
[17:39:07.649][I][i2c.arduino:156]: Performing bus recovery
[17:39:07.681][C][component:208]: Setup i2c took 43ms
[17:39:07.686][C][component:208]: Setup preferences took 0ms
[17:39:07.692][E][component:246]: bme68x_bsec2 was marked as failed
[17:39:07.698][E][component:362]: bme68x_bsec2 set Error flag: unspecified
[17:39:07.704][E][bme68x_bsec2.sensor:036]: bme68x_init failed: status -2
[17:39:07.710][C][component:208]: Setup bme68x_bsec2 took 16ms
....
[17:39:07.774][I][app:194]: ESPHome version 2025.12.4 compiled on Jan  7 2026, 17:38:52
...
[17:39:07.798][C][i2c.arduino:060]: I2C Bus:
[17:39:07.802][C][i2c.arduino:061]:   SDA Pin: GPIO4
[17:39:07.803][C][i2c.arduino:061]:   SCL Pin: GPIO5
[17:39:07.806][C][i2c.arduino:061]:   Frequency: 50000 Hz
[17:39:07.812][C][i2c.arduino:075]:   Recovery: bus successfully recovered
[17:39:07.817][I][i2c.arduino:085]: Results from bus scan:
[17:39:07.821][I][i2c.arduino:087]: Found no devices
[17:39:07.832][C][bme68x_bsec2_i2c.sensor:030]:   Address: 0x76
[17:39:07.837][C][bme68x_bsec2.sensor:059]: BME68X via BSEC2:
[17:39:07.839][C][bme68x_bsec2.sensor:059]:   BSEC2 version: 2.6.1.0
[17:39:07.842][C][bme68x_bsec2.sensor:059]:   BSEC2 configuration blob:
[17:39:07.844][C][bme68x_bsec2.sensor:059]:     Configured: NO
[17:39:07.849][C][bme68x_bsec2.sensor:067]:     Size: 1943
[17:39:07.857][E][bme68x_bsec2.sensor:071]: Communication failed (BSEC2 status: 0, BME68X status: -2)
...
17:39:08.032][E][component:188]:   bme68x_bsec2 is marked FAILED: unspecified

My pin connections are as follows:

ESP8266 BME688
3V3 VCC
GND GND
D1 SCL
D2 SDA

I am able to read the temperature, humidity, pressure and gas resistance using sketch flashed through Arduino IDE (not that it matters). So both ESP8266 and BME688 are working.

Appreciate your help

You may need some more code.

I used the same configuration mentioned in the link. The only missing configuration is reporting sensors accuracy and IAQ. I just want to make sure I am able to get Temperature, Humidity and Pressure.

Communication failure is what I am trying to resolve.

@Arh, If you think I am missing any configuration, can you please provide some clue on how to proceed.

Sorry I missed the modules bit of your code.

Update : I used a ESP32 board to connect the BME688 and used the same configuration but changed the board details and was able to get the readings from sensor. However the issue still remains for ESP8266.

At this point I think esphome generated stack for ESP8266 is not functional.