pm5: hw bwm ble, the module's BLE settings incl. on/off and pairing

The module ships with BLE open: anyone in range can connect and run
commands, and there was no way to turn the radio off or to require
pairing from the PM5, although the module already implements bonding
with a static passkey (LE Secure Connections + MITM, SPP characteristic
encrypted) behind commands nothing exposed.

New CMD_PM5_BWM_BLE (0x0183): one action byte, then a full status
snapshot back (bwm_ble_status_t: switch, state, bonding, passkey, TX
power, address, name, bonded devices). Client menu `hw bwm ble`:
  status              everything above, with a warning while open
  on | off            persisted radio switch (needs the companion
                      Proxmark5_BWM_esp32 PR; off =
                      nothing can connect, USB/WiFi only)
  pairing on|off [-k] require the 6-digit passkey, set the passkey; a
                      change of on/off restarts the stack (drops a
                      connected client), the factory key 123456 is
                      flagged
  forget -i N | --all remove bonded devices
  txpower -a/-c dBm   advertising / connection power, -24..18 and 20

The firmware replies before restarting the stack so the reply survives
when the command itself arrived over BLE. Fields a module without the
switch cannot answer read 0xFF and print as unknown. A module that does
not answer at all ends the status snapshot after its first query instead
of running into the client's timeout.

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:47 +02:00
1 parent 465cb47b5a
commit 39bbf20cce
8 files changed
+589 -2

No files matched your search

+84 -2
View File
@@ -11030,6 +11030,88 @@
],
"usage": "hw break [-h]"
},
"hw bwm ble forget": {
"command": "hw bwm ble forget",
"description": "Remove bonded (paired) devices from the module, so they must pair again with the passkey. Indexes are the ones `hw bwm ble status` lists.",
"notes": [
"hw bwm ble forget --all",
"hw bwm ble forget -i 0"
],
"offline": false,
"options": [
"-h, --help This help",
"-i, --idx <dec> index of the bonded device to remove",
"--all remove all bonded devices"
],
"usage": "hw bwm ble forget [-h] [-i <dec>] [--all]"
},
"hw bwm ble help": {
"command": "hw bwm ble help",
"description": "help This help --------------------------------------------------------------------------------------- hw bwm ble status available offline: no Show the module's BLE settings: on/off, name, address, pairing and passkey, bonded devices, TX power.",
"notes": [
"hw bwm ble status"
],
"offline": true,
"options": [
"-h, --help This help"
],
"usage": "hw bwm ble status [-h]"
},
"hw bwm ble off": {
"command": "hw bwm ble off",
"description": "Switch the module's BLE radio on or off. Persisted on the module, applied at once. Off means nothing can connect over BLE at all; the PM5 stays reachable over USB (and WiFi if configured). Needs a BWM firmware with the BLE switch. Over BLE, `off` cuts your own connection.",
"notes": [
"hw bwm ble off"
],
"offline": false,
"options": [
"-h, --help This help"
],
"usage": "hw bwm ble off [-h]"
},
"hw bwm ble on": {
"command": "hw bwm ble on",
"description": "Switch the module's BLE radio on or off. Persisted on the module, applied at once. Off means nothing can connect over BLE at all; the PM5 stays reachable over USB (and WiFi if configured). Needs a BWM firmware with the BLE switch. Over BLE, `off` cuts your own connection.",
"notes": [
"hw bwm ble on"
],
"offline": false,
"options": [
"-h, --help This help"
],
"usage": "hw bwm ble on [-h]"
},
"hw bwm ble pairing": {
"command": "hw bwm ble pairing",
"description": "Require pairing before a BLE client can use the device. The module ships with pairing off: anyone in range can connect and run commands. With it on, a client must pair once with the 6-digit passkey (LE Secure Connections, MITM) and the data characteristic only works over the encrypted link; paired (bonded) devices reconnect without the key until you forget them. Both settings persist on the module. A change of on/off restarts the BLE stack, which drops a connected client - reconnect (and pair) afterwards. The factory passkey is 123456; set your own.",
"notes": [
"hw bwm ble pairing on -> require pairing",
"hw bwm ble pairing on -k 482913 -> require pairing with this passkey",
"hw bwm ble pairing -k 482913 -> change the passkey only",
"hw bwm ble pairing off -> open access again"
],
"offline": false,
"options": [
"-h, --help This help",
"-k, --key <6 digits> passkey a client must enter"
],
"usage": "hw bwm ble pairing [-h] [-k <6 digits>]"
},
"hw bwm ble txpower": {
"command": "hw bwm ble txpower",
"description": "Set the module's BLE transmit power for advertising and/or connections. Steps of 3 dB from -24 to 18 dBm, plus 20. Lower saves a little battery and shrinks the range at which the device can be found. Persisted on the module.",
"notes": [
"hw bwm ble txpower -a 0 -c 0 -> 0 dBm for both",
"hw bwm ble txpower -a -6 -> quieter advertising only"
],
"offline": false,
"options": [
"-h, --help This help",
"-a, --adv <dBm> advertising power",
"-c, --conn <dBm> connection power"
],
"usage": "hw bwm ble txpower [-h] [-a <dBm>] [-c <dBm>]"
},
"hw bwm charge": {
"command": "hw bwm charge",
"description": "Enable or disable BWM battery charging by clearing/setting the AW32001E charge-enable bit (CEB, REG01[3]). PM5 only. One-shot: the charger watchdog reverts this after ~160 s unless serviced, so charging may stop on its own. Use to nudge a top-up.",
@@ -16700,8 +16782,8 @@
}
},
"metadata": {
"commands_extracted": 929,
"commands_extracted": 935,
"extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2026-09-24T08:31:45+00:00"
"extracted_on": "2026-09-24T08:32:19+00:00"
}
}
+15
View File
@@ -1059,6 +1059,21 @@ Check column "offline" for their availability.
|`hw bwm wifipower `|N |`WiFi fully off, or the modem power-save type (none/min/max)`
### hw bwm ble
{ BLE: on/off, pairing, bonded devices, TX power... }
|command |offline |description
|------- |------- |-----------
|`hw bwm ble help `|Y |`This help`
|`hw bwm ble status `|N |`Show BLE settings: on/off, pairing, bonded devices, TX power`
|`hw bwm ble on `|N |`Switch BLE on (persisted)`
|`hw bwm ble off `|N |`Switch BLE off (persisted) - nothing can connect`
|`hw bwm ble pairing `|N |`Require pairing with a passkey, set the passkey`
|`hw bwm ble forget `|N |`Remove bonded devices`
|`hw bwm ble txpower `|N |`Set advertising / connection TX power`
### lf
{ Low frequency commands... }