CoolFace
Modelpublic

InferenceEngineer/logextractor

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
Model Card

Drone Log Extractor — Vercel Web App

A minimal Flask web app: upload an ArduPilot .bin log, download a CSV with: Time_s, Alt_m, Speed_m_s, Throttle_pct, Battery_pct, Roll_deg, Pitch_deg, Yaw_deg, Lat, Lon

Files

drone_vercel_app/
├── app.py            # Flask app: upload form + extraction logic
├── requirements.txt  # Python dependencies
├── vercel.json       # Vercel build/routing config
└── README.md

⚠️ Important limits before you deploy

Vercel serverless functions (Hobby plan) have:

  • 10-second execution timeout — large/long flight logs may not finish parsing in time (Pro plan raises this to 60s+).
  • ~4.5 MB request body limit — big .bin files may be rejected outright.

If your logs are large, either upgrade to Vercel Pro, or run the app on a platform without these limits (e.g., a small VPS, Render, Railway, or your own machine using the local CLI script I gave you earlier). This app is best suited for short/medium flight logs.

Option A: Deploy to Vercel (fastest)

1. Install the Vercel CLI

bash
npm install -g vercel

2. Log in

bash
vercel login

3. Deploy

From inside the drone_vercel_app folder:

bash
cd drone_vercel_app
vercel

Answer the prompts (link to a new project, accept defaults). Vercel will build and give you a live URL like https://drone-log-extractor.vercel.app.

For production deployment (not just a preview):

bash
vercel --prod

Option B: Deploy via GitHub (recommended for ongoing use)

  1. 1.Create a new GitHub repo and push these 3 files (app.py, requirements.txt, vercel.json):
bash
   cd drone_vercel_app
   git init
   git add .
   git commit -m "Initial commit"
   git remote add origin https://github.com/YOUR_USERNAME/drone-log-extractor.git
   git push -u origin main
  1. 1.Go to vercel.com/new, import the repo, click Deploy.
  2. 2.Vercel auto-detects the Python runtime from vercel.json and builds it.

Testing locally before deploying

bash
cd drone_vercel_app
python -m venv venv
source venv/bin/activate      # Windows: venv\Scripts\activate
pip install -r requirements.txt
python app.py

Then open http://127.0.0.1:5000 in your browser, upload a .bin file, and confirm the CSV downloads correctly. This local test uses Flask's dev server — separate from how Vercel runs it, but confirms the extraction logic and UI work end-to-end.

How the UI works

  1. 1.Visit the site — you'll see a simple dark-themed form with:
  2. 2.A file picker restricted to .bin files
  3. 3.Two optional number fields for battery voltage range (defaults: 12.6V full / 9.9V empty, for 3S LiPo)
  4. 4.Click Extract to CSV.
  5. 5.The server parses the log in-memory, aligns all data streams by timestamp, and returns a preview page showing the first 20 rows in a scrollable table, plus row/column counts.
  6. 6.Review the preview, then click ⬇ Download CSV — this triggers an instant client-side download (the full CSV is embedded in the page, so no second server request is needed).
  7. 7.Click Upload another file to go back and process a different log.
  8. 8.If something goes wrong (wrong file type, no GPS data in the log, etc.), the upload page reloads with a clear error message instead of crashing.

Adjusting for your battery

Change the voltage fields in the UI per upload, or edit the defaults in app.py:

python
DEFAULT_FULL_VOLT = 12.6   # 4S = 16.8, 6S = 25.2
DEFAULT_EMPTY_VOLT = 9.9   # 4S = 13.2, 6S = 19.8

Troubleshooting

"Extraction failed: No GPS messages found in this log" Your log doesn't contain GPS data (e.g., indoor flight, GPS-denied test). Lat/Lon/Alt/Speed can't be reconstructed without it.

Deployment fails on `pymavlink` install Vercel's Python build occasionally has trouble with compiled dependencies. If this happens, pin an exact working version in requirements.txt (e.g., pymavlink==2.4.41) and redeploy.

Upload silently fails / times out on Vercel You've likely hit the request size or execution time limit described above — try a shorter log or move to a platform without those constraints.