meshtastic/docs/software/device/power.md

37 lines
2.3 KiB
Markdown
Raw Normal View History

2021-05-01 10:51:51 -07:00
---
id: device-power
title: Power Management State Machine
sidebar_label: Power Management
---
Long battery life is one of the main goals of this project. Based on initial measurements, the current code should run for about three days between charging (assuming using a t-beam with a 3500mAh 18650 battery). This will hopefully be increased to around eight days in the future.
2021-05-01 10:51:51 -07:00
## States
From lower to higher power consumption.
2022-01-02 22:53:45 -08:00
- Super-Deep-Sleep (SDS) - Everything is off, CPU, radio, Bluetooth, and GPS. It only wakes due to timer or button press. We enter this mode only after no radio comms for a few hours - used to put the device into what is effectively "off" mode.
2021-05-01 10:51:51 -07:00
* onEntry: setBluetoothOn(false), call doDeepSleep
* onExit: (standard bootup code, starts in DARK)
2022-01-02 22:53:45 -08:00
- Deep-Sleep (DS) - CPU is off, radio is on, Bluetooth and GPS are off. Note: This mode is never used currently, because it only saves 1.5mA vs Light-Sleep - (Not currently used).
- Light-Sleep (LS) - CPU is suspended (RAM stays alive), radio is on, Bluetooth is off, and GPS is off. Note: currently GPS is not turned off during light sleep, but there is a TODO item to fix this.
2021-05-01 10:51:51 -07:00
* NOTE: On NRF52 platforms (because CPU current draw is so low), light-sleep state is never used.
* onEntry: setBluetoothOn(false), setGPSPower(false), doLightSleep()
* onIdle: (if we wake because our led blink timer has expired) blink the led then go back to sleep until we sleep for ls_secs
* onExit: setGPSPower(true), start trying to get GPS lock: gps.startLock(), once lock arrives service.sendPosition(BROADCAST)
2022-01-02 22:53:45 -08:00
- No Bluetooth (NB) - CPU is running, radio is on, GPS is on, Bluetooth is off, and screen is off.
2021-05-01 10:51:51 -07:00
* onEntry: setBluetoothOn(false)
* onExit:
2022-01-02 22:53:45 -08:00
- Running Dark (DARK) - Everything is on except screen.
2021-05-01 10:51:51 -07:00
* onEntry: setBluetoothOn(true)
* onExit:
2022-01-02 22:53:45 -08:00
- Serial API usage (SERIAL) - Screen is on, device doesn't sleep, and Bluetooth is off.
2021-05-01 10:51:51 -07:00
* onEntry: setBluetooth off, screen on
* onExit:
2022-01-02 22:53:45 -08:00
- Full On (ON) - Everything is on, can eventually timeout and transition to a lower power state.
2021-05-01 10:51:51 -07:00
* onEntry: setBluetoothOn(true), screen.setOn(true)
* onExit: screen->setOn(false)
2022-01-02 22:53:45 -08:00
- Has Power (POWER) - Screen is on, device doesn't sleep, Bluetooth on, and will stay in this state as long as we have power.
2021-05-01 10:51:51 -07:00
* onEntry: setBluetooth off, screen on
2022-01-02 22:53:45 -08:00
* onExit: