Giter VIP home page Giter VIP logo

adsb-stats-logger's Introduction

wakatime

GitHub tag (latest SemVer) GitHub Release Date GitHub last commit

GitHub Repo stars GitHub watchers

Discord

ADS-B Stats Logger

Like this project? Don't forget to STAR it and follow it for future releases :)

Features

  • Log all unique flights seen by the ADS-B receiver
  • Log all unique operators seen by the ADS-B receiver
  • Log the flight with the highest altitude seen by the ADS-B receiver
  • Log the flight with the highest speed seen by the ADS-B receiver
  • Log the flight the furthest away from the ADS-B receiver
  • Log the flight closest from the ADS-B receiver
  • Log the flight with the best signal strength seen by the ADS-B receiver
  • Log the flight with the worst signal strength seen by the ADS-B receiver
  • All data is available in Metric Units (by default) or Imperial Units

Python Compatibility

This has been tested and confirmed to work on Python 3.10, but should work fine in Python.

Usage

  1. Clone the git repo on your ADS-B server and enter its directory:
git clone https://github.com/nfacha/adsb-stats-logger.git
cd adsb-stats-logger
  1. Copy the config file sample:
cp config.ini.sample config.ini
  1. Edit the config to your liking, one easy way would be using nano
nano config.ini
  1. Edit the config to your liking, one easy way would be using nano
[PATHS]
DATA_PATH = /run/dump1090-fa/ #The path to your dump1090 logs folder
[LOCATION]
STATION_LAT = 37.7 #Your base station latitude, used for distance calculations
STATION_LNG = 37.7 #Your base station longitude, used for distance calculations
[LOGGING]
SENTRY_DSN =#Sentry DSN for error logging, leave empry to disable
SENTRY_ENVIRONMENT=#Sentry environment, leave empry to disable
LOG_LEVEL = 20 #Log level, see https://docs.python.org/3/library/logging.html#logging-levels
[UNITS]
USE_METRIC_SYSTEM = true #Use metric system for distance calculations, else use caveman units (a.k.a. imperial)
  1. Leave the script running in the background, one easy way would be to use screen
screen -S logger -dm python3 logger.py
  1. By now the script should be running, wait a bit for data to gather and as soon as you have at least one plane in your range it should start to gather data, to see this data use
python3 show.py

You will get an output similar to this:

INFO:root:Logging level: 20
INFO:root:Use metric system: True
--- Metrics ---
Data range: 2022-01-07 16:33:15 - 2022-01-07 13:26:54
Unique Flights: 5
Unique Operators: 3
Max Altitude: Flight IBE6317 11.879000304785126 km at 2022-01-07 13:39:43
Max Speed: Flight IBE6501 851.3644 kmh at 2022-01-07 13:36:00
Max Station Distance: Flight RYR28FF 5449.571199579309 km at 2022-01-07 15:34:44
Min Station Distance: Flight SAT571 12.83198307011012 km at 2022-01-07 16:33:14
Max Signal: Flight IBE6317 -16.3 db at 2022-01-07 13:39:43
Min Signal: Flight IBE6501 -24.0 db at 2022-01-07 13:39:43
--- Unique Flights Seen ---
SAT2500 last seen on 2022-01-07 13:26:54
IBE6317 last seen on 2022-01-07 13:39:48
IBE6501 last seen on 2022-01-07 13:39:48
RYR28FF last seen on 2022-01-07 15:40:59
SAT571 last seen on 2022-01-07 16:33:15
--- Unique Operators Seen ---
SAT last seen on 2022-01-07 16:33:15
IBE last seen on 2022-01-07 13:39:48
RYRFF last seen on 2022-01-07 15:40:59

Process finished with exit code 0

If you want to see the runtime logs, or to be able to Ctrl-C you can enter the screen with:

screen -x logger

Inspiration

This was inspired by wesmorgan1's Reddit post: https://www.reddit.com/r/ADSB/comments/rutot0/python3_script_to_profile_dump1090_output_and/

adsb-stats-logger's People

Contributors

bombardier-c-kram avatar nfacha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

adsb-stats-logger's Issues

Error in python3 show.py

I got these results ~

~/adsb-stats-logger $ python3 show.py
show.py:18: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if config['LOGGING']['SENTRY_DSN'] is not '':
Traceback (most recent call last):
File "show.py", line 4, in
import sentry_sdk
ModuleNotFoundError: No module named 'sentry_sdk'

~/adsb-stats-logger $ python3 --version
Python 3.8.10

Running new Linux Mint 21, based on Ubuntu 22.04 on Intel DuoCore wi;th 1.8 gBytes RAM.
And following were running -- readsb, tar1090, graphs1090, timelapse1090, collectd and the adsbexchange programs (feed, mlat,anywhere, etc.)

Also, I wasn't sure what the screen command was supposed to do. It didn't open a new terminal window.

When I ran screen -S logger -dm python3 logger.py, nothing happened. And when I ran
screen -x logger, it said this:
screen -x logger
There is no screen to be attached matching logger

Aug 9-2022

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.