I’m trying to configure my Electron Asset Tracker 3G v2 to report its location at regular intervals and enter SLEEP_MODE_DEEP otherwise.
This works for the first few intervals, but soon the device hangs on wake: it’s unresponsive over serial, the LED is solid white, the GPS module stays on with blinking SAT FIX LED indicating a fix, and the device never goes back to sleep. Pushing the reset button breaks it out of this state, but it eventually happens again.
The problem happens with both the internal antenna and an active external one, but it occurs much faster with an external antenna (after 10-20 minutes vs. 8 hours). When I leave the GPS off, everything is fine: the device is always able to wake up, connect to the cell network, publish an event, and go back to sleep.
Here’s a simplified example that still causes the problem. I’m using AssetTrackerRK, but it happens with the official AssetTracker library as well. I’ve also tried adding delays in various places, which didn’t work.
#include <AssetTrackerRK.h>
SYSTEM_MODE(SEMI_AUTOMATIC);
AssetTracker t;
FuelGauge fuel;
void setup() {
t.gpsOn();
Particle.connect();
}
void loop() {
t.updateGPS();
if (t.gpsFix() || millis() > 120 * 1000) {
if (t.gpsFix()) {
Particle.publish("g", t.readLatLon(), PRIVATE, NO_ACK);
}
Particle.publish("b", String::format("%.0f", fuel.getSoC()), PRIVATE, NO_ACK);
Particle.process();
System.sleep(SLEEP_MODE_DEEP, 5 * 60);
}
Has anyone seen this before or have suggestions for debugging? Thanks!