UncleRus / esp-idf-lib

Component library for ESP32-xx and ESP8266
https://esp-idf-lib.readthedocs.io/en/latest/
1.37k stars 425 forks source link

BME680 pressure value does not change #320

Closed pedrominatel closed 2 years ago

pedrominatel commented 2 years ago

The issue

I'm testing the BME680 but the pressure value does not change from zero hPa. I've added a new log print to get the RAW values but no changes at all. I'm in a location over 35 meters from sea level.

RAW Pressure: 524288
BME680 Sensor: 19.45 °C, 46.73 %, 0.0000 hPa, 11444.00 Ohm
RAW Pressure: 524288
BME680 Sensor: 19.46 °C, 47.37 %, 0.0000 hPa, 10818.00 Ohm

Maybe my sensor is defective, but I've only one to test and I'm not sure if it's a real issue in this library (maybe not).

Thank you!

Which SDK are you using?

esp-idf

Which version of SDK are you using?

master

Which build target have you used?

Component causing the issue

bme680

Anything in the logs that might be useful for us?

I (29) boot: ESP-IDF v5.0-dev-2080-gdb8fb1f47b-dirty 2nd stage bootloader
I (29) boot: compile time 10:23:13
I (30) boot: chip revision: 3
I (34) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (41) boot.esp32: SPI Speed      : 40MHz
I (46) boot.esp32: SPI Mode       : DIO
I (50) boot.esp32: SPI Flash Size : 2MB
I (55) boot: Enabling RNG early entropy source...
I (60) boot: Partition Table:
I (64) boot: ## Label            Usage          Type ST Offset   Length
I (71) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (79) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (86) boot:  2 factory          factory app      00 00 00010000 00100000
I (94) boot: End of partition table
I (98) boot_comm: chip revision: 3, min. application chip revision: 0
I (105) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=0976ch ( 38764) map
I (128) esp_image: segment 1: paddr=00019794 vaddr=3ffb0000 size=02680h (  9856) load
I (132) esp_image: segment 2: paddr=0001be1c vaddr=40080000 size=041fch ( 16892) load
I (140) esp_image: segment 3: paddr=00020020 vaddr=400d0020 size=18624h ( 99876) map
I (178) esp_image: segment 4: paddr=0003864c vaddr=400841fc size=08734h ( 34612) load
I (192) esp_image: segment 5: paddr=00040d88 vaddr=50000000 size=00010h (    16) load
I (199) boot: Loaded app from partition at offset 0x10000
I (199) boot: Disabling RNG early entropy source...
I (212) cpu_start: Pro cpu up.
I (213) cpu_start: Starting app cpu, entry point is 0x40081110
0x40081110: call_start_cpu1 at /home/pedro/esp/esp-idf/components/esp_system/port/cpu_start.c:152

I (0) cpu_start: App cpu up.
I (227) cpu_start: Pro cpu start user code
I (227) cpu_start: cpu freq: 160000000 Hz
I (227) cpu_start: Application information:
I (232) cpu_start: Project name:     example-bme680
I (237) cpu_start: App version:      0.8.3-dirty
I (243) cpu_start: Compile time:     Apr 20 2022 10:23:09
I (249) cpu_start: ELF file SHA256:  a28bc6555b3bc9c2...
I (255) cpu_start: ESP-IDF:          v5.0-dev-2080-gdb8fb1f47b-dirty
I (262) heap_init: Initializing. RAM available for dynamic allocation:
I (269) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (275) heap_init: At 3FFB2FC0 len 0002D040 (180 KiB): DRAM
I (281) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (287) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (294) heap_init: At 4008C930 len 000136D0 (77 KiB): IRAM
I (301) spi_flash: detected chip: gd
I (304) spi_flash: flash io: dio
W (308) spi_flash: Detected size(8192k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (322) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
RAW Pressure: 524288
W (160) bme680: Heater is not stable
BME680 Sensor: 19.71 °C, 47.03 %, 0.0000 hPa, 0.00 Ohm
RAW Pressure: 524288
BME680 Sensor: 19.70 °C, 46.98 %, 0.0000 hPa, 9770.00 Ohm
RAW Pressure: 524288
BME680 Sensor: 19.69 °C, 46.94 %, 0.0000 hPa, 9385.00 Ohm
RAW Pressure: 524288
BME680 Sensor: 19.68 °C, 46.94 %, 0.0000 hPa, 9335.00 Ohm
RAW Pressure: 524288
BME680 Sensor: 19.68 °C, 46.90 %, 0.0000 hPa, 9302.00 Ohm
RAW Pressure: 524288
BME680 Sensor: 19.67 °C, 46.88 %, 0.0000 hPa, 9335.00 Ohm
RAW Pressure: 524288
BME680 Sensor: 19.67 °C, 46.87 %, 0.0000 hPa, 9368.00 Ohm

Additional information or context

The sensor is in a custom development board.

Confirmation

pedrominatel commented 2 years ago

Never mind, my distraction fault!

    // Changes the oversampling rates to 4x oversampling for temperature
    // and 2x oversampling for humidity. Pressure measurement is skipped.
    bme680_set_oversampling_rates(&sensor, BME680_OSR_4X, BME680_OSR_16X, BME680_OSR_2X);