I have written a code that record sensor data (BME280 and DS18B20) very hour and record it in a Google sheet. After recording, the ESP32 devKit V1 is in deepsleep is initiated with
- esp_sleep_enable_timùe_wakeup(duration of 1 hour)
- esp_deep_sleep_start()
However, when my router is ON, I see that it goes out of sleep about every 20sec and when the routeur is OFF, the wake up is every hour as planned. I tried many things including WiFi_Stop() btstop()… impossible to avoid the wake up after 20sec.
The objective is of course to minimize consumption
Any Idea for solution to avoid unexpected wake up?
Hi.
that’s a weird issue.
Maybe you need to disconnect from Wi-Fi before putting the ESP into deep sleep? Have you tried disconnecting from Wi-FI right before putting it into sleep?
See this tutorial for useful Wi-Fi functions: https://randomnerdtutorials.com/esp32-useful-wi-fi-functions-arduino/
What pins are you using for the sensors?
Regards,
Sara