I have been testing different methods of reducing Core power consumption for one of my projects. The project is required to take measurements every minute and publish them. I have tested three different approaches to reducing power:
Start with wifi/cloud OFF, wait 1 minute, sample the data, turn ON wifi/cloud publish then turn off wifi/cloud and loop. This works fine and most of the time, wifi comes up fine and sometimes I get flashing red but it will connect and publish.
Same idea but instead of controlling wifi/cloud, just use Spark.sleep(60) to put the core to sleep for 60 seconds at the end of the loop. However, Spark.sleep(60) is not blocking and does NOT “put the core to sleep” as documented. From what I can see, this sleep mode disables wifi for 60 seconds in the background, exactly like WiFi.off() does. This function may need to be rethought or properly documented.
Same as 2 but use Spark.sleep(SLEEP_MODE_DEEP,60) to put the core in standby at the end of the loop. This seems to work well, however wifi often blinks red after blinking green. Nonetheless, it always seem to connect (eventually) and publish. The extra connection time is also the time when the CC3000 consumes the most current.
So, I believe Spark.sleep() needs to be looked at a bit more. It would be good to understand the re-connection “glitches” after coming out of sleep cause any delay in connecting increases the overall power consumption (at least in my simple case).
Has anyone else worked with Spark.sleep() and willing to share their experience?