From cf2375c9639c515fc749d1178e1f0348d5b9eee5 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Mon, 7 Sep 2026 23:37:00 -0400 Subject: [PATCH] =?UTF-8?q?native:=20the=20wedge=20tri=20answers=20`notepa?= =?UTF-8?q?t`=20=E2=80=94=207ch@3=20map,=20and=20`dmxtest`=20to=20interrog?= =?UTF-8?q?ate=20fixtures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The light named its own personality via dmxtest's cycling labeled patterns (3ch-white / 7ch@1-red / 7ch@3-red): Chauvet Wedge Tri, 7ch at address 3. notepat's dmxMap pins macro/strobe/auto to 0 and rides the dimmer at full so color does the fading. dmxtest stays as the fixture interrogation tool, and drops /pieces/dmxdiag.txt for remote readback over lanserv GET. Claude-Session: https://claude.ai/code/session_01Xju7GpzP6o2JwxtqfKqFiG --- fedac/native/pieces/dmxtest.mjs | 45 +++++++++++++++++++++++++++++++++ fedac/native/pieces/notepat.mjs | 6 +++-- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 fedac/native/pieces/dmxtest.mjs diff --git a/fedac/native/pieces/dmxtest.mjs b/fedac/native/pieces/dmxtest.mjs new file mode 100644 index 0000000000..500ae54d06 --- /dev/null +++ b/fedac/native/pieces/dmxtest.mjs @@ -0,0 +1,45 @@ +// dmxtest — cycles labeled DMX patterns so the light itself names the +// fixture's personality (watch which label is up when it lights). Also +// drops /pieces/dmxdiag.txt so the state is readable over lanserv GET. +const PATTERNS = [ + ["3CH WHITE", [255, 255, 255, 255, 255]], // any 3ch fixture at addr 1-3 lights white + ["7CH@1 RED", [255, 0, 0, 0, 0, 0, 255]], // 7ch at addr 1: red + full dimmer + ["7CH@3 RED", [0, 0, 255, 0, 0, 0, 0, 0, 255]], // 7ch at addr 3 +]; +let frame = 0; +let idx = -1; +let ok = "…"; +let diagFrame = 0; + +function boot() {} + +function paint({ wipe, ink, write, system }) { + frame++; + const want = Math.floor(frame / 180) % PATTERNS.length; // ~3s per pattern + if (want !== idx || frame % 30 === 1) { + idx = want; + ok = String(system?.dmxSend?.(PATTERNS[idx][1]) ?? "no api"); + } + + wipe(20, 10, 30); + ink(255, 220, 80); + write(PATTERNS[idx][0], { x: 8, y: 12, size: 2 }); + ink(200, 200, 210); + write("dmxSend: " + ok, { x: 8, y: 44, size: 1 }); + write("ttyUSB0: " + system?.fileSizeBytes?.("/dev/ttyUSB0"), { x: 8, y: 58, size: 1 }); + + if (frame - diagFrame > 120) { + diagFrame = frame; + system?.writeFile?.("/pieces/dmxdiag.txt", + "pattern=" + PATTERNS[idx][0] + " dmxSend=" + ok + + " ttyUSB0=" + system?.fileSizeBytes?.("/dev/ttyUSB0") + " frame=" + frame + "\n"); + } +} + +function act({ event: e, system }) { + if (e.is("keyboard:down:escape")) system?.jump?.("prompt"); +} + +function sim() {} + +export { boot, paint, act, sim }; diff --git a/fedac/native/pieces/notepat.mjs b/fedac/native/pieces/notepat.mjs index b985b338fe..0967053a36 100644 --- a/fedac/native/pieces/notepat.mjs +++ b/fedac/native/pieces/notepat.mjs @@ -473,8 +473,10 @@ let bgTarget = dark ? [20, 20, 25] : [240, 238, 232]; // DMX light mirrors bgColor via system.dmxSend (USB DMX PRO widget). // dmxMap turns rgb into universe slots (index 0 = channel 1) — swap this -// per fixture; the house light is addressed at ch3, rgb on 3/4/5. -const dmxMap = (r, g, b) => [0, 0, r, g, b]; +// per fixture. House light: Chauvet Wedge Tri, 7ch personality at addr 3 +// (R G B macro strobe auto dimmer on slots 3-9); macro/strobe/auto stay 0 +// or they override the rgb, dimmer rides full and color does the fading. +const dmxMap = (r, g, b) => [0, 0, r, g, b, 0, 0, 0, 255]; let dmxLast = [-1, -1, -1]; let dmxFrame = -60; -- 2.51.2