<feed xmlns='http://www.w3.org/2005/Atom'>
<title>luke/esp32-poe-scrypted-viewport/TESTING.md, branch main</title>
<subtitle>ESP32-POE Scrypted viewport (private)
</subtitle>
<id>https://src.nth.io/luke/esp32-poe-scrypted-viewport/atom?h=main</id>
<link rel='self' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/'/>
<updated>2026-07-18T01:39:31+00:00</updated>
<entry>
<title>docs: prune TESTING.md to its forward-looking content</title>
<updated>2026-07-18T01:39:31+00:00</updated>
<author>
<name>Luke Hoersten</name>
<email>luke@hoersten.org</email>
</author>
<published>2026-07-18T01:39:31+00:00</published>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/commit/?id=ffd5b40586f6c1a8a0b245603c672afe521eb128'/>
<id>urn:sha1:ffd5b40586f6c1a8a0b245603c672afe521eb128</id>
<content type='text'>
The 730-line milestone-by-milestone bring-up log served its purpose —
every milestone (M1-M9) is verified on hardware, and the per-run
narratives are preserved in git history (last full version: 8eebc0e).
What survives, restructured (~230 lines):

- New-unit bring-up: hardware prereqs (all unknowns resolved), the
  flash -&gt; panel -&gt; touch -&gt; Scrypted sequence, and the panel
  failure-mode signals table (the content you actually need the day a
  second viewport gets provisioned).
- Regression recipes: condensed curl checks for config validation (incl.
  the 54-char name cap), frame push, state machine, OTA acceptance, and
  device-initiated POSTs.
- Outstanding tests: the honestly-never-run backlog (mid-frame cable
  pull, 24h soak, frame storm, brown-out, multi-viewport).
- Performance playbook: kept, with example log formats refreshed to the
  current stream instrumentation (the old examples showed the removed
  pre-stream snapshot path) and thresholds updated to the post-tuning
  baseline (24fps painted, pend_age as the backlog tripwire).

README: pointers at TESTING's old structure updated; the Hardware status
row no longer claims schematic confirmation is pending (those unknowns
were resolved during bring-up — only the per-unit flash-size check
remains).
</content>
</entry>
<entry>
<title>docs: mark M9 verified — live stream shipped as raw TCP :81, not POST /stream</title>
<updated>2026-07-18T01:27:50+00:00</updated>
<author>
<name>Luke Hoersten</name>
<email>luke@hoersten.org</email>
</author>
<published>2026-07-18T01:27:50+00:00</published>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/commit/?id=8eebc0ea5b6001be6735cf679fb3b94757d0de02'/>
<id>urn:sha1:8eebc0ea5b6001be6735cf679fb3b94757d0de02</id>
<content type='text'>
M9 still carried the abandoned chunked-HTTP design and a pending status
long after the raw TCP data-socket stream was verified at painted =
sent = 24 fps (recv/decode task split d1c8d45 + TCP window/EMAC tuning).
Rewrite the milestone to describe what shipped, flip it ✅, and bump the
README's "M1 – M8" line to M9.
</content>
</entry>
<entry>
<title>docs: sync README + TESTING + scrypted README with v1.4.0 reality</title>
<updated>2026-07-18T01:25:24+00:00</updated>
<author>
<name>Luke Hoersten</name>
<email>luke@hoersten.org</email>
</author>
<published>2026-07-18T01:25:24+00:00</published>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/commit/?id=482d8f45f18c6cc880bf2dfbbb70e3a4d704ac44'/>
<id>urn:sha1:482d8f45f18c6cc880bf2dfbbb70e3a4d704ac44</id>
<content type='text'>
Drift accumulated across the review-fix, mDNS-discovery, and tooling
work:

- Discovery: the design-era "use a Node mDNS library" flow is replaced
  with what shipped — the sandbox has no such libraries; the script does
  a dependency-free legacy-unicast dgram browse (no :5353 bind), host
  dropdowns, blank-name inheritance, and auto-heal on register failure
  (matched by the new mac TXT record) instead of periodic re-browsing.
- /state example: add mac, ota_state, panel dims, tear_guard_engaged,
  temp_c, and the stream stats object; correct `configured` semantics
  (scrypted URL only) and the never-null MAC-derived name in /config.
