Skip to content

Bluetooth switch firmware (WifiSwitch board) - #218

Merged
inez9 merged 4 commits into
mainfrom
aidan/firmware/bluetooth-switch
Nov 13, 2026
Merged

inez9 merged 4 commits into
mainfrom
aidan/firmware/bluetooth-switch

Conversation

@swissskimmilk

Copy link
Copy Markdown
Contributor

Firmware for the WifiSwitch board (ESP32-C3 + TPS22810 + INA260), used as a BLE-controlled latched power switch for commercial altimeters. New PlatformIO project at firmware/Bluetooth_Switch/, extending esp32c3_usb_base.

Behaviour

  • Output is latched: ON stays on until an explicit OFF (disable). A BLE disconnect never changes it.
  • Across a non-power-on reset (watchdog/panic/brownout) the EN pad is held with gpio_hold and the state is restored from RTC memory; a power cycle comes up OFF.
  • Open BLE link (no pairing/encryption), advertising as STAR-Switch-XXXX. Output characteristic: write 0x01/0x00. Status characteristic: 17-byte packet with supply V/I/P from the INA260, the VOUT sense state (load present / open / live), uptime and reset reason. Layout in the README for the website side.
  • USB serial console: on | off | status.
  • Low power: 80 MHz CPU, 1 s advertising, 300-400 ms connection interval, INA260 in triggered mode.

Not yet verified on hardware

  • Sense thresholds (load/open/live) are estimates from the schematic and need bench calibration against a real altimeter.
  • gpio_hold keeping the output through an MCU reset needs a bench test.
  • Status LED (SK6805) and light sleep are not implemented yet.

Builds clean with pio run; not yet flashed.

@swissskimmilk
swissskimmilk force-pushed the aidan/firmware/bluetooth-switch branch from 9dbfa7d to f3da7e5 Compare November 12, 2026 22:10

@inez9 inez9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@inez9
inez9 merged commit cbda06b into main Nov 13, 2026
15 checks passed
@inez9
inez9 deleted the aidan/firmware/bluetooth-switch branch November 13, 2026 02:40
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