Web application for recovering MCAP files from the car and using a shell script that invokes the MCAP CLI to recover the mcap.
Optimized for Raspberry Pi with 2GB RAM
-
Set the host path to your unrecovered
.mcapfiles indocker-compose.yml:volumes: - /home/youruser/mcap_logs:/recordings:ro - ./mcap_recover:/recordings/mcap_recover.sh:ro
- Replace
/home/youruser/mcap_logswith the folder on your Linux host containing unrecovered.mcapfiles. - Inside the container the app reads from
/recordingsand runs the script at/recordings/mcap_recover.sh.
- Replace
-
Build and run:
docker compose up -d --build
-
Open the app:
http://localhost:3000 # Or on Pi: http://<pi-ip>:3000
Prerequisites:
- MCAP CLI must be installed on the host system (e.g.,
/usr/local/bin/mcap) - Docker will mount the host's
mcapbinary into the container
Pi Memory Optimization:
- Node.js memory limit set to 1GB (suitable for 2GB Pi)
- Streaming ZIP creation (memory efficient)
- Optimized garbage collection settings
- Connect to the car's Wi‑Fi access point.
- Open a browser to the car's IP on port 3000 (e.g.,
http://<car-ip>:3000). - Select the Files you need to download from car.
- The API reads file listings from
BASE_DIR(set to/recordings). - Selected files are copied into a temporary workspace inside the container.
- The recovery script is invoked via
sh /recordings/mcap_recover.sh <temp_dir>. - Recovered files are zipped and returned for download.
- The temporary workspace is removed after completion.
Environment variables (already set in docker-compose.yml):
BASE_DIR=/recordings(do not change unless you also change the volume target)SCRIPT_PATH=/recordings/mcap_recover.sh
To change the in-container path, update both the environment values and the volumes target so they match.
- No files visible: verify your host path on the left side of the volume mapping contains
.mcapfiles and is readable. - Script errors: ensure
./mcap_recoverexists in the project. The API runs it viash, so it does not require the executable bit on the host. - Memory errors on Pi: the app uses streaming ZIP creation and 1GB Node.js memory limit optimized for 2GB Pi RAM.
- Different host path: update the left side of the volume mapping to your desired folder, for example
/data/logs:/recordings:ro. - Pi performance: for better performance, consider using a Pi 4 with 4GB+ RAM or limit file selection to smaller batches.