Skip to content

networking M1-M2: ethernet on the DOM-WLE-LAN, net-eth control plane, v3 standalone workspace - #319

Draft
Yona-Appletree wants to merge 11 commits into
mainfrom
claude/lightplayer-wifi-discovery-5e2db2
Draft

networking M1-M2: ethernet on the DOM-WLE-LAN, net-eth control plane, v3 standalone workspace#319
Yona-Appletree wants to merge 11 commits into
mainfrom
claude/lightplayer-wifi-discovery-5e2db2

Conversation

@Yona-Appletree

@Yona-Appletree Yona-Appletree commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Plan: lp2025/2026-08-03-1438-wifi-discovery
Path: ~/.photomancer/planning/lp2025/2026-08-03-1438-wifi-discovery/plan.md

First tranche of the networking roadmap (~/.photomancer/planning/lp2025/2026-08-03-1438-wifi-discovery/ — lg, M1–M8). This PR lands M1 plus M2 phases P1–P3; it is DRAFT because M2 P4–P6 continue on this branch.

What's here

  • M1 spike (G1 passed): spikes/net-bringup-classic — classic-ESP32 EMAC bring-up on the Zook Dome board (DOM-WLE-LAN v2.65). Findings: LAN8720A with no SMI bus wired (full bit-banged pin-pair sweep), RMII clock = APLL out on GPIO17 only, fixed-link operation, DHCP + TCP echo verified on silicon. Consequence recorded: ethernet and wifi/ESP-NOW are mutually exclusive on this board (APLL).
  • M2-P1: fw-esp32v3's serial JSON half lifted into fw-esp32-common (the refactor(fw-esp32): one home for the serial io_task JSON half #245 tail); WritePolicy::UART0; RX-drain semantics preserved; v3 io_task is now pure transport.
  • Workspace split (Q-M2): fw-esp32v3 is a standalone cargo workspace so the esp-* family can be git-pinned (rev 39abaae0) for the unreleased EMAC driver without touching C6/S3. Fallout absorbed: radio_ram_probe retired (links-slot clash; numbers preserved in the flash ADR), esp-storage = git copy in this workspace, unpin instructions in the crate header.
  • M2-P2 (net-eth feature): EMAC + embassy-net + DHCP in the real server image, IP logged through the normal logger; ping answered (smoltcp auto-icmp-echo-reply). Feature off = image unchanged. Bench-validated: DHCP lease + ARP + 4/4 pings while the empty server loop ran at 839 fps. Cost: +50.5 KiB flash, +15.8 KiB .bss.
  • net-eth stack re-tune (post-merge bench finding): with main merged (project format 4), the net-eth image blew the ProCpu stack guard during project auto-load — the recursive GLSL parse on the 25,488 B .stack the feature's statics left behind. HEAP_SIZE is now 88 KiB under net-eth only, restoring .stack to 48,016 B. Bench-verified: the quad-strip project loads, compiles, and renders at 46 fps with the EMAC up. P5 still owns the formal size/heap gates.
  • M2-P3 (/.lp/net.json + hostname): device-scoped network settings at the fs root, /.lp family posture (lenient load, version bump-and-refuse, wipe-to-blank = defaults; per-field leniency below that). Shape: mode ethernet|wifi|off, hostname, wifi creds (carried for the C6 STA provider, P6), static_ipv4. Hostname defaults to lp-<mac6> derived from the interface MAC and rides DHCP option 12; static configs use Config::ipv4_static. Medium gate is chip-side (this board logs why wifi is impossible and stays off). Bench-verified default path: net: hostname=lp-ecf634 ipv4=dhcp. The net-eth feature also joined the clippy matrix — it was entirely unlinted.
  • Board def: dom-z-102 description records the DOM-WLE-LAN dual identity + ethernet facts.

Validation

  • just clippy-fw-esp32v3 matrix green (now incl. the net-eth arm); feature-off and feature-on builds green
  • lpa-server net_settings: 6 host tests; fw-esp32-common hostname derivation test (net+server features)
  • fw-esp32-common checks green under both toolchains; C6 headroom 974,240 B after P1
  • Hardware: boot, project load + render at 46 fps under net-eth, derived-hostname DHCP config on the bench unit
  • Known bench-side issue, not code: the bench LAN stopped answering DHCP for the board entirely (the proven M1 spike image can no longer lease either); needs hands at the bench — cable/switch/DHCP scope

🤖 Generated with Claude Code

Yona-Appletree and others added 8 commits August 3, 2026 16:15
…p M1

MDIO scan (PHY id + part-name guess) then embassy-net DHCP + TCP echo on
:7777, on esp-hal git-main (classic EMAC merged 2026-05-17, unreleased).
Clock-topology fallbacks behind features: osc-en-16 (WT32-style gated osc),
apll-out-16/17 (NOTE: APLL mode is documented wifi/ESP-NOW-incompatible),
phy-reset-5. Quarantined workspace on the esp toolchain per the per-chip
toolchain ADR; force-frame-pointers deliberately absent (Xtensa LLVM ICE in
compiler_builtins, noted in .cargo/config.toml).

Plan: ~/.photomancer/planning/lp2025/2026-08-03-1438-wifi-discovery/ (M1/G1)

Co-Authored-By: Claude Fable 5 <[email protected]>
DOM-WLE-LAN v2.65 findings so far: LAN8720A PHY (photo-confirmed), but it
answers SMI on NO pin pair in any topology — EMAC 23/18 under external/
APLL16/APLL17 clocks, full bit-bang pair sweep, enable pins high/low, and a
transition census showing GPIO0 (and everything else) static. Leading
hypothesis: the PHY rail is unpowered on USB-only power.

Co-Authored-By: Claude Fable 5 <[email protected]>
…CP echo verified

The board wires NO SMI bus: every pin pair swept clocked and unclocked,
nothing answers, but the LAN8720A negotiates link autonomously (strap
config). Winning topology: ESP32 generates the 50 MHz RMII clock via APLL
on GPIO17 (EMAC_CLK_180; GPIO16 phase does NOT pass packets), FixedLinkPhy
assumes 100M/full, MDC/MDIO parked on inert pins. DHCP lease + host TCP
echo round-trip verified on the bench (192.168.1.38).

Consequence to carry into G1: APLL is documented incompatible with
wifi/ESP-NOW on classic — on this board ethernet and radio are mutually
exclusive.

Co-Authored-By: Claude Fable 5 <[email protected]>
…245 tail)

Deletes v3's local StackJsonWriter, timed_write_server_msg,
server_message_detail, and bespoke chunked-write loop in favor of the
shared ChunkedWriter/server_msg half C6 and S3 already use; adds the
chip-agnostic WritePolicy::UART0 (64 B chunks sized in line time at
921600 baud, 250 ms wedge backstop). RX drain between TX chunks is
preserved via ChunkedWriter's on_chunk hook plus a trailing drain,
matching the original semantics (strictly more draining, never less).
v3 io_task 441 → 310 lines and now pure transport, the shape M2's
network layer sits beside.

All three fw builds green; C6 headroom 974,240 B.

Co-Authored-By: Claude Fable 5 <[email protected]>
…to git

The unreleased classic-ESP32 EMAC driver (esp-hal git main, merged
2026-05-17) can only be pinned via [patch], and patches are
workspace-global — so the pin is quarantined by making fw-esp32v3 its own
workspace (Q-M2, networking M2-P2), extending the per-chip toolchain
quarantine. The crate's Cargo.toml mirrors the root patch table for its
graph and pins esp-hal/esp-rtos/esp-alloc/esp-backtrace/esp-println/
esp-bootloader-esp-idf/esp-rom-sys/esp-storage to spike-tested rev
39abaae0; unpin instructions are in the header comment.

Fallout absorbed here:
- radio_ram_probe + esp-radio retired (links-slot clash with the git
  cohort; numbers preserved in the v3 flash-budget ADR; DOM-WLE-LAN's
  APLL-clocked EMAC excludes the radio regardless)
- esp-storage = the git copy in this workspace, not the third_party fork
  (git esp-bootloader's partition API takes its concrete FlashStorage);
  the fork's panic-unaligned-buffer guard is noted as re-add-later debt
- LpfsPartition::locate takes the concrete FlashStorage (upstream API
  drift); embedded-storage impls now feature-gated upstream, enabled
- justfile: fw_esp32v3_elf points at the crate-local target dir; stale
  clippy-host exclude dropped; clippy matrix loses the probe entry

Validated: release-esp32v3 build green; just fw-esp32v3-size-check =
1,820,016 B / 3 MB (headroom 1,325,712 B — the git cohort costs ~112 KB
vs crates.io 1.1.1); just clippy-fw-esp32v3 matrix green; root workspace
metadata clean without the member.

Co-Authored-By: Claude Fable 5 <[email protected]>
…increment)

