# relay **Repository Path**: yanggan2021/relay ## Basic Information - **Project Name**: relay - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: linux - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-29 - **Last Updated**: 2026-04-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # board-ctrl HTTP API This adds a small HTTP server that uses the existing `board-ctrl` script (left unchanged) to control LC USB relay boards. Note: the server invokes the `board-ctrl` script as a subprocess (CLI), so `board-ctrl` remains unchanged. Files added: - [boards.ini](boards.ini): Example boards configuration (map board name -> port + supports_maskrom). - [server.py](server.py): HTTP server. - [requirements.txt](requirements.txt): Python dependencies. Quick start: ```bash pip install -r requirements.txt python3 server.py --config boards.ini ``` API examples: - List boards: ```bash curl http://localhost:8000/api/boards ``` - Reset a board: ```bash curl -X POST -H "Content-Type: application/json" -d '{"action":"reset"}' http://localhost:8000/api/boards/board1/action ``` - Maskrom (only if `supports_maskrom: true` in the board config): ```bash curl -X POST -H "Content-Type: application/json" -d '{"action":"maskrom"}' http://localhost:8000/api/boards/board1/action ``` Service and automation - Run locally (foreground): ```bash ./scripts/run-server.sh ``` - Systemd unit (example): enable and start `board-ctrl.service` provided in the repo: ```bash sudo cp board-ctrl.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now board-ctrl.service sudo systemctl status board-ctrl.service ``` Skill I added a repository skill at `.github/skills/board-ctrl-service/SKILL.md` that documents service management and action workflows for agents and humans. Configuration - You can set the HTTP port in `boards.ini` under a `[server]` section. If present, the server uses this port; otherwise the CLI/default port is used. Example `boards.ini` snippet: ``` [server] port = 8000 [board1] port = /dev/ttyUSB0 supports_maskrom = true ```