Why a screen-free 3-key remote hit an HTTP wall
More and more lights joined my Home Assistant setup, yet walking through the door and unlocking a phone just to tap a scene felt absurd. Luma Remote Air keeps only three dimpled keys (1, 2, and 3 dots) for Daily, Ambient, and Sleep—each supporting single, double, and long press.
To configure key bindings and radio modes without flashing tools, the ESP32-C3 firmware hosts an embedded LAN web app. Early builds took over a minute to cold-load in a browser.
| Layer | Verified Hardware / Stack |
|---|---|
| MCU & Board | ESP32-C3 · P2-A-05 ENIG PCB · ID05 blind-tactile shell (111.6 × 37.6 mm) |
| Firmware & Web | ESP-IDF + LWIP httpd + Embedded H5 + Meshopt Web 3D product site |
| Dual Radio | Wi-Fi direct to Home Assistant / MQTT, or Wi-Fi off using BTHome v2 BLE broadcasts |
| BLE Bridge | Always-on ESP32-C3 USB gateway (local LAN deduplication & relay, works offline) |
The 77.4-second cold load captured on real silicon
Early firmware served raw HTML, JS, and CSS directly from flash across 19 requests—uncompressed assets plus 5 separate initialization API calls.
# Early P2-A-05 cold-load trace (Browser DevTools over LAN)
Total requests : 19 (uncompressed assets + 5 separate init calls)
Payload size : 118 KB raw HTML / JS / CSS
DOMContentLoaded: 77.4 s
Mean API latency: 136 ms per round-trip
Whenever LWIP emits HTTP headers and body across multiple send() calls, Nagle waits for the peer's Delayed ACK (40–200 ms per stall). Across 19 requests competing for limited embedded sockets, the wait piles straight up past a minute.
Three fixes that collapsed the latency floor
Once the bottleneck split clearly into payload size, LWIP Nagle stalls, and fragmented bootstrap calls, each layer came down in order:
Flash serves Content-Encoding: gzip directly with zero runtime compression CPU or heap spike on the ESP32-C3.
TCP_NODELAY in the httpd accept hook
Disables Nagle on accepted client sockets so multi-send() responses flush immediately without waiting for Delayed ACK.
/api/bootstrap
Bundles device state, key mappings, and network configuration into one round-trip on page open.
Before vs After on P2-A-05 hardware
Measured directly against the physical P2-A-05 ESP32-C3 board over local Wi-Fi:
| Metric | Before | After | Root change |
|---|---|---|---|
| Static asset transfer | 118 KB |
33 KB |
Build-time Gzip pre-compression |
Cold DOMContentLoaded |
77.4 s |
138–155 ms |
Gzip + TCP_NODELAY + /api/bootstrap |
| Average API latency | 136 ms |
65 ms |
Eliminated Nagle + Delayed ACK stalls |
| Startup API round-trips | 5 calls (19 total requests) | 1 /api/bootstrap call |
Consolidated state, keymap, and config payload |
Screen-free feedback & BTHome v2 offline gateway
With setup latency solved, daily reliability comes down to blind-tactile certainty. A frosted edge diffuser stays completely dark at rest and pulses softly only on press or USB-C charge.
BTHome v2 advertisements; an always-on ESP32-C3 USB bridge deduplicates and relays packets over LAN.Meshopt with offscreen render-loop pause, DPR tiers, and studio-render fallbacks.Verified boundaries & current status
Here is what is running reliably today versus what remains under active validation:
- Daily personal driver: the personal P2-A-05 ENIG unit has been used daily at home for nearly a month
- LAN-first, zero cloud dependency: both Wi-Fi MQTT and BLE BTHome modes operate strictly inside the local network
TCP_NODELAYscoped to httpd sockets: leaves BLE broadcast power profiles and deep-sleep timing untouched- Open validation items: commercial provisioning firmware and pure-battery long-term endurance runs are still in progress
Takeaway
Slow embedded web UIs are rarely just a frontend bundle issue. On ESP32-C3 LWIP, pairing TCP_NODELAY in the accept hook with build-time Gzip and a single /api/bootstrap endpoint brought cold load down from 77.4 s to 138–155 ms.