Enable bundled AMMC tools and document decoder simulation

This commit is contained in:
larssand
2026-09-02 21:13:49 +02:00
parent 9aeb638211
commit f2ba4b3c7b
14 changed files with 123 additions and 29 deletions

View File

@@ -69,7 +69,7 @@ Each physical decoder needs a unique IP. Each enabled AMMC process needs a uniqu
AMMC runs on the computer started with `npm start` or `npm.cmd start`, not on a remote browser laptop.
On x86-64 Linux, the bundled `AMMC/linux_x86-64/ammc-amb` requires GLIBC 2.39 or newer. Check with `ldd --version` or `npm run verify`. RC RaceCore itself may run on an older host, but this bundled AMMC binary will not.
On x86-64 Linux, all bundled programs in `AMMC/linux_x86-64` require GLIBC 2.39 or newer. Check with `ldd --version` or `npm run verify`. RC RaceCore itself may run on an older host, but these bundled AMMC programs will not.
1. Start the backend and open `Settings`.
2. From remote devices use backend URL `http://192.168.1.100:8081`.
@@ -108,6 +108,37 @@ Syntax: `ammc-amb -w <backend WebSocket port> <physical decoder IP>`.
Disable Managed AMMC when starting these processes manually, otherwise two processes may compete for the same port.
## Fake decoder with AMMC Simulator
`ammc-sim` emulates a physical decoder. It does not replace the AMMC WebSocket converter: run the simulator first, then point `ammc-amb` at the simulator host. Keep this setup off the live decoder network during an official race.
Linux example with four simulated drivers and a passing every 15 to 22 seconds:
```bash
./AMMC/linux_x86-64/ammc-sim \
--transponder 1111111,2222222,3333333,4444444 \
--passing-delay 15000-22000 \
--my_ip 192.168.1.100 \
--skip_telemetry_upload \
AMB
./AMMC/linux_x86-64/ammc-amb -w 9000 192.168.1.100
```
Windows uses the same arguments with `ammc-sim.exe` and `ammc-amb.exe`. Replace `192.168.1.100` with the computer running the simulator. RC RaceCore still connects to `ws://<AMMC-host>:9000`. Use transponder numbers registered in RC RaceCore, or use Open Practice to display unknown numbers directly.
Useful simulator options:
| Option | Purpose |
|---|---|
| `--transponder 123,456` | IDs emitted by the fake decoder |
| `--passing-delay 15000-22000` | Random delay between passings in milliseconds |
| `--passing-numbers 1-500` | Stop after the configured passing-number range |
| `--startup_delay_secs 5` | Wait before sending passings |
| `--my_ip <address>` | Address returned during decoder auto-discovery |
Run `ammc-sim --help` for the options supported by the bundled version. The simulator is a test input only; all lap validation, stint handling, leaderboard updates, and persistence continue through the normal RaceCore event pipeline.
## Firewall
Open ports on the backend host, not the operator laptop.

View File

@@ -80,7 +80,7 @@ Varje fysisk decoder ska ha en unik IP. Varje aktiverad AMMC-process ska ha en u
AMMC körs på samma dator som startats med `npm start` eller `npm.cmd start`. Webbläsaren kan köras på en annan dator.
På Linux x86-64 kräver den bundlade `AMMC/linux_x86-64/ammc-amb` GLIBC 2.39 eller senare. Kontrollera med `ldd --version` eller `npm run verify`. RC RaceCore kan köras på en äldre host, men just denna bundlade AMMC-binär fungerar då inte.
På Linux x86-64 kräver alla bundlade program i `AMMC/linux_x86-64` GLIBC 2.39 eller senare. Kontrollera med `ldd --version` eller `npm run verify`. RC RaceCore kan köras på en äldre host, men dessa bundlade AMMC-program fungerar då inte.
1. Starta backend.
2. Öppna `Inställningar`.
@@ -142,6 +142,37 @@ ammc-amb -w <WebSocket-port på backend> <fysisk decoder-IP>
Starta bara processerna för de roller som används. Stäng av `Hanterad AMMC` om processerna startas manuellt, annars kan två processer försöka använda samma portar.
## Fake decoder med AMMC Simulator
`ammc-sim` simulerar en fysisk decoder. Den ersätter inte AMMC:s WebSocket-konverterare: starta först simulatorn och låt sedan `ammc-amb` ansluta till simulatorns dator. Håll testuppsättningen borta från det skarpa decodernätet under ett officiellt race.
Linux-exempel med fyra simulerade förare och en passering var 15:e till 22:a sekund:
```bash
./AMMC/linux_x86-64/ammc-sim \
--transponder 1111111,2222222,3333333,4444444 \
--passing-delay 15000-22000 \
--my_ip 192.168.1.100 \
--skip_telemetry_upload \
AMB
./AMMC/linux_x86-64/ammc-amb -w 9000 192.168.1.100
```
På Windows används samma argument med `ammc-sim.exe` och `ammc-amb.exe`. Byt `192.168.1.100` till adressen för datorn som kör simulatorn. RC RaceCore ansluter fortfarande till `ws://<AMMC-host>:9000`. Använd transpondernummer som är registrerade i RaceCore, eller kör Open Practice för att visa okända nummer direkt.
Användbara simulatorval:
| Val | Funktion |
|---|---|
| `--transponder 123,456` | ID:n som fake decodern skickar |
| `--passing-delay 15000-22000` | Slumpad tid mellan passeringar i millisekunder |
| `--passing-numbers 1-500` | Stoppa efter angivet intervall av passeringsnummer |
| `--startup_delay_secs 5` | Vänta innan passeringarna börjar |
| `--my_ip <adress>` | Adress som returneras vid decoder-autodiscovery |
Kör `ammc-sim --help` för valen i den bundlade versionen. Simulatorn är bara en testkälla; varvvalidering, stintlogik, leaderboard och lagring går fortfarande genom RaceCores vanliga eventflöde.
## Brandvägg
Portarna öppnas på backend-datorn, inte på operatörens laptop.

View File

@@ -240,6 +240,7 @@ flowchart LR
Postinstall --> SQLite[SQLite in-memory query]
Postinstall --> AMMC[Platform AMMC runtime check]
AMMC --> Glibc[Linux x64 GLIBC >= 2.39 warning]
AMMC --> Sim[ammc-sim fake decoder test source]
SetupPs --> ServerCtl[scripts/serverctl.js]
```
@@ -248,7 +249,8 @@ Important constraints:
- `better-sqlite3` is pinned to v12.11.x because its prebuilt Windows binary works with the supported Node.js releases; npm 12 is permitted to run only this dependency installer through `package.json#allowScripts`
- `npm ci --ignore-scripts` is unsupported because it leaves the native SQLite binding uninstalled
- AMMC Windows binaries and DLLs must remain together in `AMMC\\windows64`
- the bundled Linux x86-64 AMMC requires GLIBC 2.39+; `verify-install.js` reports host compatibility and executable permission without blocking the RC RaceCore server
- all bundled Linux x86-64 AMMC programs require GLIBC 2.39+; `verify-install.js` checks every program's executable permission and reports host compatibility without blocking the RC RaceCore server
- `ammc-sim` emulates a physical decoder for test passings; its output must still pass through `ammc-amb` and the normal WebSocket, validation, timing, and persistence flow
- `npm start` is already a background start; batch wrappers must not create a second detached npm process
- server process identity is stored in `data\\server.pid`
- Windows stdout/stderr use `logs\\server.out.log` and `logs\\server.err.log`