firmware
firmware copied to clipboard
fix(HeavyButter): power down radios during sleep and fix broken deep sleep (AV-002/003)
HeavyButter Security Audit — Fix AV-002 / AV-003
Finding AV-002 (Fake Sleep): When the user presses "Sleep," only the display backlight turns off. All radios (WiFi, BLE, Sub-GHz, NRF24, IR, RFID) stay powered and active. The device remains on the network.
Finding AV-003 (Broken Deep Sleep): DEEPSLEEP_WAKEUP_PIN defaulted to -1 in precompiler_flags.h:264, which disables deep sleep on any board that does not explicitly define it. Most boards do not.
Fixes:
include/precompiler_flags.h: Changed defaultDEEPSLEEP_WAKEUP_PINfrom-1to0(BOOT button, available on all ESP32 dev boards)src/core/mykeyboard.cpp(goToDeepSleep()): AddedWiFi.mode(WIFI_OFF)+esp_bt_controller_deinit()before entering deep sleepsrc/core/settings.cpp(setSleepMode()): Same radio power-down before light sleep
Impact: Sleep now actually powers down radios. Deep sleep works on boards without explicit pin config. Device is no longer a persistent network beacon when the user thinks it is off.
Reference: Forensic audit issue #2511 — HeavyButter (r13xr13)