sleep() [ Sleep ]
STOP (SystemSleepMode)
SystemSleepMode::STOP, STOP, SystemSleepMode.STOP
// EXAMPLE
SystemSleepConfiguration config;
config.mode(SystemSleepMode::STOP)
.gpio(WKP, RISING)
.duration(15min);
System.sleep(config);
// EXAMPLE
SystemSleepConfiguration config;
config.mode(SystemSleepMode::STOP)
.network(NETWORK_INTERFACE_CELLULAR)
.flag(SystemSleepFlag::WAIT_CLOUD)
.duration(15min);
The SystemSleepMode::STOP
mode is the same as the classic stop sleep mode (pin or pin + time).
- Real-time clock (RTC) is kept running.
- Network is optionally kept running for cellular, similar to
SLEEP_NETWORK_STANDBY
. - On the Argon, network can optionally be kept running for Wi-Fi.
- BLE is kept on if used as a wake-up source (Gen 3 devices only).
- UART, ADC are only kept on if used as a wake-up source.
- GPIO are kept on; OUTPUT pins retain their HIGH or LOW voltage level during sleep.
- Can wake from: Time, GPIO, analog, serial, and cellular. On Gen 3 also BLE and Wi-Fi.
- On wake, execution continues after the the
System.sleep()
command with all local and global variables intact.
Wake Mode | Gen 2 | Gen 3 |
---|---|---|
GPIO | ✓ | ✓ |
Time (RTC) | ✓ | ✓ |
Analog | ✓ | ✓ |
Serial | ✓ | ✓ |
BLE | ✓ | |
Cellular | ✓ | ✓ |
Wi-Fi | ✓ |
Typical power consumption in STOP sleep mode, based on the wakeup source:
Device | GPIO | RTC | Analog | Serial | BLE | Network |
---|---|---|---|---|---|---|
T523 Eval | 872 uA | 873 uA | 852 uA | 840 uA | 919 uA | 21.5 mA |
T402 Eval | 807 uA | 835 uA | 831 uA | 798 uA | 858 uA | 17.2 mA |
Boron 2G/3G | 631 uA | 607 uA | 585 uA | 606 uA | 907 uA | 15.6 mA |
Boron LTE | 575 uA | 584 uA | 577 uA | 587 uA | 885 uA | 12.1 mA |
B402 SoM | 555 uA | 556 uA | 557 uA | 556 uA | 631 uA | 9.7 mA |
B523 SoM | 538 uA | 537 uA | 537 uA | 537 uA | 604 uA | 23.1 mA |
P2 | 579 uA | 572 uA | ||||
Argon | 396 uA | 398 uA | 398 uA | 397 uA | 441 uA | 22.2 mA |
Electron | 2.40 mA | 2.53 mA | 6.03 mA | 13.1 mA | n/a | 28.1 mA |
Photon | 2.75 mA | 2.82 mA | 7.56 mA | 18.2 mA | n/a | n/a |
Cellular Devices (B Series SoM, Tracker SoM, Tracker One, Boron, E404X, E Series, and Electron):
On cellular devices, wake-on network can be enabled in STOP mode. This is recommended for any sleep duration of less than 10 minutes as it keeps the modem active while in sleep mode.
You should avoid powering off and on the cellular modem in periods of less than 10 minutes. Since the cellular modem needs to reconnect to the cellular network on wake, your mobile carrier may ban your SIM card from the network for aggressive reconnection if you reconnect more than approximately 6 times per hour.