Skip to content

Fictrac bridge - #123

Merged
mbreiser merged 6 commits into
reiserlab:mainfrom
floesche:fictrac-bridge
Jul 1, 2026
Merged

Fictrac bridge#123
mbreiser merged 6 commits into
reiserlab:mainfrom
floesche:fictrac-bridge

Conversation

@floesche

Copy link
Copy Markdown
Member

The bridge

  1. reads fictrac via socket, sends it to the arena_consolve via websocket
  2. can playback existing fictrac recordings in realtime
  3. can receive updates from arena_console and logs them to a file.

This PR contains the ISP programming (#121), so either merge that first or review both at once here.

floesche added 3 commits June 27, 2026 00:50
Add the host/UI side of reflashing a G6 panel's firmware through the
arena controller, plus the wire-protocol support and tests.

arena_console.html:
- Firmware row: Upload .bin -> /firmware/panel.bin, Info (footer
  readback), 1-based panel-number input, Flash panel, Verify panel.

Timeouts could probably be shortened…
Add a local bridge so an external FicTrac feed can drive the arena's
host-stepped display (mode 3) through the browser, with no firmware changes.

- fictrac-bridge/: a pixi (Python) workspace. bridge.py reads FicTrac records
  (UDP datagrams or TCP), maps each to a frame index via a single editable
  policy fn, and broadcasts it over a WebSocket with coalescing (latest index
  wins, no backlog). It also appends browser log events to a file — the
  reverse channel, since the browser can't write files itself.
- fictrac_sim.py emits FicTrac-format (25-field) random-walk data for
  hardware-free testing; matches FicTrac's UDP-sender / TCP-server roles.
- arena_console.html: new "Closed-loop bridge" panel — a WS client + coalesced
  sender that reuses the ArenaSession broker and the SET_FRAME_POSITION (0x70)
  path, gated on a mode-3 pattern; reverse-logs each applied frame.
- pixi.toml/pixi.lock: new workspace (python + websockets; bridge/sim tasks).

See fictrac-bridge/README.md.
@floesche
floesche requested a review from mbreiser June 29, 2026 23:55
@mbreiser

Copy link
Copy Markdown
Contributor

@floesche — the ISP set is all merged 🎉 reiserlab/LED-Display_G6_Firmware_Panel#11 (panel) + reiserlab/LED-Display_G6_Firmware_Arena#15 (arena) + #121 (console UI) + reiserlab/Modular-LED-Display#61 (docs) are in main, and we hardware-validated the over-the-arena flashing end-to-end — 4–5 panels flashed and verified (CRC MATCH). The WebUSB flasher now ships the ISP builds too (#124). Really nice work — thank you.

One follow-up on this PR: since #121 was squash-merged, and fictrac-bridge was stacked on top of it, #123 needs a rebase onto main — its copy of the #121 commits is now redundant with the squashed version already on main, so GitHub can't merge it cleanly as-is (it's showing conflicting/recomputing).

The conflicts will be only in the three files #121 and #123 both touched:

  • arena_console.html, js/arena-wire-g6.js, tests/test-arena-wire-g6.js

Resolution is "keep main's #121 version as the base, re-layer the Fictrac changes on top" — that should reduce #123 to a clean Fictrac-only diff. (If the rebase gets fiddly, merging main in, or reopening a fresh PR off main, both work fine too.)

floesche and others added 2 commits June 30, 2026 13:32
The main->fictrac-bridge merge kept both copies of the panel-firmware upload/info/flash block, so const fwFileInput was declared twice in the main inline script -> SyntaxError, breaking the whole console script (Connect, command dispatch, FicTrac). Removed the duplicate copy; verified with node --check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mbreiser

Copy link
Copy Markdown
Contributor

@floesche heads-up — I pushed a small fix straight to this branch (609b99c, via maintainer-edit): the mainfictrac-bridge merge ("fix conflicts to main") had kept two copies of the panel-firmware block in arena_console.html, so const fwFileInput was declared twice → a SyntaxError that stopped the entire inline <script> from parsing (Connect, all command dispatch, and the FicTrac loop — all dead-on-arrival). I removed the duplicate copy (−146 lines); node --check is clean and #123 is mergeable again.

The bridge itself is great — I ran it headless (sim → bridge → ws) and the frame stream tracks heading correctly (clean parse, coalescing hub doing its job). Nice work. Shout if you'd rather have taken the dedupe yourself.

@floesche

Copy link
Copy Markdown
Member Author

You should also be able to provide a previously recorded fictrac path as an argument for Sim

Feel free to merge when you think it's ready

@mbreiser
mbreiser merged commit 6da750a into reiserlab:main Jul 1, 2026
2 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.

2 participants