Skip to content

B1: self-power latch firmware + battery cal + dual-variant CI/OTA - #52

Merged
avillach merged 3 commits into
mainfrom
b1/firmware-ota-and-power-latch
Jun 29, 2026
Merged

avillach merged 3 commits into
mainfrom
b1/firmware-ota-and-power-latch

Conversation

@avillach

@avillach avillach commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds the B1 (LC29HEA) variant to CI/OTA and lands the validated B1 self-power-latch firmware.

CI now builds two binaries from one source — E (default) and B1 (-DBUILD_B1) — and points each fleet's OTA manifest at its own binary. They are not interchangeable: GPIO19 is the TFT backlight on E but the PWR_HOLD self-power latch on B, and the TFT driver differs. E1..E6 → E build, B1 → B1 build.

Firmware (all #ifdef BUILD_B1)

  • PWR_HOLD (GPIO19) self-power latch — holds its own power when lifted off the Qi pad (v0.13 has no power switch); QI_PRESENT (GPIO15) sense.
  • Power-off triggers: low-batt off-pad, poweroff cmd, charged+uploaded+idle-on-pad 30 min. "Parked" is a non-blocking loop state (a halt would trip the loop watchdog → restart → re-latch).
  • On-pad charging screen; power/poweroff serial/telnet cmds.
  • Battery cal: B1 divider ratio 2.09 (E1 stays 2.25) + sanity filter. Verified against a 4.096 V multimeter reading.
  • bring-up sketch: drive GPIO19 HIGH to engage the latch.

Validation

  • Survives multi-lift off the pad on battery at full radio load (FW 2026.06.29.01).
  • Latch proven good at J17 LATCH_DBG: LATCH_Q=3.269 V (R28 is a true 0 ohm jumper), MOSFET_GATE=12.6 mV.
  • E binary verified byte-identical to deployed 2026.06.08.03 except the version string (0 code/data diffs via cmp -l).

⚠️ Merge implications (this is what triggers deploys)

Merging to main runs CI, which on a green build will:

  1. Publish firmware/B1/latest.json → B1 board OTAs to 2026.06.29.01 (it's already on it via USB, so likely a no-op).
  2. Update E1..E6 manifests to 2026.06.29.01 → the E fleet OTA-updates from 06.08.03. This is a functional no-op (E binary is byte-identical), but the 6 boats will reboot to apply on their next WiFi cycle.

If you'd rather not disturb the E fleet right now, hold the merge or say so and I'll gate the E-fleet republish.

🤖 Generated with Claude Code

avillach and others added 3 commits June 29, 2026 12:01
Validated on v0.13 hardware (survives multi-lift off the Qi pad on battery
at full radio load, FW 2026.06.29.01).

Firmware (sailframes_edge.ino, all #ifdef BUILD_B1 — E build byte-identical
except version string, verified):
- PWR_HOLD (GPIO19) self-power latch: driven HIGH first thing in setup() so
  the unit holds its own power when lifted off the Qi pad; QI_PRESENT (GPIO15)
  sense.
- Power-off triggers: low-batt off-pad, `poweroff` serial/telnet cmd, and
  charged+uploaded+idle-on-pad 30 min. "Parked" is a non-blocking loop state
  (never a halt — a spin would trip the Core-1 loop watchdog into a restart
  that re-latches power on).
- On-pad charging screen; `power`/`poweroff` commands.
- Battery: B1 divider ratio 2.09 (E1 stays 2.25; multimeter 4.096 V read 4.41 V
  at 2.25) + sanity filter rejecting impossible reads.

bring-up sketch (b1_bringup.ino): drive GPIO19 HIGH to engage the v0.13 latch
(was still using the v0.12 read-only LATCH_Q_RB semantics).

CI (firmware-edge.yml): build BOTH variants (E default + B1 with -DBUILD_B1)
and route each fleet's OTA manifest to its own binary — the two are NOT
interchangeable (GPIO19 = backlight on E vs PWR_HOLD latch on B). E1..E6 ->
E build; B1 -> B1 build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On the button-less sealed B unit, docking on the Qi pad now means "the sail is
over": if recording when QI_PRESENT goes high, stop the session (same as
stoprec) so the stationary-upload path ships it and the unit charges. Auto-start
is speed-gated, so a stationary on-pad unit won't re-start. Without this the
unit logs indefinitely on the pad (Qi keeps it powered) with no way to stop it
short of opening the box for USB. B-only (#ifdef BUILD_B1); E unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The B publish list only had B1, so B2 would 404 on firmware/B2/latest.json
and never receive OTA. Add B2; future B units join the same list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@avillach
avillach merged commit 71a4677 into main Jun 29, 2026
1 check passed
@avillach
avillach deleted the b1/firmware-ota-and-power-latch branch June 29, 2026 22:03
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.

1 participant