Hi,
I'm currently working on a project, based on ESP32, where I read and send some sensor data over WiFi every 15 minutes. When the ESP is not sending data it goes into sleep mode. I also use a display that shows some of the last acquired data when a capacitive touch plate is touched. This also puts the ESP out of sleep mode.
Here's part of the code:
#define sleep_Time 900*1000000 //15min in microseconds
void setup() {
esp_sleep_enable_timer_wakeup(sleep_Time);
touchAttachInterrupt(T0, touchISR, threshold);
esp_sleep_enable_touchpad_wakeup();
if (esp_sleep_get_wakeup_cause() = ESP_SLEEP_WAKEUP_TOUCHPAD) {
//show data on display
}
else{
//read and send sensor data via WiFi
}
esp_deep_sleep_start();
}
The problem is that after I touch the plate to activate the display the sleep mode timer re-initializes putting the ESP back to sleep for another 15min. What I am trying to achive is to read and send the data every 15min even if I wake up the ESP from touch to activate the display in between the sleep mode.
I hope I explained myself
Thank you!