# cape-launch-countdown — backyard launch control

*A field brief by Beezlebubba the Third · Weird Little Server · November 2026*

> Every launch from the Cape is a public event, and yet the official apps treat
> the schedule like a state secret wrapped in a push notification. So we built a
> small OLED that asks a public API what is going up next and counts it down
> with appropriate ceremony. Retired now — its watch continues in the Oracle —
> but the countdown logic deserved a proper funeral notice.

## What it is

"Ed's Backyard Launch Control v1": an ESP32 + 1.3" SH1106 OLED that tracks
**all** upcoming launches from Cape Canaveral SFS (Launch Library location 12)
and Kennedy Space Center (location 27) via the public Launch Library 2 API, and
counts down to the next one. No weather filtering, no extra hardware.

## Hardware

| Part | Notes |
|---|---|
| Board | ELEGOO ESP32 dev board (ESP32-WROOM, CP2102) |
| Display | SH1106 128x64 mono OLED, I2C |
| Network | 2.4 GHz Wi-Fi, NTP for the clock |
| Data | Launch Library 2 public API (keyless) |

## The logic

- One request per refresh: upcoming launches for locations 12 and 27, ordered
  by NET (no-earlier-than), filtered client-side as a defensive check.
- Picks the next launch that is actually relevant: payload/rocket fields are
  parsed, TBD dates are excluded, and a launch within the current window wins
  over a later one.
- Countdown display: big NET countdown, mission name, pad, and a status line.
  A STALE badge appears if the last successful fetch is older than 30 minutes.
- Budget: a conservative request cap per hour with a `Retry-After` honouring
  backoff (15 min default when the server omits the header). LL2 is generous
  but not infinite; do not hammer it.
- DST handling: the local clock is NTP + a timezone rule, so the countdown
  survives the twice-yearly farce.

## Build it yourself

1. Arduino core 3.x + U8g2 (SH1106 128x64).
2. Fill a secrets header: Wi-Fi SSID/password. No API key needed.
3. Flash; the boot sequence is Wi-Fi → NTP → first fetch → countdown.
4. If the screen says `SYNCING TIME`, check UDP 123 reachability.

## Verification

- Serial: HTTP status + parse summary per refresh; the captured live fixture in
  the repo's host tests reproduces the real response shape.
- Screen: countdown to the next Cape launch; STALE badge only when fetches fail.

## Traps and field notes

- LL2's `net` can slip or go TBD; always re-fetch rather than trusting a cached
  countdown to zero.
- The parser is host-tested against a captured 2.3.0 response — keep that test
  when changing the struct, or you will discover a renamed field at T−00:00:10.
- Retired firmware: the ELEGOO board now runs other work, and the launch watch
  moved into the Oracle (which polls the same API and draws countdown scenes on
  the LED sign).

## Safety

- Public data only. Never derive launch timing from this display for anything
  operational; launch schedules slip constantly.

## Use this brief with an LLM

Feed this file to your assistant and ask it to add launch vehicle icons, a
second location, or a different display. The budget rules and the STALE logic
are the parts worth preserving.
