So i’ve got an Electron and AssetTracker v2 from a while back, and finally getting around to using it. I’m using the AssetTrackerRK library (though the problem also seemed to be there in the regular Asset Tracker library as well, but more pronounced).
Using the 3_WakeOnMove example, it seems to be working just fine, as long as once it’s detected its no longer moving, it stays still.
if (accel.calibrateFilter(2000, 10000)) {
// We've stopped moving and the accelerometer is calibrated
// Uncomment this line to power down the GPS. It saves power but will increase the amount
// of time to get a fix.
digitalWrite(D6, HIGH);
Serial.println("going to sleep");
delay(500);
// If you use SLEEP_MODE_DEEP it's very important to make sure WKP is LOW before going to
// sleep. If you go into SLEEP_MODE_DEEP with WKP high you will likely never wake up again
// (until reset).
if (digitalRead(WKP)) {
// Try to calibrate again
break;
}
// Sleep
System.sleep(WKP, RISING, TIME_PUBLISH_BATTERY_SEC, SLEEP_NETWORK_STANDBY);
So here, if i stop moving the device long enough for the GPS to turn off, but start moving it BEFORE it goes to sleep, it wont wake back up.
If i stop moving it, and leave it still, it will wake up every time.
I’m really not sure where the problem here is. I’ve tried adding a digitalWrite(WKP,LOW) between the GPS off and sleep, but that didn’t seem to do anything.
edit:
It wakes up after the TIME_PUBLISH_BATTERY_SEC interval (22 minutes), and will wake on move after is sleeps again, until it gets “locked” like above again