I’m launching my first low-power/solar application, and I’ve been reading every thread I could find. Obviously I’m missing something about how to get to 170uA.
I am able to SUCCESSFULLY get there sometimes (when booting with a supply-up) but not able to get there after a button-reset.
Main issue:
- unable to get to 170uA after button-reset in ULTRA_LOW_POWER. (720uA instead)
Side issues:
- Very odd return values from Cellular.isOff() and Cellular.isOn() – sometimes both are false
- ERRORs in the log when booting from supply-up
Setup:
- Device: Boron 2G/3G (tried 2)
- Target: 3.2.0
- Power Source: li-po
- Current Measurement method: HP-DMM in series with lipo battery
My understanding is that DeviceOS should handle shutting the interfaces and getting me to the right low power state with something like:
SystemSleepConfiguration sleepConfig;
sleepConfig.mode(SystemSleepMode::ULTRA_LOW_POWER).duration(SLEEP_TIME);
System.sleep(sleepConfig);
My trimmed back experiment code:
SYSTEM_MODE(SEMI_AUTOMATIC);
SYSTEM_THREAD(ENABLED);
SerialLogHandler logHandler(LOG_LEVEL_ALL);
#define ACTIVE_MS 10000
#define SLEEP_MS 10000
unsigned long sinceLastSleep;
void setup() {
delay(5000);
//Cellular.off();
delay(5000);
sinceLastSleep = millis();
}
void loop() {
if ( ( millis() - sinceLastSleep ) > ACTIVE_MS ) {
SystemSleepConfiguration sleepConfig;
sleepConfig.mode(SystemSleepMode::ULTRA_LOW_POWER).duration(SLEEP_MS);
System.sleep(sleepConfig);
sinceLastSleep = millis();
}
}
My current draw during ULTRA_LOW_POWER is 720uA.
What I have tried:
- Instrumenting code with custom LED states
- Connecting to USB and dumping logs for several cycles, live switching to lipo for current measurement during sleep and back to USB to get the next round of logs. Logs:
0000005288 [system.nm] TRACE: Request to power off the interface. //(when cellular.off() is used)
0000020289 [system.sleep] TRACE: Entering system_sleep_ext()
0000020289 [system.sleep] TRACE: Interface 4 is off already
0000020289 [system.sleep] TRACE: Interface 3 is off already
…
0000121129 [system.sleep] TRACE: Entering system_sleep_ext()
0000121129 [system.sleep] TRACE: Interface 4 is off already
0000121129 [system.sleep] TRACE: Interface 3 is off already
- Cellular.off() in the setup with 5s delay after. Thought this wasn’t needed as the API should shut this down.
- Booting from supply-up (no reset button) – This generates interesting and inconsistent results. Not sure if this is data or noise.
Every time I get 150uA (YAY)
Sometimes I get a clean log showing the modem powering down (and associated blue breathe)
Sometimes I get a log that loops for 2 minutes on “Deinit modem” … “Modem already off” … “Soft power off modem successfully”
I get an unexpected TRUE result from
if( Cellular.isOff() == false && Cellular.isOn() == false ) {
At this point I’m pausing as I feel I might be in the weeds. Any obvious thing I’m doing wrong here?
I could post my fully instrumented code, but that seems to make the initial post to long.
Thanks in advance, and feel free to let me know what