Page 1 of 1

Sleep timer motion sensitivity

Posted: Thu Apr 27, 2017 5:51 pm
by kostyan5
I programmed our ESP32 to deep sleep for 11 minutes, then wake up, record current time, and go back to sleep. What I found was that the sleep duration was severely impacted by motion. In the attached plot, you can see that the sleep duration drops significantly (sometimes as low as 3 mins) when I was moving (walking, driving, etc.) with the device. I had another device doing the same thing but sitting on my desk and that sleep duration was fairly constant.

I'm using the esp-idf default settings for RTC clock. Any thoughts on this?

Re: Sleep timer motion sensitivity

Posted: Fri Apr 28, 2017 2:00 am
by ESP_igrr
That's pretty surprising. We'll try to reproduce this.

Re: Sleep timer motion sensitivity

Posted: Fri Apr 28, 2017 2:04 am
by ESP_Sprite
What hardware did you use, by the way? The only things I can think of that are sensitive to motion that would be found on a normal PCB are ceramic caps; maybe they do something weird on your PCB triggering something in the ESP32.

Re: Sleep timer motion sensitivity

Posted: Fri Apr 28, 2017 2:34 am
by WiFive
Do you also record esp_deep_sleep_get_wakeup_cause to make sure it is a timer wakeup each time?

Re: Sleep timer motion sensitivity

Posted: Sun Apr 30, 2017 1:26 pm
by kostyan5
We're using Sparkfun's "ESP32 Thing" (https://www.sparkfun.com/products/13907). I haven't looked at reset cause but will give it a try next test.

Re: Sleep timer motion sensitivity

Posted: Mon May 01, 2017 2:47 am
by ESP_igrr
What about the source of the timestamps you are recording? Are you relying on internal timekeeping, or syncing with SNTP?
If it's just the internal timekeeping, and the clock frequency is somehow affected by motion, the timestamps would also be affected. Logging the wakeup cause may indeed shed some light on this issue...

Re: Sleep timer motion sensitivity

Posted: Mon May 01, 2017 3:10 pm
by kostyan5
I'm using settimeofday() to initially set the time from our web backend. After that I'm using gettimeofday() for timestamps. SMTP is not possible because the device is asleep. I would expect that to drift a little but not that much.

Re: Sleep timer motion sensitivity

Posted: Thu Jun 24, 2021 9:37 am
by Aqib_aab
Hi there,

have you found any solution to this problem? I have been seeing the same issue. esp_clk_slowclk_cal_get() value jumps around all over the place and when the time is greater than 2-3 days the difference in time start appearing in minutes when in fact the time difference is in 1-2 seconds.

rtc_time_slowclk_to_us() = 120157419042
esp_clk_slowclk_cal_get() VAL = 3115584
after one second
esp_clk_slowclk_cal_get() VAL = 3117171
rtc_time_slowclk_to_us() = 120183324654


Our product is in production and and we need to find a solution asap.

Any suggestions?

Regards