ESP8266 Developer Zone The Official ESP8266 Forum 2016-08-15T12:33:19+08:00 https://bbs.espressif.com:443/feed.php?f=65&t=2500 2016-08-15T12:33:19+08:00 2016-08-15T12:33:19+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2500&p=8481#p8481 <![CDATA[Re: is timed light sleep possible?]]>
By your first question, if you mean whether it is possible to read the timer count, yes it is. May not be possible on software timer (if it has been implemented internally in non-open source code), you may however read the timer count at any time by directly accessing the corresponding timer registers.

For the second question, yes you can find the time from RTC and the reset source from API system_get_rst_info ()

Statistics: Posted by Guest — Mon Aug 15, 2016 12:33 pm


]]>
2016-08-13T05:42:28+08:00 2016-08-13T05:42:28+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2500&p=8425#p8425 <![CDATA[Re: is timed light sleep possible?]]> I didn't find a way to pause the timers, but I did find the pointer to the beginning of the linked list for the timers "extern os_timer_t *timer_list", after finding this pointer I was able to determine what software timers were preventing light sleep and got it to successfully enter light sleep.
Success!

However I have a few more questions if you don't mind,
1. Is there a way to get the value of the timer or variable that is used in comparison with "ETStimer.timer_expire" to determine when to fire the timer?
2. After setting an interval for light sleep, then waking by gpio. Is there any way to determine whether wakeup cause was from gpio or timeout and is there a way to get the amount of time slept before wake by gpio?

Statistics: Posted by dnc40085 — Sat Aug 13, 2016 5:42 am


]]>
2016-08-08T11:10:01+08:00 2016-08-08T11:10:01+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2500&p=8311#p8311 <![CDATA[Re: is timed light sleep possible?]]>
Technically, software timers run when software is running... so as long as no interrupt is allowed or hardware timer is disabled, software timer will not be a problem.
You will need to stop the hardware timer for sure though. That should be sufficient.

Statistics: Posted by Guest — Mon Aug 08, 2016 11:10 am


]]>
2016-08-06T16:16:22+08:00 2016-08-06T16:16:22+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2500&p=8302#p8302 <![CDATA[Re: is timed light sleep possible?]]>
I did some further testing with a blink example and the timed light sleep is working correctly, I mistakenly assumed NodeMCU didn't have any timers running, which seems to be what is causing my light sleep problems.

From ESP8266 Non-OS SDK API reference 2.0.0:

Timer will prevent the chip from entering light-sleep mode, please disable all timers in
application before entering light-sleep.

Does this apply to both HW and SW timers? Is there anything other than the timers that can prevent timed light sleep?

Is there a way to pause all timers temporarily, so timed light sleep can be achieved without restarting each individual timer?

Statistics: Posted by dnc40085 — Sat Aug 06, 2016 4:16 pm


]]>
2016-08-03T10:04:28+08:00 2016-08-03T10:04:28+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2500&p=8242#p8242 <![CDATA[Re: is timed light sleep possible?]]>
Please consult the documentation to ensure you are doing everything right:
http://espressif.com/sites/default/file ... ons_en.pdf

The recent SDKs (v.1.5.4, etc) seemed to have some sleep mode current related bugs, which were fixed with patch releases. If you are using v.1.5.x then please make sure your SDK is updated.

Statistics: Posted by Guest — Wed Aug 03, 2016 10:04 am


]]>
2016-08-02T05:37:39+08:00 2016-08-02T05:37:39+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2500&p=8230#p8230 <![CDATA[[SOLVED] is timed light sleep possible?]]>

Code:

wifi_set_opmode_current(NULL_MODE);
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
wifi_fpm_open();
wifi_fpm_set_wakeup_cb(wake_cb);
wifi_fpm_do_sleep(10*1000*1000);


Am I doing something wrong or is timed light_sleep just not possible?

Statistics: Posted by dnc40085 — Tue Aug 02, 2016 5:37 am


]]>