Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BME680 temperature value is always 0 after calc_temperature() is called

    Highlighted
    Community Moderator

    Re: BME680 temperature value is always 0 after calc_temperature() is called

    Unfortunately there are no built-in functions to dump the whole register map. Please insert your own debug print functions at the relevant locations in your code, or use burst read functions to read-out the whole register map range.

    Highlighted
    New Poster

    Re: BME680 temperature value is always 0 after calc_temperature() is called

    Hi,

    I tested the sensor with esp32 using the simily code like https://github.com/BoschSensortec/BME680_driver/blob/master/Self%20test/bme680_selftest.c, it works perfectly, then I used the (almost) same code running on raspberry, unfortunetely, it does not work properly.

     

    Did you test the sensor with a raspberry using I2c? If not, can you please test it? Here some debug output of my test setup:

     

    first:
    get dur
    delay 183 ms
    get data
    read from pid 5
    r: 1d:0080008000800800004
    read from pid 5
    r: 1d:0080008000800800004
    read from pid 5
    r: 1d:0080008000800800004
    read from pid 5
    r: 1d:0080008000800800004
    read from pid 5
    r: 1d:0080008000800800004
    read from pid 5
    r: 1d:0080008000800800004
    read from pid 5
    r: 1d:0080008000800800004
    read from pid 5
    r: 1d:0080008000800800004
    read from pid 5
    r: 1d:0080008000800800004
    read from pid 5
    r: 1d:0080008000800800004
    Error [2] : Unknown error code
    T: -5.68 degC, P: 0.06 hPa, H 1993407.88 %rH
    set sensor_mode
    read from pid 5
    r: 74:0
    w: 74:1
    w: 74:1
    write to from pid 5
    second:
    get dur
    delay 183 ms
    get data
    read from pid 5
    r: 1d:005a68807d9ba0445f800088ba
    read from pid 5
    r: 1d:005a68807d9ba0445f800088ba
    read from pid 5
    r: 1d:005a68807d9ba0445f800088ba
    read from pid 5
    r: 1d:005a68807d9ba0445f800088ba
    read from pid 5
    r: 1d:005a68807d9ba0445f800088ba
    read from pid 5
    r: 1d:005a68807d9ba0445f800088ba
    read from pid 5
    r: 1d:005a68807d9ba0445f800088ba
    read from pid 5
    r: 1d:005a68807d9ba0445f800088ba
    read from pid 5
    r: 1d:005a68807d9ba0445f800088ba
    read from pid 5
    r: 1d:005a68807d9ba0445f800088ba
    Error [2] : Unknown error code
    T: -5.68 degC, P: 0.07 hPa, H 1993407.88 %rH , G: 92860 ohms
    set sensor_mode
    read from pid 5
    r: 74:8c
    w: 74:8d
    w: 74:8d
    write to from pid 5

     

    In attachment, you can also find the debug output from my osciloscopy.

    And what I just wonder, after setting Baudrate to 40000 in raspberry, one of bme680 sensor in our project, it works well, but a second on board not. If you like to know more, you can also write me email to wenwen.chen@de.bosch.com

    Highlighted
    New Poster

    Re: BME680 temperature value is always 0 after calc_temperature() is called

    I spend another day to debug and find out the problem: After soft resetting, I am not able to set value to any register. I checked with osciloscope, the I2c communication looks good and there is no error reported by i2c driver. Here some more logs:

    w: 0xe0: 0xb6
    r: 0xe0: 0x0
    r: 0xd0: 0x61
    r: 0x89: 0x0 0xd2 0x66 0x3 0x30 0x7a 0x8d 0x70 0xd7 0x58 0x0 0x1c 0x23
    0x67 0xff 0x29 0x1e 0x0 0x0 0xd 0xf6 0xb2 0xf5 0x1e 0x9b
    r: 0xe1: 0x41 0x57 0x24 0x0 0x2d 0x14 0x78 0x9c 0x1d 0x66 0x3d 0xe2 0xdf
    0x12 0x16 0x0
    r: 0x2: 0x16
    r: 0x0: 0x20
    r: 0x4: 0x23
    set sensor_mode
    r: 0x74: 0x0
    r: 0x74: 0x0
    set settings
    w: 0x74: 0x0
    r: 0x74: 0x0
    r: 0x72: 0x0
    w: 0x72: 0x2
    r: 0x72: 0x0
    r: 0x75: 0x0
    r: 0x74: 0x0
    r: 0x72: 0x0
    r: 0x71: 0x0
    w: 0x75: 0x8
    r: 0x75: 0x0
    w: 0x74: 0x8c
    r: 0x74: 0x0
    w: 0x72: 0x2
    r: 0x72: 0x0
    w: 0x71: 0x10
    r: 0x71: 0x0
    r: 0x70: 0x0 0x0 0x0 0x0 0x0 0x0
    r: 0x5a: 0x0
    r: 0x64: 0x0
    set settings again
    w: 0x74: 0x0
    r: 0x74: 0x0
    r: 0x72: 0x0
    w: 0x72: 0x2
    r: 0x72: 0x0
    w: 0x5a: 0x79
    r: 0x5a: 0x0
    w: 0x64: 0x65
    r: 0x64: 0x0
    r: 0x74: 0x0
    r: 0x75: 0x0
    r: 0x74: 0x0
    r: 0x72: 0x0
    r: 0x71: 0x0
    w: 0x75: 0x0
    r: 0x75: 0x0
    w: 0x74: 0x0
    r: 0x74: 0x0
    w: 0x72: 0x0
    r: 0x72: 0x0
    w: 0x71: 0x0
    r: 0x71: 0x0
    r: 0x70: 0x0 0x0 0x0 0x0 0x0 0x0
    r: 0x5a: 0x0
    r: 0x64: 0x0
    set sensor_mode
    r: 0x74: 0x0
    w: 0x74: 0x1
    r: 0x74: 0x0
    r: 0x74: 0x0

     

    The bme680 python library https://github.com/pimoroni/bme680-python works direcly on my raspberry. But I can not understand, why the c code not.

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist