I was testing out sleep modes on an Argon with a USB power meter and it appears to be using far more power when sleeping than not. Roughly 20mA when connected and looping and 70mA when sleeping. Does the power saving benefits of sleep not work when using USB power? The device does appear to sleep, the light goes off and checking sleepResult after shows an RTC wake.
Here’s a simplified example that stays awake for 60sec then sleeps for 60sec.
I can confirm that this is the behaviour of the Argon. As far as I have understood it, the Wifi module is not powered down during sleep and maybe the Wifi module gets confused when the host processor stops responding. However measuring the Power use with an Otii Power Usage Analyzer gives a graph like this
@Fragma, the Particle folks are aware of some race conditions when going into sleep on Gen 3 devices, that may leave the NCP in a powered state. The fix will most likely be released in an upcoming release along with other power reduction enhancements.
Any update? Just confirmed this is still an issue with 1.2.1. Having my device use a 1min on / 5min sleep cycle resulted in double the power use of 100% on.
Found a workaround is to add this just before sleep:
WiFi.off();
delay(250);
Oddly you don’t need to turn it back on after sleep, at least not in the default mode. I’m not sure if there’s a way to do this dynamically but after trying different delays it looks like it takes ~180ms to shut off the wifi completely, so I figured 250ms was a safe bet to allow for some variation.
We have seen the same, although we made it a bit more complicated for us. After disconnecting from tha cloud and shutting off WiFi we got the sleep power consumption to be as low as 600uA, but that came to the cost of a memory leek, see Memory leak in Argon doing WiFi.off() / WiFi.on() and Boron doing Cellular.off() / Cellular.on() .
This has been fixed after adding a delay for 15s after shutting off the WiFi, before going to sleep. We will look further into optimizing this.
This issue still exists with system firmware 2.0.0 and the prior workaround no longer works. But the good news is that the new sleep system doesn’t seem to have the issue, this is working for me: