Great, I would love to share my use case. Thanks. Setup: ESP-12f device, Arduino Toolchain I²C devices: 1 x BME680, 1 x DS3231 Real Time Clock (and some more devices not shared to this forum) 1 x 10000 mAh battery 4 MB additional flash storage Use Case: The device is planned to measure environmental values - every 1-5 minutes - in places, where a constant power supply by a grip is not present and - over time periods of 1-2 weeks The devices will try to connect to a secure wifi network every 5-20 minutes. If the network is present, data will be uploaded to some server. --> 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. Trigger a BME680 measurement e.g. ever minute is not only acceptable, but required. By the real time clock we can also garantee to sample BME680 measurements frequently (with a certain inaccuracy by the RTC, of course). ??> 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);
}
... View more