So I am just starting to play around with the new Sleep configuration with LTS 2.0.1. I had 2 questions was hoping for some guidance on. 1) Do we still need to execute a “disconnectFromParticle()” with something like what’s shown below to reach lowest power sleep. This was referenced in the earlier version of system.sleep() before 2.0 as a way to reach lowest power consumption. It’s what I’ve been using previously. Just didn’t know if I can clean it up and just use the new version of SystemSleepConfiguration config or do i need to keep this before falling asleep.
bool disconnectFromParticle() // Ensures we disconnect cleanly from Particle
{
Particle.disconnect();
waitFor(notConnected, 15000); // make sure before turning off the cellular modem
Cellular.off();
delay(2000); // Bummer but only should happen once an hour
return true;
}
- Any clear guidance on what the threshold would be where a person is better off to keep the network on with .network(NETWORK_INTERFACE_CELLULAR, SystemSleepNetworkFlag::INACTIVE_STANDBY) vs turning it off if the goal was for maximum battery life? Is there a magical number of minutes where it makes more sense to turn network off?
I know the docs say les than 10 minutes keep the network up to prevent your SIM from being banned for aggressively reconnecting to the cellular network and after 23 minutes the keep alive would of expired which extends the reconnection time. But my question is what about durations of time > 10 minutes and less than 23 minutes? What would be the threshold where it’s better to turn network off and sleep vs keeping network on? I also understand you will get better battery life if you reconnect every 20 minutes 3x per hour rather than every 30 minutes or 2X per hour simply due to longer handshake required due to the keep alive time expiring.
Today I take readings and fall back asleep every 5 minutes and then on the 4th cycle of this (i.e. every 20 minutes before the keep alive expires) it turns on cellular, connects to the cloud, publishes the all the readings it took and then falls back asleep. My goal is to maximum battery life but still provide readings at a minimum every 20 minutes. Should I sleep with keeping network on and send data every 5 minutes, or keep doing what I’m doing and only turn cellular on every 20 minutes?
Does this just depend mostly on how good of cellular coverage it has which determines how fast the reconnect is? I.e. if a device is in a weak cellular coverage area it seems like it could take 2-3 minutes at times to connect. During this entire time, it’s using up a lot of power. rather in this scenario, am I better off leaving network on? vs. a device near a cell tower may only take 20 seconds to reconnect.
Finally, does anyone have economical recommendations you have for hardware I can use to properly measure power consumption to test different scenarios.
Here is what I plan on using:
// EXAMPLE 2
SystemSleepConfiguration config;
config.mode(SystemSleepMode::ULTRA_LOW_POWER)
.duration(15min)
.network(NETWORK_INTERFACE_CELLULAR, SystemSleepNetworkFlag::INACTIVE_STANDBY);