Skip to content
skarppiPublic

About

Flight logbook from OpenTX logs

Resources

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

OpenTX Logbook

Logbook for radio controlled (RC) flights from OpenTX logs.


Web application to keep track of your RC flights flown with transmitter running OpenTX or EdgeTX firmware such as Radiomaster TX16S. Logbook entries are generated automatically from log files uploaded to the service and can be enriched with additional details manually such as batteries used or journal.

Current functionalities include

  • Graphs presenting flights and flight times
  • Watch DVR or other related videos for flights
  • Visualize full telemetry similar to OpenTX Companion Log Viewer
  • Battery cycles, state and graphs
  • Manage planes
  • Manage locations
  • iOS app for easy syncing of new flights

OpenTX Log Files

In your transmitter setup "SD Logs" Special Function to enable logging of telemetry values to SD card while flying.

I use two-stage arming. Switch SA is a safety switch and also turns on the logging, then switch SB arms the quadcopter. Flight timer starts when the quad is armed and throttle is increased. A new flight is created when logging is turned off for more than 30 seconds and restarted again.

After flying is done, sync new log files automatically using uploader iOS app or connect transmitter to computer and drag&drop latest csv files from SD card LOGS directory to Upload-tab of the service.

For more information read Working with Log Files.

Quick Start

git clone https://github.com/skarppi/logbook.git <MyProjectName>
cd <MyProjectName>

pnpm install

psql
create database logbook;
create user logbook with password 'logbook';
grant all privileges on database logbook to logbook;
ALTER DATABASE logbook OWNER TO logbook;

CREATE EXTENSION IF NOT EXISTS earthdistance SCHEMA logbook;

psql -d logbook -f 1-init.sql
psql -d logbook -f 2-locations.sql
psql -d logbook -f 3-batteries.sql

pnpm dev

Usage

  • pnpm dev - Client and server are in development mode http://localhost:3000
  • pnpm build - server/dist folder will include all the needed files, both client (Bundle) and server.
  • pnpm production - Just runs node ./server/dist/server/src/server.js

Upload DVR files from FatShark or similar googles to VIDEOS/ folder. Use flight ID as filename e.g. TWR-2018-10-09-Session1.mov or just TWR-2018-10-09.mov if the video is not specific to any single flight.

Videos can also be stored in another server configured with VIDEO_SERVER env variable. See example PHP implementation at src/videoserver for Synology NAS running Web Station.

Deployments

Run docker-build.sh [dev/prod] http://host/path and docker-run.sh scripts. Set public url if your service is not running at the default https://localhost:3000.

Example Apache configuration to proxy requests into Docker container.

<VirtualHost *:443> # Host videos from another server ProxyPass /api/videos ! Redirect 301 /api/videos https://your.synology.ip/videoserver/search.php

    # Dev mode only: forward Vite HMR WebSocket (see note below)
    RewriteEngine On
    RewriteCond %{HTTP:Upgrade} websocket [NC]
    RewriteCond %{HTTP:Connection} upgrade [NC]
    RewriteRule ^/?(.*) "ws://localhost:3000/$1" [P,L]

    # Service running at the root
    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/

    # Service running under some path (PUBLIC_URL)
    # ProxyPass /logbook http://localhost:3000/logbook
    # ProxyPassReverse /logbook http://localhost:3000/logbook

When running the dev container behind a TLS reverse proxy, the browser cannot reach Vite's HMR WebSocket on localhost. Point the HMR client at the public host by setting these env vars for the client (e.g. in client/.env or passed to the container):

VITE_HMR_HOST=public.host.name
VITE_HMR_PROTOCOL=wss
VITE_HMR_CLIENT_PORT=443

These are only needed for dev-mode HMR behind a proxy; plain local dev and production builds work without them.


Requirements

  • Node 22+
  • pnpm 10+
  • Postgres

Licence

This code is released as is, under MIT licence. Feel free to use it for free for both commercial and private projects. No warranty provided.

About

Flight logbook from OpenTX logs

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages