Skip to content

fix(docker): UDP relay for multi-source ESP32 on Docker Desktop Windows#502

Open
ruvnet wants to merge 1 commit intomainfrom
fix/issue-374-docker-udp-relay
Open

fix(docker): UDP relay for multi-source ESP32 on Docker Desktop Windows#502
ruvnet wants to merge 1 commit intomainfrom
fix/issue-374-docker-udp-relay

Conversation

@ruvnet
Copy link
Copy Markdown
Owner

@ruvnet ruvnet commented May 1, 2026

Summary

Why a relay and not a docs-only fix

Docker Desktop on Windows runs the engine inside a WSL2/Hyper-V VM. Inbound UDP from multiple source IPs is demultiplexed onto a single virtual socket — the first source "wins" and subsequent unique sources are silently dropped at the VM boundary. Neither host.docker.internal nor --network host resolves this (host networking is not available on the Linux engine on Windows). The relay is the only end-user-runnable fix until Docker Desktop ships per-source UDP forwarding (docker/for-win#1144).

PR #413 by @txhno proposed a docs-only writeup of the same workaround but was conflicting and didn't ship the actual relay tool. This PR supersedes it; happy to credit and close #413 once merged.

Validation

Multi-source relay test on Windows host (this branch):

$ python scripts/udp-relay.py --listen-port 25005 --forward-port 25006 --verbose
udp-relay: listening on 0.0.0.0:25005 -> forwarding to 127.0.0.1:25006

# Send from three distinct ephemeral ports (40001, 40002, 40003)
# Receiver on 25006 sees:
received=6 packets
  from ('127.0.0.1', 54134) -> b'pkt-A-from-40001'
  from ('127.0.0.1', 54134) -> b'pkt-B-from-40001'
  from ('127.0.0.1', 54134) -> b'pkt-A-from-40002'
  from ('127.0.0.1', 54134) -> b'pkt-B-from-40002'
  from ('127.0.0.1', 54134) -> b'pkt-A-from-40003'
  from ('127.0.0.1', 54134) -> b'pkt-B-from-40003'
PASS

All 6 packets from 3 distinct source ports arrive at the receiver, all from the relay's single ephemeral socket — exactly the shape Docker Desktop forwards without dropping.

Test plan

  • Reviewer with a Windows + Docker Desktop host: edit docker/docker-compose.yml to map 5006:5005/udp, run python scripts/udp-relay.py, point ≥2 ESP32-S3 nodes at the host on port 5005, confirm /api/v1/sensing/latest returns frames from every node.
  • Linux/macOS reviewer: confirm the unchanged default 5005:5005/udp mapping still works without the relay.
  • Docs render check: §9–§11 of docs/TROUBLESHOOTING.md look right on github.com.

Closes

Refs

🤖 Generated with claude-flow

…ws (#374)

Docker Desktop on Windows demultiplexes inbound UDP from multiple source
IPs onto a single virtual socket, silently dropping packets from all but
one ESP32 node. This makes multi-node sensing setups appear to work
(WebSocket connects, packets flow on the host) while only one node's CSI
ever reaches the container.

Adds scripts/udp-relay.py (stdlib only) which collapses multi-source UDP
to a single loopback source so Docker's forwarding accepts every packet.
Verified locally: 6 packets from 3 distinct source ports all arrive at
the receiver from a single relay socket.

Updates docker/docker-compose.yml with an inline comment pointing
Windows users at the relay + 5006:5005 mapping. Linux/macOS hosts are
unaffected and need no changes.

Also documents the workaround alongside fixes for #188 (UI 404 from
relative --ui-path) and #438 (boot loop on --edge-tier 1/2 against
pre-v0.4.3.1 firmware) as new sections 9-11 of docs/TROUBLESHOOTING.md.
Supersedes the docs-only PR #413.

Closes #374, #386
Refs #188, #438, #301

Co-Authored-By: claude-flow <ruv@ruv.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant