Skip to content

Bluetooth switch: light sleep, hide continuity, host the web client on EC2 - #220

Merged
swissskimmilk merged 1 commit into
mainfrom
aidan/firmware/bluetooth-switch-power
Nov 13, 2026
Merged

swissskimmilk merged 1 commit into
mainfrom
aidan/firmware/bluetooth-switch-power

Conversation

@swissskimmilk

Copy link
Copy Markdown
Contributor

Follow-up to #218 (merged).

Power: builds as ESP-IDF 4.4 + Arduino as a component (framework = arduino, espidf) so sdkconfig.defaults can turn on automatic light sleep and BLE modem sleep. The prebuilt Arduino core has both off, which held the radio on at ~80 mA idle. Sleeps only on battery; USB holds it awake for the console and flashing.

  • main.cpp exempts GPIO4 (arm line), CONT_EN and the LED from IDF's sleep GPIO switching, so the output can't float during light sleep.
  • CPU stays at 80 MHz when awake: the LED's RMT times bits off APB, and frequency scaling garbled the colour.
  • Reproducible digest: fixed app version (not git describe), and firmware/tools/stripped_elf_image.py builds the image from a stripped ELF, since esptool always stamps the ELF's SHA-256 into the app description. Checked: two checkouts at different paths give the same image.

Continuity hidden: the 1 MΩ continuity drive holds VOUT near 0.47 V, which can't conduct through the bridge board's body diodes, so an altimeter behind it reads like nothing. The LED and web page no longer show load/open while disarmed; the sense line still flags armed-not-live and disarmed-but-live.

Web client: alert banners are filled in the alert colour. Served at switch.starberkeley.org from the EC2 Caddy.

Bench: flashed and armed/disarmed on three boards. The light-sleep current on battery still needs a meter reading.

@swissskimmilk
swissskimmilk merged commit 15b5a0c into main Nov 13, 2026
17 checks passed
@swissskimmilk
swissskimmilk deleted the aidan/firmware/bluetooth-switch-power branch November 13, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants