Skip to content

Commit

Permalink
BME280: Increase sensor timeout (esphome#727)
Browse files Browse the repository at this point in the history
I'm facing some occasional timeouts when reading BME280. 
Looking at Adafruit driver (that this code is based on), I see that base math is using 1.25ms, increased by 2.3*oversampliing + 0.575 for each value being read. 
I've added 1.5ms as baseline, to be on the same safe.
  • Loading branch information
lobradov authored and OttoWinter committed Oct 17, 2019
1 parent 3bb6430 commit 1242f43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion esphome/components/bme280/bme280.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void BME280Component::update() {
return;
}

float meas_time = 1;
float meas_time = 1.5;
meas_time += 2.3f * oversampling_to_time(this->temperature_oversampling_);
meas_time += 2.3f * oversampling_to_time(this->pressure_oversampling_) + 0.575f;
meas_time += 2.3f * oversampling_to_time(this->humidity_oversampling_) + 0.575f;
Expand Down

0 comments on commit 1242f43

Please sign in to comment.