Skip to content

Commit

Permalink
add support for READSB_ENABLE_HEATMAP
Browse files Browse the repository at this point in the history
  • Loading branch information
kx1t committed Oct 26, 2023
1 parent 3c50dd4 commit 8eb83d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ Note - due to design limitations of `readsb`, the `tar1090` graphical interface
| `HEYWHATSTHAT_ALTS` | Comma separated altitudes for multiple outlines. Use no units or `ft` for feet, `m` for meters, or `km` for kilometers. Only integer numbers are accepted, no decimals please | `12192m` (=40000 ft) |
| `HTTP_ACCESS_LOG` | Optional. Set to `true` to display HTTP server access logs. | `false` |
| `HTTP_ERROR_LOG` | Optional. Set to `false` to hide HTTP server error logs. | `true` |
| `TAR1090_IMAGE_CONFIG_LINK` | An optional URL shown at the top of page, designed to be used for a link back to a configuration page. The token `HOSTNAME` in the link is replaced with the current host that tar1090 is accessed on. | `null` |
| `TAR1090_IMAGE_CONFIG_TEXT` | Text to display for the config link | `null` |
| `TAR1090_DISABLE` | Set to `true` to disable the web server and all websites (including the map, `graphs1090`, `heatmap`, `pTracks`, etc.) | Unset |
| `READSB_ENABLE_HEATMAP` | Set to `true` or leave unset to enable the HeatMap function available at `http://myip/?Heatmap`; set to `false` to disable the HeapMap function | `true` (enabled) |

- For documentation on the aircraft.json format see this page: <https://github.com/wiedehopf/readsb/blob/dev/README-json.md>
- TAR1090_ENABLE_AC_DB causes readsb to load the tar1090 database as a csv file from this repository: <https://github.com/wiedehopf/tar1090-db/tree/csv>
Expand Down
22 changes: 11 additions & 11 deletions rootfs/etc/s6-overlay/scripts/readsb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ if [ -n "${UUID}" ]; then
fi

READSB_CMD+=("--write-json=/run/readsb")
READSB_CMD+=("--heatmap-dir=/var/globe_history")
READSB_CMD+=("--heatmap=15")
READSB_CMD+=("--write-state=/var/globe_history")
READSB_CMD+=("--json-trace-interval=15")
READSB_CMD+=("--json-reliable=1")
Expand All @@ -60,17 +58,22 @@ READSB_CMD+=("--net-json-port=30047")
READSB_CMD+=(--net-api-port=30152)
READSB_CMD+=(--net-sbs-in-port=32006)

if chk_enabled "${READSB_ENABLE_HEATMAP:-true}"; then
READSB_CMD+=("--heatmap-dir=/var/globe_history")
READSB_CMD+=("--heatmap=${READSB_HEATMAP_INTERVAL:-15}")
fi

if ! chk_enabled "$READSB_NET_SBS_DISABLE_REDUCE"; then
READSB_CMD+=("--net-sbs-reduce")
fi

if chk_enabled "${READSB_FORWARD_MLAT}"; then
"${s6wrap[@]}" --quiet --args echo "WARNING -- READSB_FORWARD_MLAT has been set! Do not feed the output of this container to any aggregators!"
"${s6wrap[@]}" --args echo "WARNING -- READSB_FORWARD_MLAT has been set! Do not feed the output of this container to any aggregators!"
READSB_CMD+=("--forward-mlat")
fi

if chk_enabled "${READSB_FORWARD_MLAT_SBS}"; then
"${s6wrap[@]}" --quiet --args echo "WARNING -- READSB_FORWARD_MLAT_SBS has been set! Do not feed the SBS (BaseStation) output of this container to any aggregators!"
"${s6wrap[@]}" --args echo "WARNING -- READSB_FORWARD_MLAT_SBS has been set! Do not feed the SBS (BaseStation) output of this container to any aggregators!"
READSB_CMD+=("--forward-mlat-sbs")
fi

Expand Down Expand Up @@ -148,10 +151,6 @@ if [[ -n "$READSB_JSON_TRACE_INTERVAL" ]]; then
READSB_CMD+=("--json-trace-interval=$READSB_JSON_TRACE_INTERVAL")
fi

if [[ -n "$READSB_HEATMAP_INTERVAL" ]]; then
READSB_CMD+=("--heatmap=$READSB_HEATMAP_INTERVAL")
fi

if [[ -n "$READSB_NET_BEAST_REDUCE_FILTER_ALT" ]]; then
READSB_CMD+=("--net-beast-reduce-filter-alt=$READSB_NET_BEAST_REDUCE_FILTER_ALT")
fi
Expand Down Expand Up @@ -320,11 +319,12 @@ if chk_enabled "$PROMETHEUS_ENABLE"; then
READSB_CMD+=("--write-prom=/run/readsb-prometheus.prom")
fi

LOGLEVEL="${LOGLEVEL:-verbose}"
# shellcheck disable=SC2086,SC2069
if [[ -z "${LOGLEVEL}" ]] || [[ "${LOGLEVEL,,}" == "verbose" ]]; then
if [[ "${LOGLEVEL,,}" == "verbose" ]]; then
exec "${s6wrap[@]}" --args "${READSB_BIN}" "${READSB_CMD[@]}" $READSB_EXTRA_ARGS
elif [[ "${LOGLEVEL,,}" == "error" ]]; then
exec "${s6wrap[@]}" --quiet --ignore-stdout --args "${READSB_BIN}" "${READSB_CMD[@]}" $READSB_EXTRA_ARGS
exec "${s6wrap[@]}" --ignore-stdout --args "${READSB_BIN}" "${READSB_CMD[@]}" $READSB_EXTRA_ARGS
elif [[ "${LOGLEVEL,,}" == "none" ]]; then
exec "${s6wrap[@]}" --quiet --ignore-stdout --ignore-stderr --args "${READSB_BIN}" "${READSB_CMD[@]}" $READSB_EXTRA_ARGS
exec "${s6wrap[@]}" --ignore-stdout --ignore-stderr --args "${READSB_BIN}" "${READSB_CMD[@]}" $READSB_EXTRA_ARGS
fi

0 comments on commit 8eb83d8

Please sign in to comment.