I’m using the Electron with Asset Tracker v2, and am currently having a lot of success with the AssetTrackerRK library. I am broadcasting GPS coordinates at a regular interval in an environment with water, so the device is screwed into the waterproof case while in use. I would like to use POST functions from a web app to facilitate power saving functions when the operator is not actively using the GPS broadcast throughout the day (i.e.: let the operator tell the device when to broadcast, and save power when it’s not needed). The battery would be recharged at the end of the day. Based on other forum topics, I understand that none of the sleep modes will work because the device is not awake to listen for a function call.
Here are the ideas I’ve come up with after reading lots of forum posts:
Use a function to start/stop publishing events (will this save power?)
Turn on/off the GPS module only (will this save power?)
An Idle mode is referenced in @rickkas7’s article on sleep modes, but can’t find documentation on it…
Use sleep mode with a wakeup interval (say… 10 minutes), if a POST function call has not set a variable in the meantime then go back to sleep (and set operator expectations that there could be up to a 10 minute lag for the device to wake up)
You can actually turn the GPS off. Within a day and still powered by the Electron LiPo it will do a warm start but it will still take a few seconds to get a fix.
You can use a GPS sleep mode to reduce power consumption. The AssetTracker and AssetTrackerRK libraries do not support this, but the u-blox M8 does.
However, by far the largest user of power the the STM32F205 processor, at least when you're not actively transmitting cellular data.
You can use stop mode sleep (pin + time) along SLEEP_NETWORK_STANDBY so the cellular modem is still on, with the Wake on RI feature, and the processor will wake up on a Particle function call from the cloud.
This only works on the Electron and E Series (Gen 2) on 2G/3G devices. It does not work on Gen 2 LTE devices. It does not currently work on Gen 3 devices (Argon/Boron/Xenon) though it probably could with a change within Device OS.
This was exactly what I needed and it worked on the first try. I am powering off the GPS and using SLEEP_NETWORK_STANDBY for sleep mode, then using a function call to wake and turning the GPS back on. I plan to incorporate another function to change the sleep time from the UI. I really struggled to wrap my head around this and it turned out to be pretty simple, so here’s all the components of my code in case it helps anyone else.
Setup (using AssetTrackerRK) and my savePower function