Hey @rickkas7, I know this is an older thread but I’m still having a problem waking up the Electron using your AssetTrackRK library.
If I don’t turn off the GPS before going to sleep (like your wake on move example does by default), then the Electron wakes up every time.
However, if I uncomment the lines in your code to turn off the GPS before sleeping, the Electron wakes up from motion once, then never again. This behavior happens every time.
Here is a code snippet of my sleep state:
case SLEEP_STATE: // Wait for Electron to stop moving for 2 seconds so we can recalibrate the accelerometer accel.calibrateFilter(2000); // Is this necessary? digitalWrite(D6, HIGH); pinMode(D6, INPUT); Serial.println("going to sleep"); delay(500); // Sleep System.sleep(WKP, RISING, TIME_PUBLISH_BATTERY_SEC, SLEEP_NETWORK_STANDBY); // This delay should not be necessary, but sometimes things don't seem to work right // immediately coming out of sleep. delay(500); awake = ((accel.clearInterrupt() & LIS3DH::INT1_SRC_IA) != 0); Serial.printlnf("awake=%d", awake); // Restart the GPS pinMode(D6, OUTPUT); digitalWrite(D6, LOW); startFix = millis(); gettingFix = true; state = GPS_WAIT_STATE; stateTime = millis(); break;
I have tried many variations of when to turn on and off the GPS, and when to clear the accel interrupt, but I haven’t had any luck.
I am using the AssetTrackerV2 and I have tried my code on system firmware versions 0.6.0 and 0.6.4.
Have you experienced this problem as well?