Skip to content

feat(cli): wavegrid signals — send, probe and listen to OSC for debugging Pangolin - #109

Merged
pyramation merged 1 commit into
mainfrom
feat/osc-signal-debugging
Aug 19, 2026
Merged

feat(cli): wavegrid signals — send, probe and listen to OSC for debugging Pangolin#109
pyramation merged 1 commit into
mainfrom
feat/osc-signal-debugging

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Debugging "is BEYOND receiving anything?" and "which zone is fixture 7?" with a show that streams a whole grid at 30 Hz is hopeless. This adds three hand-driven OSC commands that aim at the project's configured target, so they exercise the same path — same encoders, same addresses — as the running show:

wavegrid signals send /beyond/zone/0/livecontrol/red 255   # one message, one time
wavegrid signals probe --zones 0-11 --hold 500             # light one zone at a time, then blackout
wavegrid signals listen --port 7001                        # print every message arriving on a port

listen is the piece that makes the rest verifiable: UDP gives no delivery signal, so pointing the show at --host 127.0.0.1 --port <n> and listening there is how you see the exact bytes the hardware would get (verified end-to-end locally — probe → listen shows the /beyond/zone/N/livecontrol/* frames and the closing blackout).

Two details worth knowing:

  • Argument typing. Tokens are floats unless tagged, because an int where the receiver wants a float is dropped silently: 255f:255, i:3 → integer, s:text → string.
  • The blackout frame must not be lost. adapter.close() on a UDP socket discards queued sends, so an early version's blackout never left the machine — the lit fixture would stay lit after the probe "finished". The probe now holds one adapter for the whole walk and waits FLUSH_MS after the final dark frame before closing.

New primitives live in @wavegrid/osc (sendOscMessage, listenForOsc, parseOscArg, parseIndexRange, probeGrid) so node-osc stays in one package; the CLI gains a @wavegrid/osc dependency.

Aiming precedence, with no guessing:

--host [--port] [--kind fb4]   →   project config BEYOND   →   project config FB4   →   error

This is deliberate output on a target the operator configured. It is unrelated to tools/traffic, which stays passive: nothing here replays captures or invents hardware commands, and probe prints a "lasers will output" warning and supports --dry-run.

Test plan

  • packages/osc/__tests__/debug.test.ts — arg typing/tags, index-range expansion, one-lit-fixture grids, plus a real UDP round trip (sendOscMessagelistenForOsc) asserting the address and float survive.
  • packages/cli/__tests__/osc-signals.test.ts — target resolution: config BEYOND, FB4 fallback, flags winning, port-only override, and the refusal when nothing is configured.
  • Manual: signals send, then signals probe --zones 0-1 against signals listen on loopback; confirmed the blackout frame arrives (it did not before the flush fix).
  • pnpm -r test, pnpm -r run lint, and CLI/OSC builds pass.

Link to Devin session: https://app.devin.ai/sessions/ec43152136134467a853ec0bbf783ea9
Requested by: @pyramation

@pyramation pyramation self-assigned this Aug 18, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation
pyramation merged commit 204e44b into main Aug 19, 2026
5 checks passed
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