12-07-2019 05:02 PM
Hello everyone,
i'm looking to make the BME680 work with my setup before moving to BSEC library.
Basically i'm facing an issue (probably integration) which is driving me crazy, namely i can't read the data from the sensor itself.
Here is the output:
BME680
bme680_init done: 0
bme680.chip_id: 0x61
bme680_set_sensor_settings done: 0
bme680_set_sensor_mode done: 0
T: -231.30 degC, P: 27790966.00 hPa, H 2779096.50 %rH
T: -231.30 degC, P: 27790966.00 hPa, H 2779096.50 %rH
T: -231.30 degC, P: 27790966.00 hPa, H 2779096.50 %rH
T: -231.30 degC, P: 27790966.00 hPa, H 2779096.50 %rH
T: -231.30 degC, P: 27790966.00 hPa, H 2779096.50 %rH
T: -231.30 degC, P: 27790966.00 hPa, H 2779096.50 %rH
T: -231.30 degC, P: 27790966.00 hPa, H 2779096.50 %rH
T: -231.30 degC, P: 27790966.00 hPa, H 2779096.50 %rH
T: -231.30 degC, P: 27790966.00 hPa, H 2779096.50 %rH
T: -231.30 degC, P: 27790966.00 hPa, H 2779096.50 %rH
In the link below you can find the "main" code
Here the i2c implementation
Can anyone help me out in finding the problem?
Regards,
Solved! Go to Solution.
12-07-2019 10:10 PM
I corrected the "len+1" bug in the user_i2c_write. Stupid mistake on my side.
Still the sensor data "accuracy" for temperature is kinda low in the sense that temperature is wrong by almost 8 degrees.
Can i assume it is due to the pcb heating ? Should i use the sensor offset for compensation?
BME680
bme680_init done: 0
bme680.chip_id: 0x61
bme680_set_sensor_settings done: 0
bme680_set_sensor_mode done: 0
T: 27.25 degC, P: 999.03 hPa, H 41.96 %rH , G: 205250 ohms
T: 27.68 degC, P: 999.03 hPa, H 42.32 %rH , G: 226416 ohms
T: 28.04 degC, P: 998.96 hPa, H 42.09 %rH , G: 232654 ohms
T: 28.31 degC, P: 998.98 hPa, H 41.82 %rH , G: 238207 ohms
T: 28.54 degC, P: 998.98 hPa, H 41.60 %rH , G: 240292 ohms
T: 28.70 degC, P: 998.98 hPa, H 41.41 %rH , G: 242058 ohms
T: 28.84 degC, P: 998.98 hPa, H 41.28 %rH , G: 245670 ohms
T: 28.93 degC, P: 998.96 hPa, H 41.20 %rH , G: 246405 ohms
T: 29.00 degC, P: 998.98 hPa, H 41.09 %rH , G: 246405 ohms
T: 29.04 degC, P: 998.96 hPa, H 41.03 %rH , G: 248637 ohms
12-09-2019 09:33 AM
12-10-2019 06:53 PM
Hello,
i agree since i've started to use BSEC as well the compensation seems to be fairly decent.
I'm now facing a different problem which is about the "state" thing.
This is the ouput of my read_eeprom() where i actually read its content and where i return the length i read
Initializing bsec
config_load n_buffer: 454
4 7 4 1 61 0 0 0 0 0 0 0 115 0 0 0 45 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 44 1 20 20 0 0 0 0 0 0 0 0 0 0 3 0 23 168 95 63 20 12 0 2 0 0 0 200 65 0 0 200 65 16 0 3 0 0 0 128 64 0 0 160 65 0 0 64 66 22 0 5 0 0 0 0 64 0 0 0 0 0 0 0 0 0 0 0 80 1 0 12 0 9 0 0 0 0 64 0 0 0 0 8 0 10 0 0 0 160 65 0 0 0 0 0 0 0 0
bme680_status: 0
bsec_status: -36
The read function is as follow
if (flash_drv_read(fl_dev, state_buffer, n_buffer, initial_address + 0x2D) == WM_SUCCESS){
flash_drv_close(fl_dev);
int k;
uint16_t length = 0;
for(k=0;k<n_buffer && state_buffer[k] != 0xFF;k++){
length++;
wmprintf("%d ",state_buffer[k]);
}
wmprintf("\r\n");
return length;
}
While the write function is as follow
void state_save(const uint8_t *state_buffer, uint32_t length)
{
flash_desc_t fl;
part_get_desc_from_name("ed_data", &fl);
uint32_t initial_address = fl.fl_start+fl.fl_size;
mdev_t *fl_dev = flash_drv_open(FL_INT);
if (fl_dev != NULL) {
//initial_data_address - 0x1000 + 0x2D
flash_drv_write(fl_dev, state_buffer, length, initial_address + 0x2D);
}
flash_drv_close(fl_dev);
}
As you can see my API is not reporting me the read bytes so i had to calculate it.
Fortuantely the EEPROM is 0xFF so i can check against that.
Why do i receive error BSEC_E_CONFIG_CRCMISMATCH ? I don't think im reading from the wrong place
12-10-2019 07:29 PM
Had to erase the eeprom first, solved