Skip to main content
Firmware Stable

Sleep and wake

The BMS has a low-power sleep mode to minimize battery drain when the system is not in use. During sleep, most peripherals are powered down and the BMS waits for a wake event from one of several configurable sources.

info

All mentioned variables are located in folder /driver/sleep/.

States

StateDescription
timerSleep countdown timer
preventSourceSource preventing the BMS from sleeping (positive: hardware, negative: software)
wakeSourcesWake source history array. The first entry is the source of the last wake

Wake sources

The BMS can be woken from sleep by the following sources. The wakeSources state stores a history of wake events.

ValueSourceDescription
0x0001CANCAN bus activity
0x0002UARTUART activity
0x0004USBUSB connection
0x0010RTCReal-time clock alarm
0x0020DSCDischarge port activity
0x0040CHGCharge port activity
0x0080DSC_CHARGECharging through the discharge port
0x0100BAL_ALRTBalancer alert
0x0200BAL_UPDBalancer update
0x0400BAL_SCANBalancer scan
0x0800STATE_CHANGEDState changed during sleep
0x1000BTNButton press
0x2000KEYKey switch
note

If the BMS is in the ERROR state, CAN bus wake is disabled. The BMS must be woken by pressing the button before communicating with it.

Shell commands

CommandDescription
awakeStay awake for a specified duration