BME280 reporting the same temperature of 22.1 degrees

I have connected a BME280 sensor, but I get a constant value for temperature when requested. It reports a value of 22.1,

I'm developing my code using ESP-IDF (using PlatformIO)

I'm using teh Bosch BME280 drive (version 3.3.6). 

It appears to connects without error and fetches the value of 22.1. I'm running the read inside a while loop, pausing one second between the setting of forced mode and the reading of the sensor registers. The read call back is executed three times; 1 byte, 1 byte then 8 bytes.

Would posting the raw, uncomensated register values help?

Does the value of 22.1 have any significance? 

 

Best reply by Inactive Member

A quick overview at the code provided doesn't show anything outstanding in the process. On the other hand something that could generate unexpected behavior could be that you configure the ".intf" element as "BME280_SPI_INTF", while your code indicates you are rather using an I2C interface. If so, you could try configuring it as "BME280_I2C_INTF". If needed and if you have an oscillosope/logic analyser available, you could also confirm that your I2C frames look as expected (in particular the reg_addr element).

View original
4 replies
Resolved