Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.
/ readsb Public archive

Commit

Permalink
Merged with dump1090-fa tag 3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mictronics committed Feb 22, 2017
2 parents 3ad6faa + 09f6bed commit b818c3d
Show file tree
Hide file tree
Showing 25 changed files with 2,165 additions and 680 deletions.
50 changes: 37 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
PROGNAME=dump1090
DUMP1090_VERSION='3.3.2 Mictronics'
DUMP1090_VERSION='3.4.0 Mictronics'

RTLSDR ?= yes
BLADERF ?= yes

CC=gcc
CPPFLAGS += -DMODES_DUMP1090_VERSION=\"$(DUMP1090_VERSION)\" -DMODES_DUMP1090_VARIANT=\"dump1090-fa\"

ifneq ($(RTLSDR_PREFIX),"")
CPPFLAGS += -I$(RTLSDR_PREFIX)/include
LDFLAGS += -L$(RTLSDR_PREFIX)/lib
endif

ifneq ($(HTMLPATH),"")
CPPFLAGS += -DHTMLPATH=\"$(HTMLPATH)\"
endif
Expand All @@ -17,19 +15,39 @@ DIALECT = -std=c11
CFLAGS += $(DIALECT) -O2 -g -W -D_DEFAULT_SOURCE -Wall -Werror
LIBS = -lpthread -lm -lrt

ifeq ($(STATIC), yes)
LIBS_RTLSDR = -Wl,-Bstatic -lrtlsdr -Wl,-Bdynamic -lusb-1.0
else
LIBS_RTLSDR = -lrtlsdr -lusb-1.0
ifeq ($(RTLSDR), yes)
SDR_OBJ += sdr_rtlsdr.o
CPPFLAGS += -DENABLE_RTLSDR

ifdef RTLSDR_PREFIX
CPPFLAGS += -I$(RTLSDR_PREFIX)/include
LDFLAGS += -L$(RTLSDR_PREFIX)/lib
else
CFLAGS += $(shell pkg-config --cflags librtlsdr)
LDFLAGS += $(shell pkg-config --libs-only-L librtlsdr)
endif

ifeq ($(STATIC), yes)
LIBS_SDR += -Wl,-Bstatic -lrtlsdr -Wl,-Bdynamic -lusb-1.0
else
LIBS_SDR += -lrtlsdr -lusb-1.0
endif
endif

ifeq ($(BLADERF), yes)
SDR_OBJ += sdr_bladerf.o
CPPFLAGS += -DENABLE_BLADERF
CFLAGS += $(shell pkg-config --cflags libbladeRF)
LIBS_SDR += $(shell pkg-config --libs libbladeRF)
endif

all: dump1090 view1090

%.o: %.c *.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o crc.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o $(COMPAT)
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_RTLSDR) -lncurses
dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o crc.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o sdr_ifile.o sdr.o $(SDR_OBJ) $(COMPAT)
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_SDR) -lncurses

view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o $(COMPAT)
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS) -lncurses
Expand All @@ -38,7 +56,7 @@ faup1090: faup1090.o anet.o mode_ac.o mode_s.o net_io.o crc.o stats.o cpr.o icao
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS)

clean:
rm -f *.o compat/clock_gettime/*.o compat/clock_nanosleep/*.o dump1090 view1090 faup1090 cprtests crctests
rm -f *.o compat/clock_gettime/*.o compat/clock_nanosleep/*.o dump1090 view1090 faup1090 cprtests crctests convert_benchmark

test: cprtests
./cprtests
Expand All @@ -48,3 +66,9 @@ cprtests: cpr.o cprtests.o

crctests: crc.c crc.h
$(CC) $(CPPFLAGS) $(CFLAGS) -g -DCRCDEBUG -o $@ $<

benchmarks: convert_benchmark
./convert_benchmark

convert_benchmark: convert_benchmark.o convert.o util.o
$(CC) $(CPPFLAGS) $(CFLAGS) -g -o $@ $^ -lm
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,43 @@ It is designed to build as a Debian package.

## Building under jessie

### Dependencies - bladeRF

You will need a build of libbladeRF. You can build packages from source:

$ git clone https://github.com/Nuand/bladeRF.git
$ cd bladeRF
$ dpkg-buildpackage -b

Or Nuand has some build/install instructions including an Ubuntu PPA
at https://github.com/Nuand/bladeRF/wiki/Getting-Started:-Linux

Or FlightAware provides armhf packages as part of the piaware repository;
see https://flightaware.com/adsb/piaware/install

### Dependencies - rtlsdr

This is packaged with jessie. "sudo apt-get install librtlsdr-dev"

### Actually building it

Nothing special, just build it ("dpkg-buildpackage -b")

## Building under wheezy

First run "prepare-wheezy-tree.sh". This will create a package tre in
First run "prepare-wheezy-tree.sh". This will create a package tree in
package-wheezy/. Build in there ("dpkg-buildpackage -b")

The wheezy build does not include bladeRF support.

## Building manually

You can probably just run "make" after installing the required dependencies.
Binaries are built in the source directory; you will need to arrange to
install them (and a method for starting them) yourself.

"make BLADERF=no" will disable bladeRF support and remove the dependency on
libbladeRF.

"make RTLSDR=no" will disable rtl-sdr support and remove the dependency on
librtlsdr.
43 changes: 43 additions & 0 deletions bladerf/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
bladeRF support
---------------

There is basic support for the bladeRF included in dump1090-fa.
It uses the same demodulator as the regular rtlsdr version and it does not
take advantage of the bladeRF's improved sampling rate or FPGA (but see below)

To use it:

$ dump1090-fa --device-type bladerf --gain 66 (.. other options ..)

The bladeRF has sensitivity problems when receiving ADS-B and will benefit
from all the gain you can give it. 66dB is the maximum configurable gain on
the board itself, you may want to add an external LNA too.


bladeRF custom FPGA bitstream
-----------------------------

The package includes a custom FPGA bitstream for the bladeRF which can
improve ADS-B reception with dump1090.

It adds a Fs/4 mixer step to avoid the DC offset of the bladeRF, and
decimate-by-8 downsampling step to improve sensitivity. Some of the bladeRF
parameters need to be adjusted so that it produces correctly tuned/downsampled
data in the form that dump1090 is expecting.

To use it:

$ dump1090-fa --device-type bladerf --gain 66 \
--bladerf-fpga /usr/share/dump1090-fa/bladerf/decimate8-x40.rbf \
--bladerf-decimation 8 \
--bladerf-bandwidth 14000000 \
--freq 1085200000 \
(other options ...)

The bladeRF will be configured for a 19.2MHz sampling rate and will tune to
1085.2MHz so that the 1090MHz signal appears around 4.8MHz in the baseband
samples. The FPGA Fs/4 mixing step shifts the baseband signal so that it is centered
around 0, and the FPGA downsampling step produces samples at 2.4MHz, which is what
dump1090 is expecting.

This FPGA bitstream is built for the 40kLE bladeRF.
Binary file added bladerf/decimate8-x40.rbf
Binary file not shown.

0 comments on commit b818c3d

Please sign in to comment.