Post topics, source code that relate to the Arduino Platform

User avatar
By longinus
#1688
al1fch wrote:I'll look at your code to see how you deal with sleep/awake


Just using a function that sets the watchdog and goes to sleep for x milliseconds... the watchdog will wakeup every 8 seconds, subtract the number and go back to sleep. This is widely inaccurate for the amount of time I'm sleeping.. I've set it for 5 minutes, but it will usually take about 5:30 or sometimes 6...
I probably could also sleep instead of using delays when it's waiting for the esp8266 module... that could save some power.

I've noticed that you re-connect to your wifi every time... I don't think you need to do that, since it saves the AP configuration. That will make it slightly faster.
Though I actually check if the module is indeed connected or not, then connect it if necessarily... just in case.