id: 82dec358bdf548f894d0b78c0ac26945
parent_id: 
item_type: 1
item_id: 0c837f4e6b7e462a997cbc19e47c864a
item_updated_time: 1780733482097
title_diff: "[{\"diffs\":[[1,\"rusty-telemetry — REST API Reference\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":36}]"
body_diff: "[{\"diffs\":[[1,\"# rusty-telemetry — REST API Reference\\\n\\\n> **Parent note:** [Sim Racing Telemetry Analysis Platform — Project Plan](joplin://6c0dcb2a567348fd9796f50c790082e4)\\\n> **Repo:** `~/RustroverProjects/rusty-telemetry`\\\n> **Companion:** [racecraft — Vue.js Web Client Notes](joplin://50a09627d5d347009197b94bcee90411)\\\n> **Current version:** v0.6.0\\\n\\\n---\\\n\\\n## Server Configuration\\\n\\\n| Env Var | Purpose | Default |\\\n|---------|---------|---------|\\\n| `RUSTY_TELEMETRY_API_PORT` | REST API server port | `8080` |\\\n| `RUSTY_TELEMETRY_API_HOST` | REST API server bind address | `127.0.0.1` |\\\n| `RUSTY_TELEMETRY_GAME_HOST` | IP of the sim machine (KSUDP handshake target, AC :9996) | `127.0.0.1` |\\\n| `RUSTY_TELEMETRY_LISTEN` | Local bind address for incoming feeds (TT :10101, PCARS :5606) | `0.0.0.0` |\\\n| `RUSTY_TELEMETRY_BIND` | Legacy fallback for both GAME_HOST and LISTEN | — |\\\n\\\n---\\\n\\\n## Endpoints\\\n\\\n### Live Telemetry\\\n\\\n| Method | Endpoint | Description |\\\n|--------|----------|-------------|\\\n| GET | `/api/live` | Live telemetry snapshot (all feeds: health, frequency, speed, RPM, gear, inputs, lap time) |\\\n\\\n### Recordings\\\n\\\n| Method | Endpoint | Description |\\\n|--------|----------|-------------|\\\n| GET | `/api/recordings` | List all recordings |\\\n| POST | `/api/recordings` | Start new recording (JSON: name, game, track, car, use_case, notes — all optional) |\\\n| GET | `/api/recordings/{id}` | Get recording manifest |\\\n| POST | `/api/recordings/stop` | Stop active recording |\\\n| POST | `/api/recordings/{id}/stop` | Stop specific recording |\\\n| DELETE | `/api/recordings/{id}` | Delete recording (removes directory) |\\\n| GET | `/api/recordings/{id}/data/{feed_name}` | Download raw feed binary |\\\n\\\n### Metadata\\\n\\\n| Method | Endpoint | Description |\\\n|--------|----------|-------------|\\\n| GET | `/api/use-cases` | List valid use cases (shift_points, racing_line, braking_analysis, lap_times, sector_analysis, track_map, general) |\\\n| GET | `/api/games` | List supported games (assetto_corsa, assetto_corsa_competizione, project_cars_1, project_cars_2) |\\\n\\\n### Sessions\\\n\\\n| Method | Endpoint | Description |\\\n|--------|----------|-------------|\\\n| GET | `/api/sessions` | List all sessions |\\\n| POST | `/api/sessions` | Create analysis session (JSON: use_case, label) |\\\n| GET | `/api/sessions/{id}` | Get session details |\\\n| DELETE | `/api/sessions/{id}` | Delete session |\\\n| POST | `/api/sessions/{id}/complete` | Complete session and auto-analyze |\\\n| GET | `/api/sessions/{id}/analysis` | Get analysis results |\\\n| POST | `/api/sessions/{id}/analyze` | Re-run analysis on completed session |\\\n| POST | `/api/sessions/{id}/reopen` | Re-open a completed session for further recording (v0.6.0) |\\\n\\\n### Runs\\\n\\\n| Method | Endpoint | Description |\\\n|--------|----------|-------------|\\\n| POST | `/api/sessions/{id}/runs` | Start a run (JSON: feed_name, label, merge_feeds) |\\\n| POST | `/api/sessions/{id}/runs/{run_id}/stop` | Stop a run |\\\n| DELETE | `/api/sessions/{id}/runs/{run_id}` | Delete a run from a session (v0.6.0) |\\\n\\\n---\\\n\\\n## Request/Response Formats\\\n\\\n### Start Recording\\\n\\\n```json\\\n// POST /api/recordings\\\n{\\\n  \\\"name\\\": \\\"optional name\\\",\\\n  \\\"game\\\": \\\"assetto_corsa\\\",\\\n  \\\"track\\\": \\\"optional track name\\\",\\\n  \\\"car\\\": \\\"optional car name\\\",\\\n  \\\"use_case\\\": \\\"shift_points\\\",\\\n  \\\"notes\\\": \\\"optional notes\\\"\\\n}\\\n```\\\n\\\n### Create Session\\\n\\\n```json\\\n// POST /api/sessions\\\n{\\\n  \\\"use_case\\\": \\\"shift_points\\\",\\\n  \\\"label\\\": \\\"optional label\\\"\\\n}\\\n```\\\n\\\n### Start Run\\\n\\\n```json\\\n// POST /api/sessions/{id}/runs\\\n{\\\n  \\\"feed_name\\\": \\\"ksudp\\\",\\\n  \\\"label\\\": \\\"optional label\\\",\\\n  \\\"merge_feeds\\\": [\\\"telemetry_tool\\\"]\\\n}\\\n```\\\n\\\n`merge_feeds` is optional (v0.6.0). When provided, the run merges data from the listed additional feeds with the primary `feed_name`, deduplicating by timestamp.\\\n\\\n### Run Response\\\n\\\n```json\\\n{\\\n  \\\"id\\\": \\\"uuid\\\",\\\n  \\\"label\\\": \\\"run label\\\",\\\n  \\\"feed_name\\\": \\\"ksudp\\\",\\\n  \\\"status\\\": \\\"recording | stopped\\\",\\\n  \\\"start_marker\\\": 0,\\\n  \\\"end_marker\\\": null,\\\n  \\\"frame_count\\\": 0,\\\n  \\\"data_truncated\\\": false\\\n}\\\n```\\\n\\\n### Session Response\\\n\\\n```json\\\n{\\\n  \\\"id\\\": \\\"uuid\\\",\\\n  \\\"use_case\\\": \\\"shift_points\\\",\\\n  \\\"label\\\": \\\"session label\\\",\\\n  \\\"status\\\": \\\"active | completed\\\",\\\n  \\\"created_at\\\": \\\"ISO 8601\\\",\\\n  \\\"completed_at\\\": \\\"ISO 8601 | null\\\",\\\n  \\\"runs\\\": [],\\\n  \\\"analysis\\\": null,\\\n  \\\"guidance\\\": \\\"string | null\\\",\\\n  \\\"recording_id\\\": \\\"uuid | null\\\"\\\n}\\\n```\\\n\\\n### Delete Run Response\\\n\\\n```\\\n// DELETE /api/sessions/{id}/runs/{run_id}\\\n// Returns 204 No Content on success\\\n```\\\n\\\n### Reopen Session Response\\\n\\\n```\\\n// POST /api/sessions/{id}/reopen\\\n// Returns updated UseCaseSession (status: \\\"active\\\", analysis cleared)\\\n```\\\n\\\n---\\\n\\\n## UDP Feed Ports\\\n\\\n| Port | Feed | Protocol | Status |\\\n|------|------|----------|--------|\\\n| 9996 | KSUDP | AC 3-phase handshake | Optional — handshake to GAME_HOST |\\\n| 10101 | Telemetry Tool | AC binary (357-byte driver struct) | Optional — bind to LISTEN |\\\n| 5606 | PCARS | Binary (auto-detect V1/V2) | Optional — bind to LISTEN |\\\n\\\n### Port 9996 (KSUDP) — 3-Phase Handshake Protocol\\\n- AC binds to `0.0.0.0:9996` — accepts handshakes from any IP\\\n- rusty-telemetry sends handshake to `$GAME_HOST:9996`\\\n- AC responds to the source address of the handshake → works across machines\\\n- **Reference**: https://docs.google.com/document/d/1KfkZiIluXZ6mMhLWfDX1qAGbvhGRC3ZUzjVIt5FQpp4/pub\\\n\\\n### Port 10101 (Telemetry Tool Plugin) — OPTIONAL\\\n- Config: `<AC>/apps/python/Telemetry_Tool_plugin/config.ini`\\\n- Set `to_ip` to the analysis machine's IP for remote operation\\\n- **Optional** — if rusty-telemetry can't bind :10101, continues without it\\\n\\\n### Port 5606 (PCARS) — Bind/Listen\\\n- PCARS sends to a configured target IP:port (default 5606)\\\n- rusty-telemetry binds to `$LISTEN:5606` and listens\\\n- Configure in PCARS: Options → System → UDP Protocol → set target IP/port\\\n- PCARS 1: set format to \\\"Project CARS\\\"\\\n- PCARS 2: set format to \\\"2\\\" for native format, or \\\"1\\\" for PCARS1-compatible\\\n- **Optional** — if bind fails, shows as \\\"not available\\\" and continues\\\n\\\n---\\\n\\\n## Version History\\\n\\\n### v0.6.0 (2026-06-06) — Run Management Enhancements\\\n- `DELETE /api/sessions/{id}/runs/{run_id}` — delete a run\\\n- `POST /api/sessions/{id}/reopen` — reopen completed session\\\n- `POST /api/sessions/{id}/runs` — extended with `merge_feeds` field\\\n\\\n### v0.5.0 (2026-06-05) — REST API, Recording Manager, Session Analysis\\\n- Full REST API with recording CRUD, session CRUD, run management, analysis endpoints\\\n\\\n### v0.4.1 (2026-06-04) — Remote Operation Support\\\n- Split BIND into GAME_HOST + LISTEN env vars\\\n\\\n### v0.4.0 (2026-06-04) — PCARS Support\\\n- Port 5606 parser (V1/V2 auto-detect)\\\n\\\n### v0.3.0 (2026-06-04) — TUI + Binary Parsers\\\n- KSUDP handshake fix, Telemetry Tool parser, ring buffer frequency, feed health state machine\\\n\\\n---\\\n\\\n## Cross-References\\\n\\\n- **Main project plan:** [Sim Racing Telemetry Analysis Platform — Project Plan](joplin://6c0dcb2a567348fd9796f50c790082e4)\\\n- **racecraft web client:** [racecraft — Vue.js Web Client Notes](joplin://50a09627d5d347009197b94bcee90411)\\\n- **AC protocol spec:** [Assetto Corsa — UDP Telemetry Protocol Specification](joplin://aed9f3be040943048273a16e05a8100f)\\\n- **ACC protocol spec:** [ACC — UDP Telemetry Protocol Specification](joplin://6ae7005d9810437093d63470cff98b59)\\\n- **Architecture note:** [Architecture & Infrastructure](joplin://c1c3a7b2055642268ab230b95551f470)\\\n\\\n---\\\n\\\n*Last updated: 2026-06-06 — v0.6.0: run deletion, session reopen, feed merging*\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":7259}]"
metadata_diff: {"new":{"id":"0c837f4e6b7e462a997cbc19e47c864a","parent_id":"0e8e00b432a840628faa4df5bc2068bc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1780733386470,"markup_language":1,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2026-06-06T08:14:09.661Z
created_time: 2026-06-06T08:14:09.661Z
type_: 13