-
Notifications
You must be signed in to change notification settings - Fork 3
API Reference
Every Next.js API route under host/byh_app/backyardhero/src/pages/api/. All routes return JSON unless noted; non-2xx responses include an error field.
The browser hits these directly. There's no auth — Backyard Hero assumes a trusted local network. Do not expose port 1776 to the public internet.
List every show.
[
{ "id": 1, "name": "Demo Show", "duration": 30, "version": "...", ... },
...
]
Create a show.
Body:
{
"name": "...",
"duration": 30,
"version": "...",
"runtime_version": "...",
"display_payload": "[]",
"runtime_payload": "[]",
"authorization_code": "1234",
"protocol": "BKYD_TS_HYBRID",
"audio_file": "{}",
"receiver_locations": "{}",
"receiver_labels": "{}",
"show_receivers": "[]"
}Update fields on a show. Body limit 2 MB (because display_payload can be large for elaborate shows).
Delete a show. Cascades to racks (FK).
Multipart upload of an audio file. Stored under public/uploads/audio/<filename>. Returns:
{ "url": "/uploads/audio/<filename>", "durationSec": 156.7 }The caller (Show Builder) saves the URL to Show.audio_file.tracks[].url.
List every inventory row.
Create an inventory item.
Update an inventory item.
Delete an inventory item. Cascades to inventoryFiringProfile (FK).
Fetch the firing profile for one item:
{
"id": 12,
"inventory_id": 3,
"youtube_link": "https://...",
"youtube_link_start_sec": 5,
"shot_timestamps": [[100, 250], [500, 700, "#ff0000"], ...]
}Update the shot_timestamps JSON for one item.
Spawn process_firing_profiles.py for one inventory item. Body can include detection knobs (threshold_ratio, etc.).
Spawn process_firing_profiles.py in --reprocess-all mode.
Take a paste of human shell descriptions and return structured shells. Calls OpenAI via OPENAI_API_KEY.
Body:
{ "text": "12 x 3\" red peony\n6 x 4\" gold willow with crackle..." }Response:
{ "shells": [ { "name": "...", "size": 3, "color": "red", "effect": "peony", "count": 12 }, ... ] }List racks for a show.
Create a rack. Body includes show_id, name, x_rows, x_spacing, y_rows, y_spacing, cells (JSON), fuses (JSON).
Fetch one rack. Parses cells and fuses JSON into objects.
Update a rack.
Delete a rack.
List every row in the Receivers SQL table. Hydrates JSON columns (cues_data, metadata, config_data) into objects.
Create a receiver row.
{
"id": "RX146",
"label": "Main Receiver",
"type": "BKYD_TS_24_1",
"cues_data": { "RX146": [1,2,3,4,5,6,7,8] },
"enabled": 1,
"metadata": {}
}Fetch one receiver.
Update one receiver. Bumps configuration_version. Merges config_data (does not replace).
Delete one receiver. The daemon will forget it on next reload.
Drop { "type": "reload_receivers" } for the daemon. The daemon re-reads the table and reconciles the dongle's poll list.
Drop { "type": "retry_receiver", "ident": "<id>" } for the daemon.
Broadcast a CONFIG_QUERY to all connected receivers. Optional body field fire_duration_ms (50–5000).
{ "fire_duration_ms": 250 }Same but for one receiver.
Returns systemcfg.json overlaid with the live Receivers SQL table:
{
"host_version": 0.08,
"system": { "dongle_port": "...", "dongle_baud": 115200, "dongle_protocol": "BKYD_TS_HYBRID" },
"protocols": { ... },
"types": { ... },
"receivers": { "RX146": { "label": "...", "type": "...", "cues": {...}, ... } }
}Write back systemcfg.json. Strips any receivers field from the body before saving (the SQL table is the source of truth).
Drop a JSON file in /tmp/d_cmd/ for the daemon. The body is the command. See Daemon command reference for the full list.
curl -X POST http://localhost:1776/api/system/cmd_daemon \
-H 'Content-Type: application/json' \
-d '{"type":"reload_receivers"}'Read /tmp/fw_cursor and /tmp/fw_firing (legacy polling fallback for clients that don't have the WS open).
Return the contents of /data/last_scan.json (the most recent RF scan result).
Trigger a new scan via { "type": "scan_radio", "passes": ..., "ch_start": ..., "ch_end": ... } daemon command.
Stage a base64-encoded firmware blob to /tmp/ota_staging/<filename> and queue { "type": "ota_flash_start", "ident": ..., "image_path": ..., "rate": ... }.
Body:
{
"ident": "RX146",
"filename": "os4_receiver_v23.bin",
"image_b64": "...",
"rate": 2
}Queue { "type": "ota_flash_abort" }.
Return cached /data/catalog.json (or fallback paths). Used to populate the Add-from-library modal.
Return the current catalog crawl progress:
{ "status": "running" | "completed" | "error", "current": 42, "total": 200, "message": "...", "timestamp": ... }Spawn crawl_catalog.py in the background (no-op if already running).
Default Next.js sample route. Useful as a "is the API up" smoke test.
Getting started
- Overview
- Desktop installers (macOS / Windows)
- macOS
- Linux
- Windows
- Production vs Development
- Connecting the dongle
- Flash a receiver
- Flash a dongle
- OTA flashing
Raspberry Pi
System overview
Subsystems
Hardware
- Receiver firmware
- Dongle firmware
- RF protocol
- Contributor Portal — BOMs, schematics, and board resources
UI walkthrough
Reference
Downloads
- Firmware
- Installers
Module Build & User Guides
- Cue
- Receiver
- Dongle