5
votes
Accepted
ESP32 can not deep sleep longer than 35 minutes
So, formalizing this into an answer:
long DEEP_SLEEP_TIME_SEC = 43200;
// ...
esp_sleep_enable_timer_wakeup(1000000L * DEEP_SLEEP_TIME_SEC);
This is attempting to calculate the result of 1000000L * ...
4
votes
Accepted
How 2 bytes can produce negative number, mind blowing?
I won't explain it like you are 5-years old because it would take to
much effort, you are a grown up, and you are capable of reading articles
yourself. So start by putting aside ChatGPT, and instead ...
1
vote
Accepted
integer overflow in expression of type 'int' results
Change that line to:
esp_sleep_enable_timer_wakeup((uint64_t) TIME_TO_SLEEP * 60 * uS_TO_S_FACTOR);
That forces the compiler to do 64-bit arithmetic on the constant rather than defaulting to "...
Only top scored, non community-wiki answers of a minimum length are eligible