Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pending latest changes from Widehopf: Dev #5

Open
wants to merge 90 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
1d6ef5f
invalidate CPRs when reaching position reliability zero
wiedehopf Jun 11, 2024
c9b9020
get going a bit quicker after reaching zero reliability
wiedehopf Jun 11, 2024
dea46ed
dockerfile use run mount
wiedehopf Jun 14, 2024
4f7a7f1
ifile: don't use synthetic time for stdin
wiedehopf Jun 14, 2024
51f2188
cpr debug print
wiedehopf Jun 18, 2024
526c5d7
hackrf oddities
wiedehopf Jul 9, 2024
874c84e
non-MLAT aircraft without valid track data: more trace positions
wiedehopf Jul 10, 2024
1a4c123
fix exit on hang logic not signaling exit properly
wiedehopf Jul 11, 2024
1ed7c88
incrementing version: 3.14.1632
wiedehopf Jul 11, 2024
0043344
--devel=forwardMinMessages,2
wiedehopf Jul 11, 2024
8329053
gpsd_in: ignore non-TPV messages
wiedehopf Jul 12, 2024
94c4b2d
add --devel=tar1090NoGlobe
wiedehopf Jul 13, 2024
07df2f2
incrementing version: 3.14.1633
wiedehopf Jul 13, 2024
e04f85c
Dockerfile: x86_64: compile with -march=nehalem
wiedehopf Jul 13, 2024
6ff799e
traces: don't save more ground positions than intended
wiedehopf Jul 17, 2024
62768aa
add geomag copyright notice
wiedehopf Jul 19, 2024
e62917e
don't use the rpi zero reduction of cpu usage via preamble on non-arm…
wiedehopf Jul 26, 2024
a3f82ff
incrementing version: 3.14.1634
wiedehopf Jul 26, 2024
b6715be
supress most errors for repeated connection failures
wiedehopf Aug 7, 2024
f2a37b0
net: better debug print
wiedehopf Aug 7, 2024
6271882
incrementing version: 3.14.1635
wiedehopf Aug 7, 2024
d0b4e71
net-connector: improve error suppression
wiedehopf Aug 7, 2024
a3a174c
json output: fix when input is sbs input
wiedehopf Aug 13, 2024
d2f12d9
incrementing version: 3.14.1636
wiedehopf Aug 13, 2024
3da4c74
add --devel=legacy_history
wiedehopf Aug 14, 2024
cae21dc
remove legacy history json files from readme
wiedehopf Aug 14, 2024
e174999
update packages
wiedehopf Aug 18, 2024
c4ba31b
docker: use separate repo for builder
wiedehopf Aug 18, 2024
24568a6
incrementing version: 3.14.1637
wiedehopf Aug 18, 2024
7a651de
docker: re-add tagged builds and build for sid
wiedehopf Aug 18, 2024
31aa09e
docker: remove cache
wiedehopf Aug 18, 2024
e7d8c49
dockerfile yml
wiedehopf Aug 18, 2024
bede96f
readsb api: support accept-encoding: zstd
wiedehopf Aug 20, 2024
bcf81a6
capitalize response headers
wiedehopf Aug 20, 2024
4065eb4
fix: Ubuntu 24.04 package name change
shawaj Aug 21, 2024
66a04fe
make sure SBS positions out of receiver range are not used
wiedehopf Aug 22, 2024
5da03b5
incrementing version: 3.14.1638
wiedehopf Aug 22, 2024
e8352b6
deb building apparently needs fakeroot
wiedehopf Aug 22, 2024
18ee0ef
fixup required packages
wiedehopf Aug 22, 2024
61b77e1
don't call getaddrinfo quite as often
wiedehopf Aug 24, 2024
6f9b0b8
add jaero exception to sbs range limit
wiedehopf Aug 25, 2024
123fbf1
incrementing version: 3.14.1639
wiedehopf Aug 25, 2024
d6932bb
make log_ppm work with argument 0 as expected
wiedehopf Sep 2, 2024
6035235
copy full DB details to aircraft struct
wiedehopf Sep 15, 2024
78f140c
couple of fixes to make ModeS beast work properly
wiedehopf Sep 16, 2024
4b18685
incrementing version: 3.14.1640
wiedehopf Sep 16, 2024
2ab35ba
cleanup df18 exception handling
wiedehopf Sep 17, 2024
85badfb
streamline zlib gzbuffer things
wiedehopf Sep 17, 2024
85cab05
prepare aircraft db change / cleanup
wiedehopf Sep 17, 2024
ae09ee1
readwholeGz minor cleanup
wiedehopf Sep 17, 2024
7086b20
change aircraft db to use less memory
wiedehopf Sep 17, 2024
85b9187
incrementing version: 3.14.1641
wiedehopf Sep 17, 2024
6ee23d7
fixup uptime in stats
wiedehopf Sep 28, 2024
9ef77b3
fixup api thread count comment
wiedehopf Oct 10, 2024
87d62d3
readsb service: add CAP_SYS_NICE
wiedehopf Oct 10, 2024
431f5d8
net io: make some code nicer to read
wiedehopf Oct 13, 2024
e7dec69
speed_check: decrement speedUnreliable speed is unknown
wiedehopf Oct 17, 2024
0c87e59
incrementing version: 3.14.1642
wiedehopf Oct 17, 2024
4f8a0b4
make --devel=enableClientsJson work
wiedehopf Oct 29, 2024
207ec62
incrementing version: 3.14.1643
wiedehopf Nov 1, 2024
6e2434f
make it simple to save traces without enabling globe-index
wiedehopf Nov 1, 2024
a0ad60b
incrementing version: 3.14.1644
wiedehopf Nov 1, 2024
f6c06e5
first attempt at quick autogain
wiedehopf Nov 2, 2024
e1b2cec
default to --gain=auto
wiedehopf Nov 2, 2024
739f6af
tweak autogain
wiedehopf Nov 2, 2024
f40bd61
allow rtl tuner agc for autogain
wiedehopf Nov 2, 2024
e4faf7f
incrementing version: 3.14.1645
wiedehopf Nov 2, 2024
1e27688
autogain: silent by default
wiedehopf Nov 2, 2024
2c51b73
make quiet autogain the default
wiedehopf Nov 2, 2024
31378c2
just log 59 dB instead of tuner AGC
wiedehopf Nov 2, 2024
80fc546
autogain: change default noise thresholds
wiedehopf Nov 3, 2024
8fd5acf
autogain: print autogain settings
wiedehopf Nov 3, 2024
89fc774
autogain defaults tweak
wiedehopf Nov 3, 2024
b4bd2f5
autogain: reduce default loudThreshold
wiedehopf Nov 3, 2024
7be4ddf
autogain: faster startup, faster reaction to very loud signals
wiedehopf Nov 3, 2024
15823dd
autogain: replace startingGain with lowestGain parameter
wiedehopf Nov 3, 2024
c67e671
remove adsbexchange hardcoding
wiedehopf Nov 4, 2024
7c34ff3
fixup autogain min gain setting
wiedehopf Nov 5, 2024
e8de536
add range outline reset via setGain file
wiedehopf Nov 15, 2024
079fda3
fixup --gain -10
wiedehopf Nov 18, 2024
c3214b3
longer dwell time for aircraft when writing traces without globe index
wiedehopf Nov 19, 2024
2b63384
update --net-only help text
wiedehopf Dec 10, 2024
fb84497
non rtl-sdr: use default gain when gain=auto passed
wiedehopf Nov 20, 2024
9cf1af0
readProxy setting
wiedehopf Nov 26, 2024
038b485
support non-icao addresses in SBS input/output
wiedehopf Dec 31, 2024
ae987a9
add comment with SBS sample message
wiedehopf Dec 31, 2024
7211f3f
improve receiver count logic
wiedehopf Jan 4, 2025
2f7a72e
add print to make sure we don't do too many iterations
wiedehopf Jan 4, 2025
48ef3c0
github action: fix readsb version to include git commit
wiedehopf Jan 4, 2025
3efa2b1
traces: make sure the air ground transition is well recorded
wiedehopf Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ name: docker build

on:
schedule:
- cron: "0 10 * * *"
- cron: "0 5 * * 1"
push:
branches:
- "**"
- "dev"
- "sid"
tags:
- "v*.*.*"
- "v*.*.*"
pull_request:
branches:
- "dev"
- "dev"

jobs:
docker:
Expand All @@ -21,8 +22,8 @@ jobs:
- name: Set variables useful for later
id: useful_vars
run: |-
echo "::set-output name=timestamp::$(date +%s)"
echo "::set-output name=short_sha::${GITHUB_SHA::8}"
echo "name=timestamp::$(date +%s)" >> $GITHUB_OUTPUT
echo "name=short_sha::${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
Expand Down Expand Up @@ -52,13 +53,6 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push
uses: docker/build-push-action@v4
with:
Expand All @@ -67,5 +61,5 @@ jobs:
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
build-args: |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
45 changes: 18 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
FROM debian:bookworm-20240311 AS builder
RUN apt-get update && \
apt-get install -y git wget pkg-config autoconf gcc make libusb-1.0-0-dev librtlsdr-dev librtlsdr0 libncurses-dev zlib1g-dev zlib1g libzstd-dev libzstd1
FROM ghcr.io/wiedehopf/readsb-builder:latest AS builder

# install jemalloc
RUN JEMALLOC_BDIR=$(mktemp -d) && \
git clone --depth 1 https://github.com/jemalloc/jemalloc $JEMALLOC_BDIR && \
cd $JEMALLOC_BDIR && \
./autogen.sh && \
./configure --with-lg-page=14 && \
make -j$(nproc) && \
make install && \
rm -rf $JEMALLOC_BDIR

