07-01-2020 09:31 PM
Hello,
I'm building a new weather station based on BME680(ULP mode) and ESP8266 :Deepsleep(5min). Everything works fine with BSEC library except AIQ. It seems that after each deepsleep/wakeup, BME loses it states? Any idea how to implement this?
My code is based on " basic_config_state.ino".
Thank you.
Solved! Go to Solution.
07-07-2020 09:47 PM
Hi,
Thanks.
07-09-2020 01:39 AM
Hello FAC_CA,
Thank you for your reply, it make sense not to fully setup the sensor after each reboot. I did some changes to the code, I removed RTC memory and instead I'm using EEPROM method.
I did below, but still no luck:
void setup() {
Serial.begin(9600);
ESP.getResetReason();
Wire.pins(0, 2);
Wire.begin(0, 2);
iaqSensor.begin(BME680_I2C_ADDR_SECONDARY, Wire);
checkIaqSensorStatus();
if ( resetInfo.reason == REASON_DEEP_SLEEP_AWAKE ) {
Serial.println("DeepSleep");
}
else {
Serial.println("Reset");
EEPROM.begin(BSEC_MAX_STATE_BLOB_SIZE + 1); // 1st address for the length
iaqSensor.setConfig(bsec_config_iaq);
loadState();
checkIaqSensorStatus();
}
bsec_virtual_sensor_t sensorList[7] = {
BSEC_OUTPUT_RAW_TEMPERATURE,
BSEC_OUTPUT_RAW_PRESSURE,
BSEC_OUTPUT_RAW_HUMIDITY,
BSEC_OUTPUT_RAW_GAS,
BSEC_OUTPUT_IAQ,
BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE,
BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY,
};
iaqSensor.updateSubscription(sensorList, 7, BSEC_SAMPLE_RATE_ULP);
checkIaqSensorStatus();
esp_timer_get_time = millis();
wifi_setup();
client.setServer(mqttServer, 1883);
esp_timer_get_time1 = millis();
}
07-13-2020 09:32 PM
Hi,
We already reviewed your code which is just part of your project. It is difficult for us to clearly understand the complete process.
Please provide the complete integration code including the setup and loop part.
Thanks.
07-14-2020 02:51 PM
Finally, it's working as expected,
ESP8266 + BME 680 with 5 min deepsleep.
07-15-2020 04:30 PM
Hi,
Thanks for the update. Please click "Accept as solution" button to close this topic.
Thanks.