- /config: document the 54-char name cap (mDNS label limit).
- scrypted/README: add-device + settings tables gain the discovered-host
  dropdown, Wake triggers on create, and the canonical "Viewport name"
  rename field (the Scrypted pencil doesn't propagate — by design);
  trigger-scoped subscriptions; device-wake immediate-204 semantics;
  idle=0 no longer force-slept by the safety timer; "manual IP" dropped
  from limitations; discovery section reframed with the diagnostic.ts
  probe and bridge-networking caveat.
- Source map: dedupe the doubled touch.{h,c} row, add stream_server /
  ota / chip_temp rows, fix nvs_config + endpoint-count drift.
- Build/TESTING: point iteration at `make ota` (USB stays for first
  flash); TXT expectations include mac; DHCP-renumber failure mode now
  documents the verified auto-heal path.
</content>
</entry>
<entry>
<title>phase 6: performance review playbook in TESTING.md + UDP-vs-TCP rationale in stream_server</title>
<updated>2026-06-20T16:40:26+00:00</updated>
<author>
<name>Luke Hoersten</name>
<email>luke@hoersten.org</email>
</author>
<published>2026-06-20T16:40:26+00:00</published>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/commit/?id=6e0e0270e2cb9c54b1b7e63d9e67d8ac16792cef'/>
<id>urn:sha1:6e0e0270e2cb9c54b1b7e63d9e67d8ac16792cef</id>
<content type='text'>
Two pieces of documentation, neither changes behavior:

1. TESTING.md gains a "Performance review playbook" section: per-
   session capture commands for firmware serial + /state poll +
   Scrypted console, an annotated walkthrough of what each log
   shape means, an investigation-threshold table mapping
   user-facing symptoms to likely causes and the first thing to
   check, and a one-line tools list. Replaces the implicit "ask the
   maintainer how to debug" loop with a reproducible workflow.

2. stream_server.c gains a "Why TCP and not UDP" header comment
   documenting the analysis from the design phase. JPEGs are ~123
   IP datagrams at 1500 MTU; on hardwired Gigabit LAN switch-fabric
   loss is &lt; 1e-9/packet → per-frame corruption ≈ 1.2e-7. UDP's
   theoretical wins (no Nagle, latest-wins semantics) don't apply
   because TCP_NODELAY is on, socket.write p50 &lt; 1ms, and the
   FIONREAD trick already implements latest-wins on the receive
   side. UDP's costs (200-400 LOC of app-layer fragmentation, loss
   of nc/curl debug, FIONREAD trick stops working under
   fragmentation) are real. Documented as reference so a future
   contributor doesn't re-derive the analysis from scratch.
