Boron LTE waking up from sleep mode

Apologies if this is something that has already been asked or is a silly question.

I’m trying to get the Boron into sleep mode. I don’t care which one, I would just like for the RTC to still be on.

So far I’ve just called functions like System.sleep(SLEEP_MODE_DEEP, 5); System.sleep(SLEEP_MODE_SOFTPOWEROFF, 10); and System.sleep(SLEEP_MODE_DEEP, 30);

I can’t seem to wake the board back up. It stays in a breathing white indicator LED. I think my problem is that I don’t really understand how the sleep modes work, and how to call it in my code, so any help would be appreciated.

Neither of those commands will allow a wake with time on the Boron. Both are the equivalent of HIBERNATE sleep mode, and the RTC does not run in that mode so you can’t wake by time.

You should switch to using ULP sleep mode using the current API. Add a duration as well.

Also, you probably do not want to sleep with cellular off for less than 10 minutes, as your SIM may eventually get banned for aggressive reconnection.

2 Likes

Thanks for the response, I’m still a little confused about how I call the ULTRA_LOW_POWER and give it a time variable for wake up.

Do I just put this block of code in my program?

SystemSleepConfiguration config;
config.mode(SystemSleepMode::ULTRA_LOW_POWER)
      .gpio(D2, FALLING);
System.sleep(config);

Or do I need to call System.sleep(ULTRA_LOW_POWER, time interval); somewhere? My code isn’t recognizing ULTRA_LOW_POWER

@hparris3980 ,

It could look like this:

int wakeInSeconds = secondsUntilNextEvent(); // Figure out how long to sleep 
config.mode(SystemSleepMode::ULTRA_LOW_POWER)
   .gpio(D2, FALLING)
   .duration(wakeInSeconds* 1000L);		     // Set seconds until wake
// Ready to sleep
SystemSleepResult result = System.sleep(config);    // Device sleeps here

if (result.wakeupPin() == D2) {              // Woke by pin interrupt
   // pin wake code here
}
else {                                       // Woke by time
   // time wake code here
}

Hope this helps.

Chip

3 Likes

That worked exactly like I was hoping. Thank you!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.