Sleep timer motion sensitivity

kostyan5
Posts: 50
Joined: Mon Mar 06, 2017 3:16 pm

Sleep timer motion sensitivity

Postby kostyan5 » Thu Apr 27, 2017 5:51 pm

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?
Attachments
Screen Shot 2017-04-27 at 1.44.43 PM.png
Screen Shot 2017-04-27 at 1.44.43 PM.png (67.1 KiB) Viewed 9787 times

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Sleep timer motion sensitivity

Postby ESP_igrr » Fri Apr 28, 2017 2:00 am

That's pretty surprising. We'll try to reproduce this.

ESP_Sprite
Posts: 8884
Joined: Thu Nov 26, 2015 4:08 am

Re: Sleep timer motion sensitivity

Postby ESP_Sprite » Fri Apr 28, 2017 2:04 am

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.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Sleep timer motion sensitivity

Postby WiFive » Fri Apr 28, 2017 2:34 am

Do you also record esp_deep_sleep_get_wakeup_cause to make sure it is a timer wakeup each time?

kostyan5
Posts: 50
Joined: Mon Mar 06, 2017 3:16 pm

Re: Sleep timer motion sensitivity

Postby kostyan5 » Sun Apr 30, 2017 1:26 pm

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.

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Sleep timer motion sensitivity

Postby ESP_igrr » Mon May 01, 2017 2:47 am

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...

kostyan5
Posts: 50
Joined: Mon Mar 06, 2017 3:16 pm

Re: Sleep timer motion sensitivity

Postby kostyan5 » Mon May 01, 2017 3:10 pm

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.

Aqib_aab
Posts: 1
Joined: Thu Jun 24, 2021 9:31 am

Re: Sleep timer motion sensitivity

Postby Aqib_aab » Thu Jun 24, 2021 9:37 am

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

Who is online

Users browsing this forum: No registered users and 70 guests