02-18-2019 11:49 AM
using Arduino 1.88 / 1.85 with ESP8266 (lib 2.50 / 2.42) and two BME680 sensors.
Final goal is to use these sensors in portable devices, but at first in normal mode without sleeping process.
If using the config_state sample I can see that the state_save and state_load will not work correct.
what is going on:
1) BME starts - after some time will get right values as expected with accuracy=1
2) some time later have still valid values with accuracy=2, sometimes is falling back to accuracy=1
3) auto save procedure (with accuracy=2 (?) or even 1 (!) ) will be done
(have canged this in code that I allow autosave only if accuracy >=2 - maybe "3" is correct? )
4) After autosave to EEPROM with accuracy=3 reboot the ESP (power loss...)
-> Load values from EEPROM
5) BME start and show at first minutes no valid values and accuracy=0 (maybe correct ?)
6) After some minutes accuracy=2 but IAQ is still 0 - for a very long time (hours).
Resistance is in normal range (as before restarting) - so no changes.
The only way is erase the EEPROM and start at new - then all is fine again (until next restart).
I already made some control procedures - but not sure how to get a valid config_load after restarting.
BTW: I have compared the saved and loaded values before - identical.
Any idea?
Thanks!
Michael
Solved! Go to Solution.
05-05-2019 03:59 PM
Great, I would love to share my use case. Thanks.
Setup:
Use Case:
--> In order to fullfill this task, the device has to enter deep sleep in times without measurements. The I2c devices will be connected to a 3,3V power source all time. Only the ESP-12f will go to sleep.
??> The challenge for us right now is to recover a BME680 connection after letting the ESP-12f sleep for e.g. 30, 59 or 59,91 seconds. THe sleep is triggers by a commad like system_deep_sleep_instant(_sleepTime_us);.
A code example like the following dummy would be great, that lead to a setup, that can achieve IAQ state "3" like the "normal example code:
#include <everything-necessary.h> setup() { // do magic init here allTheInit(); } loop() { // measure BME680 sensor measureBme680(); if (iaqSensor.iaqAccuracy < 3) { _sleepTime_s = 60 * __s2us; // sleep for 1 minute } else { _sleepTime_s = 5 * __s2us; // sleep for 5 s or whatever } system_deep_sleep_instant(_sleepTime_us); }
05-20-2019 07:42 PM
For the BME680 to perform optimally, BSEC should run in a fixed operating mode (either LP or ULP) consistently. Therefore we would recommend not to perform the 'if' condition in your pseudo-code (which should otherwise be reported by BSEC), and add that it is expected for the accuracy to drop at least to 2 indicating that the library is performing a calibration.
Regarding power saving, it should be possible to put your MCU in deep-sleep between measurement, as long as you can save and restore in time BSEC's state file and your system timestamp between each read-out.
05-21-2019 11:03 PM
@handytech wrote:For the BME680 to perform optimally, BSEC should run in a fixed operating mode (either LP or ULP) consistently. Therefore we would recommend not to perform the 'if' condition in your pseudo-code (which should otherwise be reported by BSEC), and add that it is expected for the accuracy to drop at least to 2 indicating that the library is performing a calibration.
Regarding power saving, it should be possible to put your MCU in deep-sleep between measurement, as long as you can save and restore in time BSEC's state file and your system timestamp between each read-out.
Great to get a response after two weeks. Nice to hear from you! Regarding the first section of your response: That's fine. Let's assume the MCU awakes every minute or very 4 minutes as a fixed interval. Unfortunately,
I am a little bit suprised that this was no considered use case for Bosch regarding a low powers IoT sensor (especially #1). I would have assumed that at least a scenario with 1 MCU and several sensors was considered.
But, let us try to find a solution. Regarding your last post in the last section you say "as long as you can save and restore in time BSEC's state file and your system timestamp between each read-out.":
Some more explanation and a code example would be appreciated!
05-22-2019 10:05 AM
Hi Bastian,
I did a little research and found that your specific MCU has 512 bytes of RAM that is preserves even trough deep sleep.
Here's what I would therefore recommend:
BSEC does not have to run in real time. It can be easily fooled by calling the API repeatedly with increasing timestamps.
This will work as long as you:
05-28-2019 10:42 PM
Dear o_o,
thank you for you answer, but I think you have not completely read my setup description. The device (and BME680 sensor connected to an ESP12f) will have to run on a batterie for more than 1 week. The storage is no problem, but the power. For this time span, the device needs to enter sleep for 1-5 minutes, then only wake up quickly to measure and then sleep again.
Your proposal is not solution here. Sorry.