Lesser fork of retropilot-server https://spacecruft.org/retropilot/retropilot-server/
 
 
 
Go to file
Cameron Clough 4c419d7b56
bump cabana
2022-03-26 16:19:33 +00:00
.github/workflows ci: multiple CI jobs 2022-03-21 21:57:23 +00:00
data/nginx use port 8080 instead 2022-03-21 21:44:25 +00:00
sql fix(worker): round drive_segments.distance_meters to int 2022-03-24 22:52:39 +00:00
src fix(useradmin): using wrong endpoint for pair_device 2022-03-25 00:46:32 +00:00
static TODO: initial retropilot-server commit 2021-05-16 04:35:18 +02:00
test build router for each endpoint 2022-03-22 15:14:08 +00:00
.babelrc.json cleanup 2022-03-21 13:13:22 +00:00
.dockerignore Update Dockerfile, add .dockerignore 2022-01-21 00:02:18 +00:00
.editorconfig chore: add .editorconfig 2022-03-12 17:14:41 +00:00
.env.docker.sample fix worker not finding unprocessed segments 2022-03-24 15:47:47 +00:00
.env.sample add LOG_LEVEL to dotenv 2022-03-24 19:41:20 +00:00
.eslintignore cleanup 2022-03-21 13:13:22 +00:00
.eslintrc.json build router for each endpoint 2022-03-22 15:14:08 +00:00
.gitignore seperate dotenv file for docker overrides 2022-03-23 15:14:04 +00:00
Dockerfile bump cabana 2022-03-26 16:19:33 +00:00
LICENSE Initial commit 2021-05-16 04:24:48 +02:00
README.md Add uptime to README 2022-03-24 21:37:22 +00:00
docker-compose.uat.yml cleanup 2022-03-12 17:14:45 +00:00
docker-compose.yml seperate dotenv file for docker overrides 2022-03-23 15:14:04 +00:00
ecosystem.config.js big refactor - move into src/worker and src/server 2022-03-21 10:54:50 +00:00
init-letsencrypt.sh Add https support 2022-03-02 21:59:12 -05:00
package-lock.json babel 2022-03-21 13:13:28 +00:00
package.json babel 2022-03-21 13:13:28 +00:00
retropilot.patch Update retropilot.patch 2022-03-23 15:42:14 +00:00

README.md

retropilot-server

Uptime Robot status Uptime Robot ratio (7 days) CI workflow

Replacement for comma.ai backend and useradmin dashboard. Bundled with a modified version of comma's cabana to allow viewing & analyzing drives.

If you don't want to host your own instance, check out https://api.retropilot.org/useradmin for a hosted version of the backend, useradmin and cabana.

[Server] Summary

The server consists of 2 node scripts.

  • src/server is using expressjs and runs the backend (file upload / communication with openpilot) and the useradmin dashboard to manage / view / download drives & logs.

  • src/worker is a background worker that is processing drives (analyzing video files & logs) to prepare drives for playback in cabana and to gather statistics. It automatically terminates itself after 60 minutes to make sure the video/log libraries do not cause memory leaks.

Attention: Minimum required node version is node 10.

[Server] Installation

npm install
cp config.sample.js config.js
cp database.empty.sqlite database.sqlite
> EDIT config.js

[Server] Running

node -r esm src/server
node -r esm src/worker

[Server] CABANA Support

A compiled version of a custom cabana fork (https://github.com/florianbrede-ayet/retropilot-cabana) is directly bundled in the cabana/ subdirectory and will be served by the express app. After starting index.js, cabana is ready to use.


[Device] Preparation / Enable Custom Server

On the device or in your fork's code, replace all API endpoints with your own server endpoint. This could be executed directly on the device in the shell to use https://api.retropilot.org as backend:

find /data/openpilot -type f -exec sed -i 's/https:\/\/api.commadotai.com/https:\/\/api.retropilot.org/g' {} +

[Device] Swapping Servers (Back)

To switch a device between different servers, you have to remove the old DongleId and reboot:

rm /data/params/d/DongleID
reboot

There is no need to backup the DongleId, as the new server will identify your device based on its imei, serial and public key.

[Device] Raw Drives Not Uploading (fcamera & rlog)

  1. Raw data is only uploaded if the device is sufficiently charged, not connected to an active panda (offroad) and there are no immediate files (boot, crash, qcamera, qlog) remaining.
  2. Your branch might have raw uploads disabled, check Device Settings > Upload Raw Logs.

If that doesn't help or the option is not available, try:

echo "1" > /data/params/d/IsUploadRawEnabled
echo "1" > /data/params/d/UploadRaw
reboot

Current Limitations

OpenPilot before 0.8.3 will not display any statistics or pairing status in the dashboard. The reason is that pre 0.8.3, the offroad.apk with react and comma-api would require recompilation to accept the new endpoints.

The athena websockets interface is not implemented yet, so the comma app and athena specific remote control commands (including "upload on demand") are not functional as of now.

Screenshots

image

image

image

image

UAT

Launch with:

docker-compose -f docker-compose.yml -f docker-compose.uat.yml up -d