id: 692c2a0b4665469887abcb369c3cc115
parent_id: 727d6dbdb58b495f96a2bbb6aed55000
item_type: 1
item_id: 6c0dcb2a567348fd9796f50c790082e4
item_updated_time: 1780562309144
title_diff: "[]"
body_diff: "[{\"diffs\":[[0,\"an\\\n\\\n\"],[-1,\"## 1. Telemetry APIs — Key Findings\\\n\\\n### Assetto Corsa (Classic)\\\n- **Primary method**: Shared Memory (Windows)\\\n- **Cross-platform option**: **KSUDP (built-in UDP)** — 3-phase handshake protocol on port 9996, works under Proton/Linux\\\n- **Secondary option**: **Python plugin API** — runs inside the game process, works under Proton/Linux\\\n- The Python API (`ac.getCarState()`, `ac.getSessionState()`, `ac.getPhysics()`) exposes nearly all telemetry data that shared memory provides\\\n- **Lua plugin approach: ABANDONED** — CSP lacks compiled LuaSocket C core (`socket.core.dll`), see Section 4\\\n\\\n### Assetto Corsa Evo\\\n- Uses shared memory like classic AC, but **reworked in v0.6**\\\n- Structure similar to ACC but initially only the physics file was populated\\\n- **Official Shared Memory API Documentation released May 15, 2026**\\\n- Lua SDK still in development — will follow same pattern as classic AC\\\n- Verdict: Don't buy ACC yet; invest in EVO for the future\\\n\\\n### Assetto Corsa Competizione (ACC)\\\n- Shared memory only (Windows)\\\n- Would require a relay tool (e.g., `ACC_ShmemUDP_Relay`) to send data via UDP from Windows — adds complexity\\\n- **Decision: Skip for now, focus on EVO instead**\\\n\\\n### Assetto Corsa Rally\\\n- Shared memory (SimHub support confirmed in v9.10.7)\\\n- No native UDP confirmed\\\n- Coaching value: **High** — detailed tire and surface data\\\n\\\n### Dirt Rally 2.0\\\n- **Well-documented UDP telemetry output** — the clear choice for Linux\\\n- UDP Frequency configurable (5–60 Hz)\\\n- Community tools exist (e.g., `dr2_logger`)\\\n- Coaching value: **High** — pace note timing, braking points per surface, suspension behavior\\\n\\\n### Dirt Rally 1.0\\\n- Same Codemasters engine as DR2.0, UDP support probable\\\n- Coaching value: **High**\\\n\\\n### Dirt 4\\\n- Older, official UDP support less clear\\\n- Coaching value: **Medium**\\\n\\\n### Project CARS 1 & 2\\\n- **UDP feed is the only viab\"],[1,\"*(Sections 1–7 unchanged from previous update)*\\\n\\\n---\\\n\\\n## 8. Repositories & Deployment\\\n\\\n### Repo: `rusty-te\"],[0,\"le\"],[-1,\" \"],[0,\"met\"],[-1,\"hod on Linux**\\\n- Shared memory is Windows-only (memory-mapped files), not accessible even under Proton\\\n- **No plugin API available** (unlike AC)\\\n- Well-documented binary UDP packet structure\\\n- Both PCARS1 and PCARS2 use default port **5606**\\\n- Config: UDP Protocol Version set to \\\"Project Cars 1\\\" or \\\"2\\\" recommended\\\n- **IMPLEMENTED in v0.4.0** — parser with auto-detection between V1 (1367 bytes) and V2 (559 bytes)\\\n\\\n---\\\n\\\n## 2. Why Shared Memory over UDP?\\\n\\\nTelemetry tools prefer shared memory for local access because:\\\n\\\n| Advantage | Shared Memory | UDP |\\\n|---|---|---|\\\n| Latency | Nanoseconds | Milliseconds |\\\n| Throughput | Direct memory access | Network stack overhead |\\\n| Multiple consumers | One-write, many-read (zero extra cost) | Separate stream per consumer |\\\n| Data copies | None | Serialization/deserialization |\\\n| Synchronization | Lock-free circular buffers | Packet sequencing, loss handling |\\\n| Scope | Local machine only | Network-transparent |\\\n\\\n**Bottom line**: For multiple local tools (SimHub, CrewChief, dashboards), shared memory is far more efficient. UDP is the fallback for Linux/networked setups.\\\n\\\n---\\\n\\\n## 3. Architecture — Triple-Source Telemetry for AC + PCARS\\\n\\\n### Three Independent Data Sources (AC) + One PCARS Source\\\n\\\nAC provides telemetry through two independent channels. The CSP Lua plugin approach (port 5005) has been abandoned (see Section 4).\\\n\\\n**Feed 1: KSUDP (port 9996) — AC Engine Built-in**\\\n- Provider: AC engine itself (NOT CSP, NOT plugin)\\\n- Protocol: 3-phase handshake registration (see Section 5)\\\n- Works identically on Windows and Linux/Proton\\\n- No separate installation required\\\n\\\n**Feed 2: Telemetry Tool Plugin (port 10101) — AC Python Plugin System**\\\n- Provider: AC's Python plugin system + third-party plugin by IkoRein v1.3\\\n- Download: https://www.racedepartment.com/downloads/telemetry-tool-for-ac.37231/\\\n- Source code: `<AC>/apps/python/Telemetry_Tool_plugin/Telemetry_Tool_plugin.py`\\\n- Config: `<AC>/apps/python/Telemetry_Tool_plugin/config.ini` — set `to_ip` and `to_port`\\\n- Enable: `python.ini` → `[TELEMETRY_TOOL_PLUGIN] ACTIVE=1`\\\n- **OPTIONAL** — requires separate installation of the Telemetry Tool plugin\\\n- Works on both Windows and Linux/Proton (AC's built-in Python interpreter)\\\n\\\n**Feed 3: PCARS (port 5606) — Project CARS 1 & 2**\\\n- Both PCARS1 and PCARS2 broadcast on port 5606\\\n- Game sends TO a configured IP:port — rusty-telemetry binds and listens\\\n- Auto-detects PCARS1 vs PCARS2 packet format\\\n- PCARS1: ~1367 bytes, 3-byte header, 10 Hz\\\n- PCARS2: ~559 bytes (Car Physics), 12-byte header, configurable Hz\\\n- **IMPLEMENTED in v0.4.0**\\\n\\\n**All AC feeds work on pure Windows without Proton — neither depends on CSP.**\\\n\\\n### Architecture Diagram\\\n\\\n```\\\n┌──────────────────────────────────────────────────────────────────┐\\\n│                      GAME MACHINE (AC / Proton)                   │\\\n│                                                                   │\\\n│  ┌──────────────────────┐  ┌──────────────────────────┐         │\\\n│  │ AC Engine             │  │ Telemetry Tool Plugin     │         │\\\n│  │ (built-in)            │  │ (Python, IkoRein v1.3)    │         │\\\n│  │ KSUDP, ~20Hz          │  │ Binary, all cars, per-fps │         │\\\n│  │ BINDS :9996           │  │ SENDS to :10101           │         │\\\n│  └──────────┬───────────┘  └──────────┬────────────────┘         │\\\n│             │                          │                           │\\\n└─────────────┼──────────────────────────┼──────────────────────────┘\\\n              │                          │\\\n              ▼                          ▼\\\n┌──────────────────────────────────────────────────────────────────┐\\\n│                GAME MACHINE (PCARS 1 or 2)                        │\\\n│                                                                   │\\\n│  ┌──────────────────────────┐                                    │\\\n│  │ PCARS Engine              │                                    │\\\n│  │ Binary, ~10 Hz            │                                    │\\\n│  │ SENDS to :5606            │                                    │\\\n│  └──────────┬───────────────┘                                    │\\\n└─────────────┼─────────────────────────────────────────────────────┘\\\n              │\\\n              ▼\\\n┌──────────────────────────────────────────────────────────────────┐\\\n│                   ANALYSIS MACHINE — rusty-telemetry               │\\\n│                                                                   │\\\n│  ┌───────────────────────── Multi-Port UDP ──────────────────┐   │\\\n│  │  :9996  (handshake) ──→ parser-ksudp     ──┐              │   │\\\n│  │  :10101 (optional)  ──→ parser-telemetry  ──┼──→ Model     │   │\\\n│  │  :5606  (bind/listen)──→ parser-pcars     ──┘              │   │\\\n│  └────────────────────────────────────────────┘              │   │\\\n│  ┌──────────────┐  ┌───────────┐  ┌──────────────────┐      │   │\\\n│  │ Plausibility │  │ Analyzer  │  │ AI Coach         │      │   │\\\n│  └──────────────┘  └───────────┘  └──────────────────┘      │   │\\\n└──────────────────────────────────────────────────────────────────┘\\\n```\\\n\\\n### Source Comparison\\\n\\\n| Aspect | Port 9996 (KSUDP) | Port 10101 (Telemetry Tool) | Port 5606 (PCARS)\"],[1,\"ry` (Main Rust Backend)\\\n\\\n| Field | Value |\\\n|---|---|\\\n| **Language** | Rust |\\\n| **IDE** | RustRover |\\\n| **Local path** | `~/RustroverProjects/rusty-telemetry` |\\\n| **Remote** | `ssh://jan@192.168.1.2/home/jan/Development/Repositories/rusty-telemetry.git` |\\\n| **Codeberg** | `ssh://git@codeberg.org/jhunnius/rusty-telemetry` |\\\n| **Status** | **v0.4.1 — Remote operation support, PCARS + AC parsers, TUI** |\\\n\\\n### Network Configuration (v0.4.1)\\\n\\\n| Env Var | Purpose | Default\"],[0,\" |\\\n|---\"],[1,\"------\"],[0,\"|---\"],[-1,\"|\"],[1,\"--\"],[0,\"---\"],[1,\"-\"],[0,\"|---\"],[-1,\"|\\\n| **Origin** | AC engine (built-in) | Python plugin (IkoRein) | PCARS 1/2 engine |\\\n| **Protocol** | 3-phase handshake | Send-only (unbound socket) | Game sends to target |\\\n| **Status** | ✅ **WORKING** — v0.3.0 | ✅ **WORKING** | ✅ **IMPLEMENTED** — v0.4.0 |\\\n| **Format** | Binary (official Google Doc) | Binary (struct in Python source) | Binary (auto-detect V1/V2) |\\\n| **Rate** | ~20 Hz fixed | Per-frame | ~10 Hz (configurable in\"],[1,\"------|\\\n| `RUSTY_TELEMETRY_GAME_HOST` | IP of the machine running the sim game (KSUDP handshake target) | `127.0.0.1` |\\\n| `RUSTY_TELEMETRY_LISTEN` | Local address to bind for incoming UDP feeds (TT,\"],[0,\" PCARS\"],[-1,\"2\"],[0,\") |\"],[-1,\"\\\n| **Data depth** | Basic | **Full** (wheel slip, tyres, ERS) | **Full** (temps, damage, weather) |\\\n| **All cars** | No (focused car) | **Yes** (multi-driver packets) | V1: 56 entries, V2: separate |\\\n| **World position** | ✅ Yes | ✅ Yes | V2: ✅ (full 3D), V1: ❌ |\\\n| **Wheel data** | ✅ Yes | ✅ Yes | ✅ Yes (temps, wear, damage) |\\\n| **Engine temps** | ❌ No | ❌ No | ✅ Oil, water temps |\\\n| **Damage** | ❌ No | ❌ No | ✅ Aero, engine, suspension |\\\n| **Tyre management** | ⚠️ (dirtyLevel only) | ✅ (core temps) | ✅ (wear, temps per wheel) |\\\n\\\n---\\\n\\\n## 4. Lua Plugin — ABANDONED\\\n\\\n*(Unchanged — see note history for details)*\\\n\\\n---\\\n\\\n## 5. KSUDP (Port 9996) — Complete Protocol Documentation\\\n\\\n*(Unchanged — see note history for details)*\\\n\\\n---\\\n\\\n## 6. Telemetry Tool Plugin (Port 10101) — Reference\\\n\\\n*(Unchanged — see note history for details)*\\\n\\\n---\\\n\\\n## 7. PCARS (Port 5606) — UDP Protocol Reference\\\n\\\nSee separate Joplin note `c6bd2c45938246fa9d61776deae9874b` for the full byte-level protocol specification.\\\n\\\n### Parser Implementation (v0.4.0)\\\n\\\n- File: `src/parser_pcars.rs`\\\n- Auto-detects V1 vs V2 based on packet size and header structure\\\n- V1 detection: large packet (≥1367 bytes) with type=0 in packed byte at offset 2\\\n- V2 detection: 12-byte header with `packet_type` at offset 10 ≤ 8\\\n- Maps PCARS field\"],[1,\" `0.0.0.0` |\\\n| `RUSTY_TELEMETRY_BIND` | Fallback for both (backward compat) | — |\\\n\\\n**Same machine** — no config needed:\\\n```bash\\\ncargo run --release\\\n```\\\n\\\n**Remote game machine** — run rusty-telemetry on a separate machine:\\\n```bash\\\n# Analysis machine (e.g. 192.168.1.100), game on 192.168.1.2:\\\nRUSTY_TELEMETRY_GAME_HOST=192.168.1.2 cargo run --release\\\n```\\\nThen configure game\"],[0,\"s to \"],[-1,\"generic `TelemetryFrame` model\\\n- 5 unit tests (V1 parse, V2 parse, too short, unknown format, V2 other types)\\\n- PCARS-specific fields added to `TelemetryFrame`: oil/water temp, fuel capacity, boost, crash state, odometer, aero/engine damage, ambient/track temp, rain density, track length, full 3D position, tyre wear, brake temp, suspension damage\\\n\\\n---\\\n\\\n## 8. Repositories & Deployment\\\n\\\n### Repo: `rusty-telemetry` (Main Rust Backend)\\\n\\\n| Field | Value |\\\n|---|---|\\\n| **Language** | Rust |\\\n| **IDE** | RustRover |\\\n| **Local path** | `~/RustroverProjects/rusty-telemetry` |\\\n| **Remote** | `ssh://jan@192.168.1.2/home/jan/Development/Repositories/rusty-telemetry.git` |\\\n| **Codeberg** | `ssh://git@codeberg.org/jhunnius/rusty-telemetry` |\\\n| **Status** | **Phase 1.1 — Binary parsers implemented, PCARS added in v0.4.0** |\"],[1,\"send to the analysis machine's IP:\\\n- **KSUDP**: Works automatically — AC sends telemetry to the handshake's source address\\\n- **Telemetry Tool**: Set `to_ip = 192.168.1.100` in `config.ini`\\\n- **PCARS**: Set target IP to `192.168.1.100` in in-game UDP settings\"],[0,\"\\\n\\\n##\"]],\"start1\":53,\"start2\":53,\"length1\":9611,\"length2\":1459},{\"diffs\":[[0,\"go.toml\\\n\"],[1,\"├── README.md\\\n\"],[0,\"├── src/\"]],\"start1\":1585,\"start2\":1585,\"length1\":16,\"length2\":30},{\"diffs\":[[0,\"al\\\n  - [\"],[-1,\" \"],[1,\"x\"],[0,\"] Config\"]],\"start1\":2784,\"start2\":2784,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\"vars\"],[-1,\" or config file\"],[1,\": `GAME_HOST`, `LISTEN`, `BIND` (v0.4.1)\\\n  - [x] Remote operation support — game and listener can run on different machines (v0.4.1)\"],[0,\"\\\n  -\"]],\"start1\":2816,\"start2\":2816,\"length1\":23,\"length2\":140},{\"diffs\":[[0,\" session\"],[1,\"\\\n  - [ ] Verify PCARS works with live game session\"],[0,\"\\\n\\\n- **1.\"]],\"start1\":3002,\"start2\":3002,\"length1\":16,\"length2\":66},{\"diffs\":[[0,\"### \"],[-1,\"How to Check if Feeds Are Running\\\n\\\n**CSP log location (Linux/Proton):**\\\n```\\\n~/.steam/.../compatdata/244210/.../Documents/Assetto Corsa/logs/\\\n├── log.txt                  ← Main AC log\\\n├── custom_shaders_patch.log ← Detailed CSP log\\\n└── py_log.txt               ← Python plugin log\\\n```\\\n\\\n### Port 9996 (KSUDP) — 3-Phase Handshake Protocol\\\n- AC binds to port 9996 as a **LISTENER** at startup\\\n- External tools must **register** via 3-phase handshake\"],[1,\"Environment Variables\\\n\\\n| Variable | Purpose | Default |\\\n|----------|---------|---------|\\\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 of the above | — |\\\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\"],[0,\"\\\n- *\"]],\"start1\":5319,\"start2\":5319,\"length1\":454,\"length2\":624},{\"diffs\":[[0,\"`\\\n- \"],[-1,\"Enabled: `python.ini` → `[TELEMETRY_TOOL_PLUGIN] ACTIVE=1`\"],[1,\"Set `to_ip` to the analysis machine's IP for remote operation\"],[0,\"\\\n- *\"]],\"start1\":6154,\"start2\":6154,\"length1\":66,\"length2\":69},{\"diffs\":[[0,\"inds to \"],[1,\"`$LISTEN\"],[0,\":5606\"],[1,\"`\"],[0,\" and lis\"]],\"start1\":6435,\"start2\":6435,\"length1\":21,\"length2\":30},{\"diffs\":[[0,\"on\\\n\\\n\"],[1,\"**Same machine:**\\\n\"],[0,\"1. \"],[-1,\"**\"],[0,\"Star\"]],\"start1\":7069,\"start2\":7069,\"length1\":13,\"length2\":29},{\"diffs\":[[0,\"ame \"],[-1,\"first** —\"],[1,\"→\"],[0,\" let\"]],\"start1\":7101,\"start2\":7101,\"length1\":17,\"length2\":9},{\"diffs\":[[0,\"lize\"],[-1,\" its UDP listeners/senders\"],[0,\"\\\n2. \"],[-1,\"**\"],[0,\"Star\"]],\"start1\":7120,\"start2\":7120,\"length1\":40,\"length2\":12},{\"diffs\":[[0,\"try \"],[-1,\"after game loads**\\\n3. KSUDP: rusty-telemetry performs 3-phase handshake to AC's port 9996 automatically\\\n4. Telemetry Tool: if plugin is installed and configured, data appears on :10101\\\n5. PCARS: if game is configured to send to your IP:5606, data appears aut\"],[1,\"→ auto-handshake\\\n\\\n**Remote:**\\\n1. Start game on game machine\\\n2. Configure game to send to analysis machine's IP (TT config.ini, PCARS in-game settings)\\\n3. Start rusty-telemetry on analysis machine with `RUSTY_TELEMETRY_GAME_HOST=<game-IP>`\\\n4. KSUDP: handshake goes to game machine, telemetry streams back automatically\\\n\\\n---\\\n\\\n## 15. Change Log\\\n\\\n### v0.4.1 (2026-06-04) — Remote Operation Support\\\n\\\n- Split `RUSTY_TELEMETRY_BIND` into `RUSTY_TELEMETRY_GAME_HOST` and `RUSTY_TELEMETRY_LISTEN`\\\n- `GAME_HOST` controls KSUDP handshake target (IP of the sim machine), default `127.0.0.1`\\\n- `LISTEN` controls local bind address for incoming feeds, default `0.0.0.0` (any interface)\\\n- Both fall back to `RUSTY_TELEMETRY_BIND` for backward c\"],[0,\"om\"],[1,\"p\"],[0,\"ati\"],[-1,\"cally\\\n\\\n---\\\n\\\n## 15. Change Log\"],[1,\"bility\\\n- Updated README.md with full usage documentation, feed setup, TUI description, architecture\"],[0,\"\\\n\\\n##\"]],\"start1\":7146,\"start2\":7146,\"length1\":300,\"length2\":842},{\"diffs\":[[0,\"0.4.\"],[-1,\"0: PCARS support added, code quality improvements\"],[1,\"1: Remote operation support, README documentation\"],[0,\"*\\\n*N\"]],\"start1\":9654,\"start2\":9654,\"length1\":57,\"length2\":57}]"
metadata_diff: {"new":{},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2026-06-04T08:48:00.674Z
created_time: 2026-06-04T08:48:00.674Z
type_: 13