• Stars
    star
    2,232
  • Rank 19,833 (Top 0.5 %)
  • Language
    C
  • Created over 11 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dump1090 is a simple Mode S decoder for RTLSDR devices

Dump1090 README

Dump 1090 is a Mode S decoder specifically designed for RTLSDR devices.

The main features are:

  • Robust decoding of weak messages, with mode1090 many users observed improved range compared to other popular decoders.
  • Network support: TCP30003 stream (MSG5...), Raw packets, HTTP.
  • Embedded HTTP server that displays the currently detected aircrafts on Google Map.
  • Single bit errors correction using the 24 bit CRC.
  • Ability to decode DF11, DF17 messages.
  • Ability to decode DF formats like DF0, DF4, DF5, DF16, DF20 and DF21 where the checksum is xored with the ICAO address by brute forcing the checksum field using recently seen ICAO addresses.
  • Decode raw IQ samples from file (using --ifile command line switch).
  • Interactive command-line-interfae mode where aircrafts currently detected are shown as a list refreshing as more data arrives.
  • CPR coordinates decoding and track calculation from velocity.
  • TCP server streaming and receiving raw data to/from connected clients (using --net).

While from time to time I still add / fix stuff in my fork, I target minimalism of the implementation. However there is a much more feature complete fork available, developed by MalcolmRobb.

Installation

Type "make".

Normal usage

To capture traffic directly from your RTL device and show the captured traffic on standard output, just run the program without options at all:

./dump1090

To just output hexadecimal messages:

./dump1090 --raw

To run the program in interactive mode:

./dump1090 --interactive

To run the program in interactive mode, with networking support, and connect with your browser to http://localhost:8080 to see live traffic:

./dump1090 --interactive --net

In interactive mode it is possible to have a less information dense but more "arcade style" output, where the screen is refreshed every second displaying all the recently seen aircrafts with some additional information such as altitude and flight number, extracted from the received Mode S packets.

Using files as source of data

To decode data from file, use:

./dump1090 --ifile /path/to/binfile

The binary file should be created using rtl_sdr like this (or with any other program that is able to output 8-bit unsigned IQ samples at 2Mhz sample rate).

rtl_sdr -f 1090000000 -s 2000000 -g 50 output.bin

In the example rtl_sdr a gain of 50 is used, simply you should use the highest gain availabe for your tuner. This is not needed when calling Dump1090 itself as it is able to select the highest gain supported automatically.

It is possible to feed the program with data via standard input using the --ifile option with "-" as argument.

Additional options

Dump1090 can be called with other command line options to set a different gain, frequency, and so forth. For a list of options use:

./dump1090 --help

Everything is not documented here should be obvious, and for most users calling it without arguments at all is the best thing to do.

Reliability

By default Dump1090 tries to fix single bit errors using the checksum. Basically the program will try to flip every bit of the message and check if the checksum of the resulting message matches.

This is indeed able to fix errors and works reliably in my experience, however if you are interested in very reliable data I suggest to use the --no-fix command line switch in order to disable error fixing.

Performances and sensibility of detection

In my limited experience Dump1090 was able to decode a big number of messages even in conditions where I encountered problems using other programs, however no formal test was performed so I can't really claim that this program is better or worse compared to other similar programs.

If you can capture traffic that Dump1090 is not able to decode properly, drop me an email with a download link. I may try to improve the detection during my free time (this is just an hobby project).

Network server features

By enabling the networking support with --net Dump1090 starts listening for clients connections on port 30002 and 30001 (you can change both the ports if you want, see --help output).

Port 30002

Connected clients are served with data ASAP as they arrive from the device (or from file if --ifile is used) in the raw format similar to the following:

*8D451E8B99019699C00B0A81F36E;

Every entry is separated by a simple newline (LF character, hex 0x0A).

Port 30001

Port 30001 is the raw input port, and can be used to feed Dump1090 with data in the same format as specified above, with hex messages starting with a * and ending with a ; character.

So for instance if there is another remote Dump1090 instance collecting data it is possible to sum the output to a local Dump1090 instance doing something like this:

nc remote-dump1090.example.net 30002 | nc localhost 30001

It is important to note that what is received via port 30001 is also broadcasted to clients listening to port 30002.

In general everything received from port 30001 is handled exactly like the normal traffic from RTL devices or from file when --ifile is used.

It is possible to use Dump1090 just as an hub using --ifile with /dev/zero as argument as in the following example:

./dump1090 --net-only

Or alternatively to see what's happening on the screen:

./dump1090 --net-only --interactive

Then you can feed it from different data sources from the internet.

Port 30003

Connected clients are served with messages in SBS1 (BaseStation) format, similar to:

MSG,4,,,738065,,,,,,,,420,179,,,0,,0,0,0,0
MSG,3,,,738065,,,,,,,35000,,,34.81609,34.07810,,,0,0,0,0

This can be used to feed data to various sharing sites without the need to use another decoder.

Antenna

Mode S messages are transmitted in the 1090 Mhz frequency. If you have a decent antenna you'll be able to pick up signals from aircrafts pretty far from your position, especially if you are outdoor and in a position with a good sky view.

You can easily build a very cheap antenna following the istructions at:

http://antirez.com/news/46

With this trivial antenna I was able to pick up signals of aircrafts 200+ Km away from me.

If you are interested in a more serious antenna check the following resources:

Aggressive mode

With --aggressive it is possible to activate the aggressive mode that is a modified version of the Mode S packet detection and decoding. THe aggresive mode uses more CPU usually (especially if there are many planes sending DF17 packets), but can detect a few more messages.

The algorithm in aggressive mode is modified in the following ways:

  • Up to two demodulation errors are tolerated (adjacent entires in the magnitude vector with the same eight). Normally only messages without errors are checked.
  • It tries to fix DF17 messages trying every two bits combination.

The use of aggressive mdoe is only advised in places where there is low traffic in order to have a chance to capture some more messages.

Debug mode

The Debug mode is a visual help to improve the detection algorithm or to understand why the program is not working for a given input.

In this mode messages are displayed in an ASCII-art style graphical representation, where the individial magnitude bars sampled at 2Mhz are displayed.

An index shows the sample number, where 0 is the sample where the first Mode S peak was found. Some additional background noise is also added before the first peak to provide some context.

To enable debug mode and check what combinations of packets you can log, use mode1090 --help to obtain a list of available debug flags.

Debug mode includes an optional javascript output that is used to visualize packets using a web browser, you can use the file debug.html under the 'tools' directory to load the generated frames.js file.

How this program works?

The code is very documented and written in order to be easy to understand. For the diligent programmer with a Mode S specification on his hands it should be trivial to understand how it works.

The algorithms I used were obtained basically looking at many messages as displayed using a trow-away SDL program, and trying to model the algorithm based on how the messages look graphically.

How to test the program?

If you have an RTLSDR device and you happen to be in an area where there are aircrafts flying over your head, just run the program and check for signals.

However if you don't have an RTLSDR device, or if in your area the presence of aircrafts is very limited, you may want to try the sample file distributed with the Dump1090 distribution under the "testfiles" directory.

Just run it like this:

./dump1090 --ifile testfiles/modes1.bin

What is --strip mode?

It is just a simple filter that will get raw IQ 8 bit samples in input and will output a file missing all the parts of the file where I and Q are lower than the specified for more than 32 samples.

Use it like this:

cat big.bin | ./dump1090 --snip 25 > small.bin

I used it in order to create a small test file to include inside this program source code distribution.

Contributing

Dump1090 was written during some free time during xmas 2012, it is an hobby project so I'll be able to address issues and improve it only during free time, however you are incouraged to send pull requests in order to improve the program. A good starting point can be the TODO list included in the source distribution.

Credits

Dump1090 was written by Salvatore Sanfilippo [email protected] and is released under the BSD three clause license.

More Repositories

1

disque

Disque is a distributed message broker
C
7,969
star
2

kilo

A text editor in less than 1000 LOC with syntax highlight and search.
C
6,839
star
3

smallchat

A minimal programming example for a chat server
C
6,606
star
4

sds

Simple Dynamic Strings library for C
C
4,649
star
5

linenoise

A small self-contained alternative to readline and libedit
C
3,348
star
6

neural-redis

Neural networks module for Redis
C
2,218
star
7

lamernews

Lamer News -- an HN style social news site written in Ruby/Sinatra/Redis/JQuery
Ruby
1,357
star
8

hping

hping network tool
C
1,327
star
9

smaz

Small strings compression library
C
1,096
star
10

rax

A radix tree implementation in ANSI C
C
1,043
star
11

botlib

C Telegram bot framework
C
754
star
12

load81

SDL based Lua programming environment for kids similar to Codea
C
586
star
13

disque-module

Disque ported as Redis module
C
480
star
14

protoview

Flipper Zero app to display known and unknown signals
C
445
star
15

shapeme

Evolve images using simulated annealing
C
382
star
16

aocla

A small stack based, written to bring Advent of Code 2022 Day 13 puzzle to the extreme consequences
C
371
star
17

retwis

A Twitter-toy clone written in PHP and Redis, used in the early days to introduce Redis data types.
PHP
357
star
18

lua-cmsgpack

A self contained Lua MessagePack C implementation.
C
343
star
19

freakwan

A MicroPython driver for the SX1276 LoRa chip
C++
274
star
20

otree

a simple btree implementation with automatic space reclaiming
C
268
star
21

redis-sampler

Small program to understand the composition of your Redis data set
Ruby
260
star
22

redis-rb-cluster

Redis Cluster Ruby client based on redis-rb
Ruby
246
star
23

stonky

Stock market Telegram bot
C
242
star
24

RESP3

RESP protocol V3 repository. Contains the specification, and other related resource
221
star
25

redlock-rb

Redlock Redis-based distributed locks implementation in Ruby
Ruby
197
star
26

lloogg

LLOOGG realtime web log analyzer
PHP
195
star
27

redis-timeseries

Ruby library for Redis backed time series.
Ruby
195
star
28

redis-tools

Abandoned project "Redis tools". What was relevant is now part of redis-cli & redis-benchmark
C
194
star
29

pngtostl

Turn PNG images into STL 3D models that will "develop" in front of a light source
C
157
star
30

iconping

Icon Ping - visual ping to 4.2.2.2
Objective-C
129
star
31

jsrt

Javascript ray tracing engine
118
star
32

adventofcode2022

A few Advent of Code puzzles (2022 edition) in C
C
102
star
33

redimension

Redis multi-dimensional query library
Ruby
98
star
34

gopher2redis

A Ruby script that translates a directory structure and its files into the Redis keys to be served via Redis Gopher protocol
Ruby
90
star
35

mc-benchmark

Memcache port of Redis benchmark
C
85
star
36

listpack

A serialization format and implementation for backward-traversable lists of strings.
C
79
star
37

Bigdis

Bigdis - a file-based KV store speaking the Redis protocol
Tcl
76
star
38

visitors

Visitors fast web log analyzer
C
76
star
39

book-examples

Redis The Definitive Guide book code examples
Ruby
51
star
40

flipper-asteroids

Asteroids for Flipper Zero
C
50
star
41

Gitan

Gitan is a very basic web interface to create and inspect bare git repositories
Ruby
45
star
42

aspark

ASCII sparklines for the Enterprise
C
41
star
43

Jim

Jim is a small footprint Tcl interpreter, with some changes to the original language but mostly compatible.
40
star
44

nolate

NO LAme TEmplate System for Ruby
Ruby
40
star
45

recidiv

minimal continuous integration framework written in Tcl (used for Redis CI)
Tcl
38
star
46

tclircd

An IRC server I wrote in 2004 for fun, using the Tcl language.
Tcl
37
star
47

partitions

Partitions.tcl is a Tcl program to simulate partitions between physical hosts
Tcl
36
star
48

connect4-montecarlo

Simple connect 4 AI using Monte Carlo method
C
31
star
49

talk32

C program to talk via serial to MicroPython powered ESP32 boards
C
28
star
50

failed-3d-prints-bot

A Telegram bot that detects failed prints and send you an image of your printer
C
22
star
51

iqmeteo

Meteo widget for the Garmin Vivoactive HR powered by Yahoo Weather API
Shell
21
star
52

siphash

A modification of SipHash reference implementation to make it more practical for Redis usage
C
20
star
53

redisdotphp

Legacy Redis PHP client lib. A best-effort support repository.
18
star
54

yaku-ns

a DNS server I wrote 10 years ago. Here for historical reasons
C
18
star
55

strabo

Turns HGT elevation maps into 2D images or 3D models
C
18
star
56

nn-2003

2003 Neural Networks experiments -- when it was not mainstream ;-)
C
17
star
57

zx2040

RP2040 ZX Spectrum emulator
C
15
star
58

crack-checksum

Find checksum (crc8, xor, add) parameters in a set of messages.
C
13
star
59

hiredis

WARNING: hiredis repository moved to http://github.com/redis/hiredis. Just my private fork.
13
star
60

dict-scan-fuzz-tester

Fuzz testing for the SCAN underlying algorithm
C
11
star
61

Siboom

A simple markup system for writing books drafts
Ruby
10
star
62

sbignum

Old code about C library for big numbers plus Tcl bindings
C
9
star
63

codakido

Redirects to Load81 project
8
star
64

redis-cp-rewrite-sim

Redis/Raft snapshotting rewriting simulation
C
8
star
65

cache-mem-tester

Test memory efficiency of Redis / Memcached against values with a given size distribution.
Ruby
7
star
66

rascan

A prototype for a multi processes port scanner I wrote in 1998. Here only to archive it for myself.
C
6
star
67

LLM-FTC-sampling

First token cutoff sampling inference example
Python
6
star
68

t-watch-s3-micropython

Minimal MicroPython programming example for the Lilygo T-WATCH S3
Python
4
star
69

bma423-pure-mp

Pure MicroPython BMA423 accelerometer driver
Python
4
star
70

simple-language-model

Code for the video on feed-forward language model
Python
4
star
71

gif-pure-tcl

Pure TCL GIF generator
Tcl
4
star
72

bme680-pure-mp

Pure MicroPython Bosch BME680 sensor driver
Python
3
star
73

uc8151_micropython

UC8151 / IL0373 MicroPython e-paper display driver with support for greyscales and fast updates
Python
2
star
74

vl53l0x-nb

Fork of MicroPython driver for vl53l0x TOF sensor to add non-blocking mode.
Python
1
star
75

micropython-ft6x06

Simple driver for FT6x06 capacitive touch sensor in pure Python
Python
1
star