DOM-WLE-LAN EMAC in the SERVER image: board/esp32v3/eth.rs carries the
bench-proven configuration (APLL out GPIO17, fixed-link PHY — no SMI
exists on this board, MDC/MDIO parked inert), embassy-net + DHCP glue
lands chip-agnostically in fw-esp32-common::net behind a new 'net'
feature (NetStatus static, init_stack over embassy_net::driver::Driver —
the seam is the driver trait, no invented abstraction), and the IP is
logged through the normal logger onto the serial wire. DMA rings sized
<4,4> (~12.4 KiB) for the zero-sum dram_seg; MAC = efuse base with the
locally-administered bit (no Ethernet slot in this rev's efuse API).

Feature OFF (default): image unchanged. Feature ON: +50.5 KiB flash,
+15.8 KiB .bss paid out of .stack (41,536 → 25,600 B) — flagged for the
P5 heap/stack re-tune before GLSL-compile-under-net is trusted.

Validated: builds+clippy green both ways; fw-esp32-common checks green
under both toolchains and from the root workspace.

Co-Authored-By: Claude Fable 5 <[email protected]>
…ard def

smoltcp 0.13 gates echo replies behind the new auto-icmp-echo-reply
feature (embassy-net's 'icmp' only enables IcmpSocket — a bench lesson:
the device ARP'd fine while dropping pings). Verified on the bench: 4/4
replies at ~0.8 ms while the server renders.

dom-z-102.json description now records the dual identity (PCB silkscreen
DOM-WLE-LAN v2.65 = vendor model DOM-Z-102), the photo-confirmed LAN8720A
with NO SMI bus, the APLL-17-only clock topology, and the ethernet-XOR-
radio consequence; machine-readable ethernet resource deferred to M7.

Co-Authored-By: Claude Fable 5 <[email protected]>
…sp32v3

The workspace split removed fw-esp32v3 from the root fmt-check's coverage;
the clippy recipe now runs cargo fmt --check in the crate first so drift
there stays gated in CI.

Co-Authored-By: Claude Fable 5 <[email protected]>
@Yona-Appletree Yona-Appletree changed the title networking M1-M2: ethernet on the DOM-WLE-LAN, net-eth control plane, v3 standalone workspace [HANDOFF] networking M1-M2: ethernet on the DOM-WLE-LAN, net-eth control plane, v3 standalone workspace Aug 4, 2026
@Yona-Appletree Yona-Appletree changed the title [HANDOFF] networking M1-M2: ethernet on the DOM-WLE-LAN, net-eth control plane, v3 standalone workspace networking M1-M2: ethernet on the DOM-WLE-LAN, net-eth control plane, v3 standalone workspace Aug 4, 2026
Yona-Appletree and others added 3 commits August 4, 2026 09:42
…rena)

Post-merge bench (2026-08-04): with project format 4 accepted, the
net-eth image blew the ProCpu stack guard during project auto-load —
inside the recursive GLSL parse, on the 25,488 B .stack the feature's
~15.9 KiB of .bss left behind — twice per power-on, landing in safe
mode. Exactly the P5 trap the M2 handoff predicted; this is the minimal
re-tune pulled forward so the bench could run at all. HEAP_SIZE 88 KiB
under net-eth puts .stack at 48,016 B (proven non-net figure ~47 KiB).

Bench-verified on the DOM-WLE-LAN: quad-strip project loads, compiles,
renders at a sustained 45 fps with the EMAC up and DHCP soliciting;
107,648 B heap free of 155,644. Non-net builds keep the proven 110 KiB.
P5 still owns the formal size/heap gates.

Co-Authored-By: Claude Fable 5 <[email protected]>
… (M2-P3)

The settings file joins the /.lp root family beside device.json: device-
scoped, survives project pushes, dies with a full wipe back to defaults.
Firmware only reads it (once, at boot); Studio will stamp it over the
serial wire like device.json. Posture is the family one — lenient load,
version bump-and-refuse — with per-field leniency below: a malformed
static address or unusable hostname drops that field with a warning and
the device boots reachable on DHCP with the derived name instead.

- lpa-server::net_settings: v1 shape {mode ethernet|wifi|off, hostname,
  wifi creds (carried for the C6 STA provider, M2-P6), static_ipv4},
  host-tested (6 tests).
- fw-esp32-common::net: NetOptions (hostname override, static v4) +
  from_settings resolver; hostname defaults to lp-<mac6> derived from
  the driver MAC and rides DHCP option 12 (dhcpv4-hostname feature);
  static configs use Config::ipv4_static and the same status loop.
- fw-esp32v3: filesystem now mounts BEFORE start_network so net.json can
  shape the stack; the medium gate is chip-side (mode=wifi on this
  APLL-ethernet board logs why and stays off, mode=off is honored).
- justfile: clippy-fw-esp32v3 gains the net-eth arm — the feature was
  entirely unlinted, and it stays off in shipped builds until P5 prices
  it, which is exactly the condition under which unlinted code rots.

Bench-verified on the DOM-WLE-LAN (no file → defaults):
net: hostname=lp-ecf634 ipv4=dhcp; project loads and renders 46 fps.

Co-Authored-By: Claude Fable 5 <[email protected]>
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