adafruit / Adafruit_BME280_Library

Arduino Library for BME280 sensors
Other
328 stars 301 forks source link

Possible hang when using Adafruit_BME280::takeForcedMeasurement() #75

Closed netmaniac closed 3 years ago

netmaniac commented 4 years ago

When sensor BME280 gets disconnected or is damaged calling Adafruit_BME280::takeForcedMeasurement() can results in hanging. Reason is in loop https://github.com/adafruit/Adafruit_BME280_Library/blob/0213f84f9fe1344b99042f3a8051f489ec1ddc5a/Adafruit_BME280.cpp#L357

On ESP8266 this loop won't trigger WDT, since it is using delay.

To reproduce - connect BME280 sensor to ESP, initialize it in forced mode and read in some intervals (10s). Then disconnect sensor from I2C bus, or power it off. ESP will hang.

kimi1991 commented 3 years ago

I'll work on this.

siddacious commented 3 years ago

fixed! thanks @kimi1991

@netmaniac let us know if this isn't able to fix your issue