Chat freely about anything...

User avatar
By cheburashka
#46485 I have a board that deep sleeps between taking measurements. The problem there is that it is given 20 seconds to sleep, it does, so to speak, it think it does. But not to the real world.

So, there are 2 clocks. One internal within the board that sleeps, one within the computer it communicates with. When board goes to sleep, it counts to 20 seconds and wakes up. However, while the count is correct, the time in the real world differs more and more with each deep sleep. Observe: http://pastebin.com/HqvcPXTp

The board that sleeps communicates to my computer this data: RTCtime (time that keeps counting through sleep), and regular up time (since it woken up). As you see, the board shows that it sleeps pretty much 20 seconds, give or take a few. It communicates with the computer within like 4 seconds since it wakes up. However, the always on computer shows a difference in seconds between each communication. It becomes more and more pronounced that the sleep becomes longer, the sleeping board still thinks it sleeps only 20 seconds, but the always on computer now counts 1000 seconds between each communication.

It is like my sleeping board is a satellite rushing through space at enormous speeds approaching speed of light. As it gets faster, the time dilation happens..

Well, jokes aside... Did I get a buggy board?

Here is my code in Lua:

Client that sleeps: http://pastebin.com/7m7GbWWT

The server that stays up: http://pastebin.com/nZu4vzCM

Note that I changed wifi id and password, if you run, make sure password is at least 8 chars.
User avatar
By Andrel
#54817 I have the same problem here. My main concern is that the drift is not constant, else I would be able to compensate.

On a 10 minute deepsleep, the drift is about 13 seconds, while on a 20 seconds deepsleep it is about 256ms.

Anyone has solution to that ? A magic formula to compendate the drift based on the deepsleep time ?

Thanks,

André