ESP8266 Developer Zone The Official ESP8266 Forum 2017-06-30T03:56:45+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=4771 2017-06-30T03:56:45+08:00 2017-06-30T03:56:45+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4771&p=14293#p14293 <![CDATA[Re: Inconsistent sleeping with SDK 2.1.0 uint64_t sleep times]]>

Code:

(max time_in_us / cali) << 12 = 2^31 - 1

taking <<12 for multiply by 2^12 (4096) I get

Code:

max_us = ((2^31-1)/2^12)*cali

or approx

Code:

max_us < 2^19*cali

with system_rtc_clock_cali_proc() returning values in the range 22300 - 23100 (even varying on continous readings w/o reboot ???)
taking 22000 for safety, this gives max deep sleep of ~11500s ~~ 3.2h

Statistics: Posted by schufti — Fri Jun 30, 2017 3:56 am


]]>
2017-06-19T10:04:05+08:00 2017-06-19T10:04:05+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4771&p=14110#p14110 <![CDATA[Re: Inconsistent sleeping with SDK 2.1.0 uint64_t sleep times]]>
The deep sleep 0 issue has been solved, please have a try with the latest SDK. https://github.com/espressif/ESP8266_NONOS_SDK

Thanks for your interest in ESP8266!

Statistics: Posted by ESP_Faye — Mon Jun 19, 2017 10:04 am


]]>
2017-06-18T20:45:09+08:00 2017-06-18T20:45:09+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4771&p=14106#p14106 <![CDATA[Re: Inconsistent sleeping with SDK 2.1.0 uint64_t sleep times]]> Statistics: Posted by Bremer — Sun Jun 18, 2017 8:45 pm


]]>
2017-06-15T17:51:58+08:00 2017-06-15T17:51:58+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4771&p=13977#p13977 <![CDATA[Re: Inconsistent sleeping with SDK 2.1.0 uint64_t sleep times]]> Mine is 3.5 hours.

Statistics: Posted by Her Mary — Thu Jun 15, 2017 5:51 pm


]]>
2017-06-01T12:51:59+08:00 2017-06-01T12:51:59+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4771&p=13609#p13609 <![CDATA[Re: Inconsistent sleeping with SDK 2.1.0 uint64_t sleep times]]> Statistics: Posted by torntrousers — Thu Jun 01, 2017 12:51 pm


]]>
2017-06-01T14:13:39+08:00 2017-06-01T11:26:06+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4771&p=13580#p13580 <![CDATA[Re: Inconsistent sleeping with SDK 2.1.0 uint64_t sleep times]]> It is "cali = system_rtc_clock_cali_proc()", not "cali = system_rtc_clock_cali_proc()>>12".

Statistics: Posted by Her Mary — Thu Jun 01, 2017 11:26 am


]]>
2017-05-31T16:08:40+08:00 2017-05-31T16:08:40+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4771&p=13570#p13570 <![CDATA[Re: Inconsistent sleeping with SDK 2.1.0 uint64_t sleep times]]>
The theoretical maximum value of time_in_us can be calculated by formula:
(time_in_us / cali) << 12 = 2^32 - 1
• cali = system_rtc_clock_cali_proc(), the cali is the RTC clock period (in us)

In system_rtc_clock_cali_proc in 3.3.22 it says:

RTC clock period (in us); bit11 ~ bit0 are decimal.
Example os_printf("clk cal : %d \r\n",system_rtc_clock_cali_proc()>>12);

When I try that printf on an ESP8266 it outputs "clk cal : 6"

So (time_in_us / cali) << 12 = 2^32 - 1
So time_in-us = ( (2^32 - 1) >> 12 ) * 6
= 6291450

Which is just 6 seconds! Clearly wrong as it sleeps for longer than that fine. Can anyone do the maths better?

Statistics: Posted by torntrousers — Wed May 31, 2017 4:08 pm


]]>
2017-05-31T13:57:53+08:00 2017-05-31T13:57:53+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4771&p=13567#p13567 <![CDATA[Re: Inconsistent sleeping with SDK 2.1.0 uint64_t sleep times]]> It is mentioned in the non OS API guide.

Statistics: Posted by Her Mary — Wed May 31, 2017 1:57 pm


]]>
2017-05-30T16:35:49+08:00 2017-05-30T16:35:49+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4771&p=13544#p13544 <![CDATA[Re: Inconsistent sleeping with SDK 2.1.0 uint64_t sleep times]]> Statistics: Posted by torntrousers — Tue May 30, 2017 4:35 pm


]]>
2017-05-28T21:41:21+08:00 2017-05-28T21:41:21+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4771&p=13478#p13478 <![CDATA[Re: Inconsistent sleeping with SDK 2.1.0 uint64_t sleep times]]> Ensure that this has nothing to do with loose connections, if you are working on a prototype. Meanwhile I will let you know if I can reproduce this exact problem.

Statistics: Posted by Guest — Sun May 28, 2017 9:41 pm


]]>
2017-05-27T16:56:08+08:00 2017-05-27T16:56:08+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4771&p=13450#p13450 <![CDATA[Inconsistent sleeping with SDK 2.1.0 uint64_t sleep times]]>
For example, calling system_deep_sleep with these works as expected:
uint64_t sleepTime = 10000000; // WORKS: 10 seconds
uint64_t sleepTime = 7200000000; // WORKS: 2 hours
uint64_t sleepTime = 9000000000; // WORKS: 2.5 hours
uint64_t sleepTime = 86400000000; // WORKS: 24 hours

But calling system_deep_sleep with values like these doesn't work and the ESP8266 wakes up almost immediately:
uint64_t sleepTime = 21600000000; // FAILS: 6 hours
uint64_t sleepTime = 74049000000; // FAILS: bit over 20 hours

In all cases system_deep_sleep is returning true, and the ESP8266 wakes up with rst cause:2, boot mode:(3,6).

What could be wrong, is this a bug?

Statistics: Posted by torntrousers — Sat May 27, 2017 4:56 pm


]]>