So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By hackerjoe
#85380
btidey wrote:Information on the RTC clock is a bit hard to come by but I found the information on the system_get_rtc_time call which indicates the period of the RTC is approximately 5.75uS or 173kHz which makes sense for the range of a slow speed RTC clock.

If one now takes a 31 bit counter (2147483648) then this would give a maximum period of 12,348 seconds or 3.4 hours.

So my improved guess of what is going on is that the sleep time in microseconds is converted into RTC periods and then used to either set a comparison value for the RTC time when sleep should end or set up a counter. RTC time is actually an unsigned 32 bit value but maybe there was a hardware reason why the sleep was restricted to 31 bits of RTC.

Hi btidey,
I edited the codes sleep time on one test sensor last night before bed for 2 hours and checked it online this morning and it was like clock work checking in at just under every 2 hours.
I may just use 1 hour increments for now and if needed I'll go to 2 hours to save battery life even more.
Thank you both again for the help,
This noob appreciates it.
User avatar
By hackerjoe
#85390
davydnorris wrote:That code should work ok. You will need to do two things:

- increase the value to 3600 for an hour of sleep
- connect the RST to GPIO16 using a Schotty diode. A wire works but will prevent auto flashing from working, and resistors will have mixed results depending on the state of your battery. A diode gets the most consistent results while still allowing you to auto flash your chip.

The the following topic: https://www.esp8266.com/viewtopic.php?p=73516

Thanks for the trick using the diode. :D
I had a few different ones but the first one I tried work, that is after I turned it the other way.
50-50 chance :shock: I got the direction wrong the first try LOL :lol: