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
| State | Description |
|---|---|
timer | Sleep countdown timer |
preventSource | Source preventing the BMS from sleeping (positive: hardware, negative: software) |
wakeSources | Wake 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.
| Value | Source | Description |
|---|---|---|
0x0001 | CAN | CAN bus activity |
0x0002 | UART | UART activity |
0x0004 | USB | USB connection |
0x0010 | RTC | Real-time clock alarm |
0x0020 | DSC | Discharge port activity |
0x0040 | CHG | Charge port activity |
0x0080 | DSC_CHARGE | Charging through the discharge port |
0x0100 | BAL_ALRT | Balancer alert |
0x0200 | BAL_UPD | Balancer update |
0x0400 | BAL_SCAN | Balancer scan |
0x0800 | STATE_CHANGED | State changed during sleep |
0x1000 | BTN | Button press |
0x2000 | KEY | Key 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
| Command | Description |
|---|---|
awake | Stay awake for a specified duration |