pm5: hw bwm powersave

New `hw bwm powersave [on|off]` (CMD_PM5_BWM_POWERSAVE 0x0181) shows or
sets the ESP's persisted power-save switch (companion Proxmark5_BWM_esp32
PR: DFS, light sleep and slow advertising after a 30 s fast phase, or
the stock always-on behaviour), so the two can be A/B measured and the
saving turned off when chasing a link problem. `hw status` prints the
state next to the BWM firmware version.

Both module queries in `hw status` are time-bounded (version 2 x 800 ms,
power save 300 ms): a module that is silent, or a firmware without the
command, cannot push the report past the client's timeout.

Verified on hardware: state read/set/persist across an ESP reboot,
`hw status` after 4, 15 and 40 s idle in power-save mode and after 6 s
idle with it off.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
MsprgandClaude Fable 5.1 committed 2026-09-24 10:33:46 +02:00
1 parent 4f4acedbdd
commit 552276c75f
8 files changed
+148 -11

No files matched your search

+18 -4
View File
@@ -11045,12 +11045,12 @@
},
"hw bwm help": {
"command": "hw bwm help",
"description": "--------------------------------------------------------------------------------------- hw bwm autooff available offline: no Toggle automatic power-off when the PM5 is unplugged from USB (BWM only). Default is on. When on, the board powers itself down ~10s after USB is removed, so a BWM-equipped PM5 doesn't silently drain the battery. Button power-on is unaffected. Disable for standalone/BLE use on battery. Runtime only: resets to on at each boot.",
"description": "help This help --------------------------------------------------------------------------------------- hw bwm autooff available offline: no Toggle automatic power-off when the PM5 is unplugged from USB (BWM only). Default is on. When on, the board powers itself down ~10s after USB is removed, so a BWM-equipped PM5 doesn't silently drain the battery. Button power-on is unaffected. Disable for standalone/BLE use on battery. Runtime only: resets to on at each boot.",
"notes": [
"hw bwm autooff off -> disable auto power-off",
"hw bwm autooff on -> re-enable auto power-off"
],
"offline": false,
"offline": true,
"options": [
"-h, --help This help"
],
@@ -11070,6 +11070,20 @@
],
"usage": "hw bwm name [-h] [--set <name>]"
},
"hw bwm powersave": {
"command": "hw bwm powersave",
"description": "Show or set the BWM (ESP32) power-save switch, stored on the BWM in NVS. Default is on: the ESP scales its clock down, light-sleeps between link traffic, and after 30 s of fast advertising (boot, disconnect) advertises once a second. off pins it at full clock, no sleep, fast advertising throughout. Applies at once and survives reboots. PM5 only.",
"notes": [
"hw bwm powersave -> show the current state",
"hw bwm powersave off -> stock always-on behaviour",
"hw bwm powersave on -> re-enable power saving"
],
"offline": false,
"options": [
"-h, --help This help"
],
"usage": "hw bwm powersave [-h]"
},
"hw bwm setcap": {
"command": "hw bwm setcap",
"description": "Program the BWM fuel gauge (BQ27427) Design Capacity for the fitted cell. Run ONCE after fitting or replacing the battery. This triggers a gauge config-update; do not run it repeatedly, as that disrupts the Impedance Track learning cycle. PM5 only.",
@@ -16664,8 +16678,8 @@
}
},
"metadata": {
"commands_extracted": 927,
"commands_extracted": 928,
"extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2026-09-24T08:29:44+00:00"
"extracted_on": "2026-09-24T08:30:13+00:00"
}
}
+2 -1
View File
@@ -1047,10 +1047,11 @@ Check column "offline" for their availability.
|command |offline |description
|------- |------- |-----------
|`hw bwm help `|N |`This help`
|`hw bwm help `|Y |`This help`
|`hw bwm autooff `|N |`Toggle auto power-off on USB unplug`
|`hw bwm charge `|N |`Enable/disable battery charging (one-shot)`
|`hw bwm name `|N |`Get/set the BWM BLE advertising name`
|`hw bwm powersave `|N |`Show/set the BWM power-save switch (DFS, light sleep, slow adv)`
|`hw bwm setcap `|N |`Set fuel-gauge design capacity (run once after battery change)`
|`hw bwm upgrade `|N |`Reflash BWM (ESP32) firmware over the BWM link, no header`
|`hw bwm vchg `|N |`Set charger charge-voltage target (default 4100 mV)`