01-17-2022 10:48 AM - edited 01-17-2022 10:55 AM
Edit: I accidentely changed some I2C pins, which were refering to BME680. This most likely solves my issue. Sorry for the inconvenience, maybe someone can use this, since i didn't find something on the issue either.
Hello Bosch-Community,
I've been using the code given to me by BSTRobin for a quite a while (link to the forum post: Solved: BME860 does not return humidity or gas-resistance and it used to work flawlessly.
I haven't checked the sensor for quite a while, since I had other sensors to work on. When testing my LoRa + BME680 sensor on my stm32 machine again (I'm also using STM32IDE), it does not enter the bsec_iot_loop, because ret.bme680_status returns -3. Here is a snippet of the main code:
while(1)
{
return_values_init ret;
//PDEBUG("StartBME680Task\r\n");
/* Call to the function which initializes the BSEC library
* Switch on low-power mode and provide no temperature offset */
ret = bsec_iot_init(BSEC_SAMPLE_RATE_HP, 4.85f, bus_write2, bus_read2, sleep, state_load, config_load);
if (ret.bme680_status)
{
/* Could not intialize BME680 */
//PDEBUG("Could not intialize BSEC library, bme680_status=%d\r\n", ret.bme680_status);
//return (int)ret.bme680_status;
}
else if (ret.bsec_status)
{
/* Could not intialize BSEC library */
//PDEBUG("Could not intialize BSEC library, bsec_status=%d\r\n", ret.bsec_status);
//return (int)ret.bsec_status;
}
if((ret.bme680_status == 0) && (ret.bsec_status == 0))
{
// PDEBUG("intialize BSEC library successful\r\n");
/* Call to endless loop function which reads and processes data based on sensor settings */
/* State is saved every 10.000 samples, which means every 10.000 * 3 secs = 500 minutes */
while(1){
}
Neither google, nor the datasheet told me something about the error code. I'm thankful for every help.
Kind regards
01-18-2022 03:09 AM
Hello Crackl1ng,
You could debug step by step to see where the error is reported in the following functions.
ret = bsec_iot_init(BSEC_SAMPLE_RATE_LP, 0.0f, bus_write, bus_read, sleep, state_load, config_load);