<feed xmlns='http://www.w3.org/2005/Atom'>
<title>luke/esp32-poe-scrypted-viewport/main/idf_component.yml, branch v1.1.0</title>
<subtitle>ESP32-POE Scrypted viewport (private)
</subtitle>
<id>https://src.nth.io/luke/esp32-poe-scrypted-viewport/atom?h=v1.1.0</id>
<link rel='self' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/atom?h=v1.1.0'/>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/'/>
<updated>2026-06-14T03:08:02+00:00</updated>
<entry>
<title>M2: HTTP server + mDNS service discovery + shared state</title>
<updated>2026-06-14T03:08:02+00:00</updated>
<author>
<name>Luke Hoersten</name>
<email>luke@hoersten.org</email>
</author>
<published>2026-06-14T03:08:02+00:00</published>
<link rel='alternate' type='text/html' href='https://src.nth.io/luke/esp32-poe-scrypted-viewport/commit/?id=4756daedaefd18919e96fadaabc7f1a00b383b4c'/>
<id>urn:sha1:4756daedaefd18919e96fadaabc7f1a00b383b4c</id>
<content type='text'>
- viewport_state.{h,c}: shared state struct (config, run-state, counters,
  orientation, timestamps) behind a FreeRTOS mutex. Modules update it
  under viewport_state_lock(); GET /state serializes a snapshot.
- http_api.{h,c}: starts esp_http_server on :80, registers GET /state.
  Returns the full JSON shape from the spec (name, version, configured,
  state, uptime_ms, last_frame_ms_ago, frames_received, decode_errors,
  state_post_failures, resolution, ip, free_heap, free_psram).
- mdns_service.{h,c}: mdns_init + advertise _scrypted-viewport._tcp.local
  on :80 with version/resolution/orientation/name TXT records.
  mdns_service_refresh() reapplies hostname + TXT after /config writes
  (called from M4 onward).
- main/CMakeLists.txt: add esp_http_server, esp_timer, json, mdns to
  REQUIRES. espressif/mdns added as managed component via
  main/idf_component.yml.

app_main calls viewport_state_init early so any module can read defaults
before /config arrives.

Also adds TESTING.md tracking per-milestone verification status and an
integration test plan to run after M9 (races, failure modes, longevity,
power cycles, negative protocol, multi-viewport).

M1 promoted to "🟡 builds clean" in TESTING.md; combined HW verification
of M1+M2 will be one flash session. Build verified against ESP-IDF 5.4
for target esp32p4 (binary ~550 KB).
</content>
</entry>
</feed>
