# Boron LTE waking up from sleep mode

**URL:** <https://community.particle.io/t/boron-lte-waking-up-from-sleep-mode/64050>\
**Category:** Firmware\
**Tags:** boron\
**Created:** [February 23, 2023, 4:06am UTC](https://community.particle.io/t/boron-lte-waking-up-from-sleep-mode/64050 "2023-02-23T04:06:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hparris3980](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@hparris3980](https://community.particle.io/u/hparris3980)\
**Post date:** [February 23, 2023, 4:06am UTC](https://community.particle.io/t/boron-lte-waking-up-from-sleep-mode/64050/1 "2023-02-23T04:06:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [February 23, 2023, 10:42am UTC](https://community.particle.io/t/boron-lte-waking-up-from-sleep-mode/64050/2 "2023-02-23T10:42:36Z")

</div>

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](https://docs.particle.io/reference/device-os/api/sleep-sleep/ultra_low_power-systemsleepmode/) 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.

---

<div class="post-metadata">

**Author:** ![hparris3980](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@hparris3980](https://community.particle.io/u/hparris3980)\
**Post date:** [February 23, 2023, 3:02pm UTC](https://community.particle.io/t/boron-lte-waking-up-from-sleep-mode/64050/3 "2023-02-23T15:02:51Z")

</div>

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?

```auto
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`

---

<div class="post-metadata">

**Author:** ![chipmc](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/chipmc/32/15905_2.png) [@chipmc](https://community.particle.io/u/chipmc)\
**Post date:** [February 23, 2023, 3:16pm UTC](https://community.particle.io/t/boron-lte-waking-up-from-sleep-mode/64050/4 "2023-02-23T15:16:41Z")

</div>

@hparris3980 ,

It could look like this:

```auto
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

---

<div class="post-metadata">

**Author:** ![hparris3980](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@hparris3980](https://community.particle.io/u/hparris3980)\
**Post date:** [February 23, 2023, 11:28pm UTC](https://community.particle.io/t/boron-lte-waking-up-from-sleep-mode/64050/5 "2023-02-23T23:28:18Z")

</div>

That worked exactly like I was hoping. Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/3/2/3291e3c9351789fe8620ae5bcec8d3fec67ff221.png) [@system](https://community.particle.io/u/system)\
**Post date:** [August 25, 2023, 11:28am UTC](https://community.particle.io/t/boron-lte-waking-up-from-sleep-mode/64050/6 "2023-08-25T11:28:34Z")

</div>

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