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

Geometric altitude #13

Merged
merged 3 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
Update piaware container
Adding a dockerfile and a new services run script.  This adds a single command line argument to Dump1090, the "--gnss" argument which outputs geometric altitude vs. barometric altitude.
  • Loading branch information
mchadwick-iqt committed Mar 22, 2021
commit 269fd5f6fbe7def9b6a7e1f18b38dfd42f0aefaa
9 changes: 9 additions & 0 deletions piaware/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM mikenye/piaware:latest

ADD run /etc/services.d/dump1090/

EXPOSE 80/tcp 30003/tcp 30005/tcp 30105/tcp 30978/tcp 30979/tcp

ENTRYPOINT [ "/init" ]

HEALTHCHECK --start-period=7200s --interval=600s CMD /scripts/healthcheck.sh
51 changes: 51 additions & 0 deletions piaware/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
set -eo pipefail

mkdir -p /run/dump1090-fa

DUMP1090_BIN="/usr/local/bin/dump1090"

# Global settings
DUMP1090_CMD=("--quiet")
DUMP1090_CMD+=("--lat" "$LAT")
DUMP1090_CMD+=("--lon" "$LONG")
DUMP1090_CMD+=("--net")
DUMP1090_CMD+=("--fix")
DUMP1090_CMD+=("--gnss")
DUMP1090_CMD+=("--json-location-accuracy" "2")
DUMP1090_CMD+=("--write-json" "/run/dump1090-fa")
DUMP1090_CMD+=("--net-bind-address" "0.0.0.0")

# Handle "--modeac"
if [[ "$ALLOW_MODEAC" == "yes" ]]; then
DUMP1090_CMD+=("--modeac")
fi

# If a BEASTHOST is specified
if [[ -n "$BEASTHOST" ]]; then
DUMP1090_CMD+=("--net-only")

# Default - rtlsdr mode
else
DUMP1090_CMD+=("--device-type" "rtlsdr")

if [[ -n "$DUMP1090_DEVICE" ]]; then
DUMP1090_CMD+=("--device" "$DUMP1090_DEVICE")
fi

if [[ -n "$RTLSDR_PPM" ]]; then
DUMP1090_CMD+=("--ppm" "$RTLSDR_PPM")
fi

if [[ -n "$RTLSDR_GAIN" ]]; then
DUMP1090_CMD+=("--gain" "$RTLSDR_GAIN")
fi

fi

# shellcheck disable=SC2016
"${DUMP1090_BIN}" "${DUMP1090_CMD[@]}" \
2>&1 | stdbuf -o0 awk '{print "[dump1090] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'

sleep 5