# install readsb
RUN mkdir -p /app/git
COPY . /app/git
RUN cd /app/git && \
SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"]
RUN --mount=type=bind,source=.,target=/app/git \
cd /app/git && \
READSB_BUILD_DIR=$(mktemp -d) && \
cp -r /app/git/* $READSB_BUILD_DIR && \
cp -aT /app/git $READSB_BUILD_DIR && \
cd $READSB_BUILD_DIR && \
make -j$(nproc) RTLSDR=yes OPTIMIZE="-O2" && \
[[ $(uname -m) == x86_64 ]] && MARCH=" -march=nehalem" || MARCH="" && \
make -j$(nproc) RTLSDR=yes OPTIMIZE="-O2 $MARCH" && \
mv readsb /usr/local/bin && \
mv viewadsb /usr/local/bin && \
chmod +x /usr/local/bin/viewadsb /usr/local/bin/readsb && \
make clean && \
make -j$(nproc) PRINT_UUIDS=yes TRACKS_UUID=yes OPTIMIZE="-O2" && \
make -j$(nproc) PRINT_UUIDS=yes TRACKS_UUID=yes OPTIMIZE="-O2 $MARCH" && \
mv readsb /usr/local/bin/readsb-uuid && \
mv viewadsb /usr/local/bin/viewadsb-uuid && \
chmod +x /usr/local/bin/viewadsb-uuid && \
Expand All @@ -35,18 +23,21 @@ RUN cd /app/git && \
true

FROM debian:bookworm-slim
RUN apt-get update && \
RUN \
--mount=type=bind,from=builder,source=/,target=/builder/ \
apt-get update && \
apt-get -y install --no-install-recommends \
wget \
librtlsdr0 libncurses6 zlib1g libzstd1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
mkdir -p /run/readsb
mkdir -p /run/readsb && \
cp /builder/usr/local/bin/readsb* /usr/local/bin/ && \
cp /builder/usr/local/bin/viewadsb* /usr/local/bin/ && \
mkdir -p /usr/local/share/tar1090 && \
cp /builder/usr/local/share/tar1090/aircraft.csv.gz /usr/local/share/tar1090/aircraft.csv.gz && \
cp /builder/usr/local/lib/libjemalloc.so.2 /usr/local/lib/libjemalloc.so.2 && \
true

ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so.2
COPY --from=builder /usr/local/bin/readsb* /usr/local/bin/
COPY --from=builder /usr/local/bin/viewadsb* /usr/local/bin/
COPY --from=builder /usr/local/share/tar1090/aircraft.csv.gz /usr/local/share/tar1090/aircraft.csv.gz
COPY --from=builder /usr/local/lib/libjemalloc.so.2 /usr/local/lib/libjemalloc.so.2

ENTRYPOINT ["/usr/local/bin/readsb"]
13 changes: 0 additions & 13 deletions README-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ The keys are:

* version: the version of readsb in use
* refresh: how often aircraft.json is updated (for the file version), in milliseconds. the webmap uses this to control its refresh interval.
* history: the current number of valid history files (see below)
* lat: the latitude of the receiver in decimal degrees. Optional, may not be present.
* lon: the longitude of the receiver in decimal degrees. Optional, may not be present.

Expand Down Expand Up @@ -202,18 +201,6 @@ The keys are:
```
* Status code 200 during normal operation

## history_0.json, history_1.json, ..., history_119.json

These files are historical copies of aircraft.json at (by default) 30 second intervals. They follow exactly the
same format as aircraft.json. To know how many are valid, see receiver.json ("history" value). They are written in
a cycle, with history_0 being overwritten after history_119 is generated, so history_0.json is not necessarily the
oldest history entry. To load history, you should:

* read "history" from receiver.json.
* load that many history_N.json files
* sort the resulting files by their "now" values
* process the files in order

## trace jsons

* overall structure
Expand Down
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Or build the package yourself:
sudo apt update
sudo apt install --no-install-recommends --no-install-suggests -y \
git build-essential debhelper libusb-1.0-0-dev \
librtlsdr-dev librtlsdr0 pkg-config \
librtlsdr-dev librtlsdr0 pkg-config fakeroot \
libncurses-dev zlib1g-dev zlib1g libzstd-dev libzstd1
git clone --depth 20 https://github.com/wiedehopf/readsb.git
cd readsb
Expand Down Expand Up @@ -56,6 +56,14 @@ Selectively forwards beast messages if the received data hasn't been forwarded i
Data not related to the physical aircraft state are only forwarded every 500 ms (4 * `--net-beast-reduce-interval`).The messages of
this output are normal beast messages and compatible with every program able to receive beast messages.

This is used by some aggregators to aggregate ADS-B data, an example net connector would be:
```
--net-connector=feed.airplanes.live,30004,beast_reduce_plus_out,uuid=0033062d-e17e-4389-91a9-79ebb967fb4c
```
The uuid is optional, if none is given, the uuid from --uuid-file is used, if that isn't present no uuid is sent.
The beast_reduce_out net-connector will never send an uuid.
The aggregator enables --net-receiver-id and --net-ingest on their readsb server, it's made to work with beast_reduce_plus_out.

### Debian package

- Build package with no additional receiver library dependencies: `dpkg-buildpackage -b`.
Expand Down Expand Up @@ -91,6 +99,23 @@ The difference of using -Ofast or -O3 over the default of -O2 is likely very min

If required, edit `/etc/default/readsb` to set the service options, device type, network ports etc.

## Autogain

For rtl-sdr devices a software gain algorithm is the default, it's optimized for ADS-B.
On the command line it's activated using `--gain=auto` an is silent by default.
`--gain=auto-verbose` can be used to enable log messages for gain changes.
To tweak the internals, more parameters can be passed:
```
--gain=auto-verbose,<lowestGain>,<noiseLowThreshold>,<noiseHighThreshold>,<loudThreshold>
```
The defaults are:
```
--gain=auto-verbose,0,25,31,243
```
The thresholds are numbers 0 to 256, tweaking them requires some understanding of how it works.
One option would be to change the noise thresholds up or down and then observe the log.
There should be no need to tweak these parameters.

## rtl-sdr bias tee

Use this utility independent of readsb:
Expand All @@ -104,9 +129,9 @@ For that purpose it's used in conjunction with tar1090 with some extra options t
Websites using this software:

- https://adsb.lol/
- https://globe.adsbexchange.com/
- https://globe.airplanes.live/
- https://globe.adsb.fi/
- https://globe.adsbexchange.com/

Projects that use or have used data generated by this software:

Expand Down
Loading