</content>
</entry>
<entry>
<title>Drop VIEWPORT_STATE_UNCONFIGURED — state is just awake/asleep</title>
<updated>2026-06-14T23:16:46+00:00</updated>
<author>
<name>Luke Hoersten</name>
<email>luke@hoersten.org</email>
</author>
<published>2026-06-14T23:16:46+00:00</published>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/commit/?id=4a6bbdb075a5e4f9910cb9b85e615ff8c50aa4ec'/>
<id>urn:sha1:4a6bbdb075a5e4f9910cb9b85e615ff8c50aa4ec</id>
<content type='text'>
\`state\` now reports only the screen's runtime state (awake or asleep).
Whether a viewport is set up to talk to Scrypted is a separate
\`configured\` flag, derived from \`viewport_name &amp;&amp; scrypted_url\`.
There's no third state.

Behaviour changes:
- POST /state always succeeds; the previous 409 "device unconfigured"
  path is gone. The screen toggles regardless of /config status.
- POST /config now sets \`configured\` directly from the derived
  predicate instead of mutating the state enum.
- Outbound state-client POST to Scrypted is still gated on a scrypted
  URL being present — that's the only thing the configured flag now
  actually controls in the runtime path.

GET /state JSON unchanged in shape, but \`state\` is now never
"unconfigured" — that's reported through the existing \`configured\`
boolean instead.
</content>
</entry>
<entry>
<title>TESTING: M5 ✅ verified 2026-06-14</title>
<updated>2026-06-14T23:12:46+00:00</updated>
<author>
<name>Luke Hoersten</name>
<email>luke@hoersten.org</email>
</author>
<published>2026-06-14T23:12:46+00:00</published>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/commit/?id=d4fcec3a4d012332e7c476562f9363977ac65561'/>
<id>urn:sha1:d4fcec3a4d012332e7c476562f9363977ac65561</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Info screen: full /config + /state dump, replaces identity screen</title>
<updated>2026-06-14T22:37:51+00:00</updated>
<author>
<name>Luke Hoersten</name>
<email>luke@hoersten.org</email>
</author>
<published>2026-06-14T22:37:51+00:00</published>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/commit/?id=cbc4904aa35191f59aff93df5ed36f09f4cfa943'/>
<id>urn:sha1:cbc4904aa35191f59aff93df5ed36f09f4cfa943</id>
<content type='text'>
Previously the 4-line "identity" screen showed only viewport name, mDNS
host, IP, and state. Expanded to 15 lines covering the full GET /config
+ GET /state output (name, host, ip, state, configured, scrypted,
orientation, brightness, idle, fw, uptime, frames, errs, free heap,
free PSRAM), label/value pairs left-aligned with auto-scaled font.

Renames "identity" → "info" throughout — symbol, log messages,
README/TESTING references.

Also:
- Move the info-screen render's big locals (~1.6 KiB: lines[16][80] +
  scrypt[256] + vp_name[64]) to BSS. The touch task's 3 KiB stack
  was overflowing on every long-press, leaving whatever frame was
  previously on the panel — gave the appearance of a "blue screen"
  after the M5 test pattern.
- Drop the ≥5 s touch factory-reset gesture and remove all stale
  references to it in docs and comments. NVS wipe is now a USB-side
  `idf.py erase-flash` operation only.
- M5 follow-up TODO in jpeg_decoder.c: solid green renders ~black and
  solid blue renders green; not a byte-order issue (BGR setting turns
  red into blue). Tracked as a known M5 gap.
</content>
</entry>
<entry>
<title>http_api: bump httpd stack to 8 KiB — POST /config was overflowing</title>
<updated>2026-06-14T21:51:17+00:00</updated>
<author>
<name>Luke Hoersten</name>
<email>luke@hoersten.org</email>
</author>
<published>2026-06-14T21:51:17+00:00</published>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/commit/?id=ba396daafb4f37a0635a448eec5a001861914884'/>
<id>urn:sha1:ba396daafb4f37a0635a448eec5a001861914884</id>
<content type='text'>
POST /config has ~2.4 KiB of stack locals (2 KiB body buffer + the
scrypted URL + viewport name + cJSON parser frames) which overran the
default 4 KiB httpd task stack and tripped the stack-protect canary
mid-handler. The request body was applied to RAM + NVS, but the
handler crashed before sending the response, so curl saw a connection
reset and the device rebooted into "Stack protection fault".

M4 + M6 ✅ verified 2026-06-14 after the bump:
  - POST /config full / partial → 204; survives reboot via NVS
  - 5 validation failure modes → 400
  - POST /state wake/sleep → 204; idempotent repeats → 204
  - POST /frame while asleep → 409 with expected body
  - idle timer fires after idle_timeout_ms; 0 correctly disables
</content>
</entry>
<entry>
<title>TESTING: M3 / M7 / M8 ✅ verified 2026-06-14</title>
<updated>2026-06-14T21:42:29+00:00</updated>
<author>
<name>Luke Hoersten</name>
<email>luke@hoersten.org</email>
</author>
<published>2026-06-14T21:42:29+00:00</published>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/commit/?id=2daab24dac1ed6f2c3054221d2464db7358816f6'/>
<id>urn:sha1:2daab24dac1ed6f2c3054221d2464db7358816f6</id>
<content type='text'>
Hardware bring-up of the Hosyond panel, FT5426 touch, and local
screens are all confirmed working on the Waveshare ESP32-P4-ETH.

Also retire the resolved hardware unknowns (DSI pin count, I²C pins,
BOOT button) — they're answered in the body now.

M4 / M5 / M6 still need ethernet + a curl-driven run to flip.
</content>
</entry>
<entry>
<title>M3 WIP: DSI bring-up + state machine + identity overlay</title>
<updated>2026-06-14T20:53:33+00:00</updated>
<author>
<name>Luke Hoersten</name>
<email>luke@hoersten.org</email>
</author>
<published>2026-06-14T20:53:33+00:00</published>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/commit/?id=d5cdb6b4e4424d80ac9bfd8e12c129334c23d6f2'/>
<id>urn:sha1:d5cdb6b4e4424d80ac9bfd8e12c129334c23d6f2</id>
<content type='text'>
DSI / panel:
- LDO_VO3 acquired at 2500 mV (VDD_MIPI_DPHY) — without this the PHY
  PLL busy-waits forever inside esp_lcd_new_dsi_bus.
- PSRAM bumped to 200 MHz (CONFIG_IDF_EXPERIMENTAL_FEATURES) to keep
  the DPI fed without underruns.
- Pi-7"-style 800x480 panel init (REG_POWERON, PORTA/PORTB/PWM/PORTC)
  + 16-bit RGB565 framebuffer with portrait-mode rotation buffer in
  PSRAM. Currently shows garbled output — known issue, next commit
  switches to the TC358762-bridge-aware init sequence.

State + UX:
- viewport_state simplified to AWAKE/ASLEEP only; "unconfigured" is
  a flag, not a state. Tap always toggles; content choice (identity
  vs frame) is driven by the configured flag.
- BOOT button arms a 15 s identity overlay via local_screens_overlay;
  expired callback returns to prior state.
- Boot-done indicator: two backlight flashes (no usable LED GPIO on
  the Waveshare board — GPIO 35 BOOT is shared with EMAC TXD1).
- Best-effort subsystem init in app_main; display init deferred to
  its own task so a panel hang can't block networking.

Display test pattern: solid R/G/B for 2 s each on boot to characterize
the garble independent of text rendering.
</content>
</entry>
</feed>
