05-12-2020 01:59 PM
I use a bme680 for my project, but the temperature value from `read_field_data()` is always 0 .
I printed the following debug data for this code part https://github.com/BoschSensortec/BME680_driver/blob/master/bme680.c#L1223-L1239
buf[5-7] is 129 105 96
adc_temp is 530070, adc_pres is 393660, adc_hum is 14457, adc_gas_res is 304 and adc_gas range is 5
after calculation:
data->temperature = 0.000 data->humidity = 20.270 data->pressure =95598.000 data->gas_resistance = 294021.0
buf[5-7] is 130 140 32
adc_temp is 534722, adc_pres is 414452, adc_hum is 13726, adc_gas_res is 377 and adc_gas range is 5
after calculation:
data->temperature = 0.000 data->humidity = 16.673 data->pressure = 92113.000 data->gas_resistance = 276157.0
Can somebody help me?
Solved! Go to Solution.
05-26-2020 03:48 PM
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.
09-25-2020 05:12 PM
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
09-30-2020 11:13 AM - edited 09-30-2020 11:49 PM
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.
12-02-2020 12:40 AM
Good to know you solve the issue.
With your source code, we may able to check what happened in C level on this platform.
12-02-2020 09:17 AM
Actually, I need the bme680 also work with c code, because our code is written in c and it still does not work!
Pls contact me via email/skype/teams (wenwen.chen@de.bosch.com) for a bug session.