Page 1 of 1

Sleep longer than 35 minutes

PostPosted: Mon Feb 15, 2016 10:51 am
by bradvoy
I have a project that is supposed to wake up once an hour, read a temperature sensor, and send the temperature to a server. It uses the statement

Code: Select allnode.dsleep(3600000000, 1)

to sleep between each reading. I noticed a while ago that it was actually only sleeping a little over half an hour. Recently I saw that the documentation at http://nodemcu.readthedocs.org/en/dev/e ... nodedsleep had been updated to note that this was the expected behavior for firmware built before 05-Jan-2016, but that firmware built since that date could support sleep times up to 71 minutes. I flashed my ESP with a new build and was happy to see that it slept for an hour. But then I noticed that it only sleeps one hour the first cycle after it's powered up. After that it only sleeps 35 minutes each time. Each cycle it is executing the same node.dsleep statement shown above. Is there a bug in the firmware where it treats node.dsleep's timeout as an unsigned value the first time but as a signed value after waking from sleep?