diff --git a/README.md b/README.md index 40883a8..febb041 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,18 @@ The sections below describe how to configure each part of the container function ### General Configuration +You need to make sure that the USB device can be accessed by the container. The best way to do so, is by adding the following to you `docker-compose.yml` file:: + +```yaml + device_cgroup_rules: + - 'c 189:* rwm' +... + volumes: + - /dev:/dev:ro +``` + +The advantage of doing this (over simply adding a `device:` directive pointing at the USB port) is that the construction above will automatically recover if you "hot plug" your dongle. + #### Basic Ultrafeeder Parameters ##### Mandatory Parameters @@ -241,11 +253,13 @@ There are many optional parameters relating to the ingestion of data and the gen | `READSB_NET_RAW_OUTPUT_PORT` | TCP raw output listen ports. | `--net-ro-port=` | `30002` | | `READSB_NET_SBS_INPUT_PORT` | TCP BaseStation input listen ports. | `--net-sbs-in-port=` | Unset | | `READSB_NET_SBS_OUTPUT_PORT` | TCP BaseStation output listen ports. | `--net-sbs-port=` | `30003` | +| `READSB_NET_SBS_DISABLE_REDUCE` | Disable application of "reduce" logic to SBS/BaseStation output. (By default, this is enabled) | `--net-sbs-reduce` | Unset | | `REASSB_NET_VERBATIM` | Set this to any value to forward messages unchanged. | `--net-verbatim` | Unset | | `READSB_NET_VRS_PORT` | TCP VRS JSON output listen ports. | `--net-vrs-port=` | Unset | | `READSB_WRITE_STATE_ONLY_ON_EXIT` | if set to anything, it will only write the status range outlines, etc. upon termination of `readsb` | `--write-state-only-on-exit` | Unset | | `READSB_JSON_INTERVAL` | Update interval for the webinterface in seconds / interval between aircraft.json writes | `--write-json-every=` | `1.0` | | `READSB_JSON_TRACE_INTERVAL` | Per plane interval for json position output and trace interval for globe history | `--json-trace-interval=` | `15` | +| `READSB_FORWARD_MLAT_SBS` | If set to anthing, it will include MLAT results in the SBS/BaseStation output. This may be desirable if you feed SBS data to applications like [VRS](https://github.com/sdr-enthusiasts/docker-virtualradarserver) or [PlaneFence](https://github.com/kx1t/docker-planefence) | Unset | ### Web Gui (`tar1090`) Configuration @@ -485,8 +499,8 @@ Generally, there is little to configure, but there are a few parameters that you | `MLATHUB_SBS_OUT_PORT` | TCP port where the consolidated MLAT results will be available in SBS (BaseStation) format | `31003` | | `MLATHUB_BEAST_IN_PORT` | TCP port you where you can send additional MLAT results to, in Beast format | `31004` | | `MLATHUB_BEAST_OUT_PORT` | TCP port where consolidated MLAT results will be available in Beast format | `31005` | -| `MLATHUB_NET_CONNECTOR` | List of semi-colon separated IP or host, port, and protocols where MLATHUB will connect to ingest or send MLAT data. It follows the same syntax as described in the [`READSB_NET_CONNECTOR` syntax section](#alternate-configuration-method-with-readsb_net_connector) above. | Unset | -| `MLATHUB_ENABLE_ADSB_INGEST` | If set to any non-empty value, the MLATHUB will ingest the ADSB data from the readsb component and make it available on its output port. This is useful if you want to connect to external applications that want both ADSB and MLAT result data (for example, Planefence). Note -- do not use this option to feed external aggregators as they generally do not want to receive processed MLAT data. | Unset | +| `MLATHUB_BEAST_REDUCE_OUT_PORT` | TCP port where consolidated MLAT results will be available in Beast format with reduced data rates | `31006` | +| `MLATHUB_NET_CONNECTOR` | List of semi-colon (`;`) separated IP or host, port, and protocols where MLATHUB will connect to ingest or send MLAT data. It follows the same syntax as described in the [`READSB_NET_CONNECTOR` syntax section](#alternate-configuration-method-with-readsb_net_connector) above. | Unset | ## Metrics diff --git a/docker-compose.yml b/docker-compose.yml index 91641db..eeb1d72 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,6 @@ -version: '3.8' - services: ultrafeeder: - image: ghcr.io/sdr-enthusiasts/docker-adsb-ultrafeeder:latest + image: ghcr.io/sdr-enthusiasts/docker-adsb-ultrafeeder tty: true container_name: ultrafeeder hostname: ultrafeeder @@ -10,10 +8,13 @@ services: device_cgroup_rules: - 'c 189:* rwm' ports: - - 80:80 - - 30003:30003 - - 30005:30005 + - 8080:80 # to expose the web interface + - 9273-9274:9273-9274 # to expose the statistics interface to Prometheus environment: + # -------------------------------------------------- + # general parameters: + - LOGLEVEL=error + - TZ=${FEEDER_TZ} # -------------------------------------------------- # SDR related parameters: - READSB_DEVICE_TYPE=rtlsdr @@ -25,22 +26,21 @@ services: - READSB_LAT=${FEEDER_LAT} - READSB_LON=${FEEDER_LONG} - READSB_ALT=${FEEDER_ALT_M}m - - READSB_GAIN=autogain + - READSB_GAIN=${ADSB_SDR_GAIN} - READSB_MODEAC=true - READSB_RX_LOCATION_ACCURACY=2 - READSB_STATS_RANGE=true - - TZ=${FEEDER_TZ} # # -------------------------------------------------- # Sources and Aggregator connections: # (Note - remove the ones you are not using / feeding) - READSB_NET_CONNECTOR= - dump978,37981,raw_in; feed.adsb.fi,30004,beast_reduce_plus_out; in.adsb.lol,30004,beast_reduce_plus_out; feed.adsb.one,64004,beast_reduce_plus_out; feed.planespotters.net,30004,beast_reduce_plus_out; feed.theairtraffic.com,30004,beast_reduce_plus_out + # If you really want to feed ADSBExchange, you can do so by adding this above: feed1.adsbexchange.com,30004,beast_reduce_plus_out - UUID=${MULTIFEEDER_UUID} # # -------------------------------------------------- @@ -52,13 +52,14 @@ services: feed.adsb.one,64006,39002; mlat.planespotters.net,31090,39003; feed.theairtraffic.com,31090,39004 + # If you really want to feed ADSBExchange, you can do so by adding this above: feed.adsbexchange.com,31090,39005 - MLAT_USER=${FEEDER_NAME} # MLATHUB automatically gets MLAT results data from the feeders defined in MLAT_CONFIG, # and additionally from the Net Connectors defined with MLATHUB_NET_CONNECTOR - MLATHUB_NET_CONNECTOR= piaware,30105,beast_in; rbfeeder,30105,beast_in; - Radarvirtuel,30105,beast_in + radarvirtuel,30105,beast_in # # -------------------------------------------------- # TAR1090 (Map Web Page) parameters: @@ -72,21 +73,31 @@ services: - TAR1090_FLIGHTAWARELINKS=true - HEYWHATSTHAT_PANORAMA_ID=${FEEDER_HEYWHATSTHAT_ID} - HEYWHATSTHAT_ALTS=${FEEDER_HEYWHATSTHAT_ALTS} + - TAR1090_SITESHOW=true + - TAR1090_RANGE_OUTLINE_COLORED_BY_ALTITUDE=true + - TAR1090_RANGE_OUTLINE_WIDTH=2.0 + - TAR1090_RANGERINGSDISTANCES=50,100,150,200 + - TAR1090_RANGERINGSCOLORS='#1A237E','#0D47A1','#42A5F5','#64B5F6' # # -------------------------------------------------- # GRAPHS1090 (Decoder and System Status Web Page) parameters: # The two 978 related parameters should only be included if you are running dump978 for UAT reception (USA only) - GRAPHS1090_DARKMODE=true - - ENABLE_978=yes - - URL_978=http://dump978/skyaware978 + # - ENABLE_978=yes + # - URL_978=http://dump978/skyaware978 # + # -------------------------------------------------- + # Prometheus and InfluxDB connection parameters: + - INFLUXDBV2_URL=${INFLUX_URL} + - INFLUXDBV2_TOKEN=${INFLUX_TOKEN} + - INFLUXDBV2_BUCKET=${INFLUX_BUCKET} + - PROMETHEUS_ENABLE=true volumes: - /opt/adsb/ultrafeeder/globe_history:/var/globe_history - - /opt/adsb/ultrafeeder/timelapse1090:/var/timelapse1090 - /opt/adsb/ultrafeeder/graphs1090:/var/lib/collectd - /proc/diskstats:/proc/diskstats:ro - /dev:/dev:ro tmpfs: - /run:exec,size=256M - /tmp:size=128M - - /var/log:size=32M + - /var/log:size=32M \ No newline at end of file diff --git a/rootfs/etc/services.d/mlathub/run b/rootfs/etc/services.d/mlathub/run index 5d3f1d1..e1766f0 100644 --- a/rootfs/etc/services.d/mlathub/run +++ b/rootfs/etc/services.d/mlathub/run @@ -32,6 +32,7 @@ MLATHUB_CMD+=("--forward-mlat") MLATHUB_CMD+=("--net-sbs-port=${MLATHUB_SBS_OUT_PORT:-31003}") MLATHUB_CMD+=("--net-bi-port=${MLATHUB_BEAST_IN_PORT:-31004}") MLATHUB_CMD+=("--net-bo-port=${MLATHUB_BEAST_OUT_PORT:-31005}") +MLATHUB_CMD+=("--net-beast-reduce-out-port=${MLATHUB_BEAST_REDUCE_OUT_PORT:-31006}")) # We need to get the mlat results ports from the parameters: # parse MLAT_CONFIG string into mlat_configs array @@ -100,15 +101,15 @@ fi # Handle "--net-heartbeat=" MLATHUB_CMD+=("--net-heartbeat=${READSB_NET_HEARTBEAT:-30}") - -if (( $(ps -o etimes= -p 1) < 30 )) +if ! pgrep readsb >/dev/null 2>&1 then echo "[$(date)][mlathub] Delaying MLAT hub start until container is established..." - while (( $(ps -o etimes= -p 1) < 30 )) + while ! pgrep readsb >/dev/null 2>&1 do - sleep 5 + sleep 2 done fi +sleep 5 # sleep a bit so readsb is well established echo "[$(date)][mlathub] Starting MLATHUB..." diff --git a/rootfs/etc/services.d/readsb/run b/rootfs/etc/services.d/readsb/run index 07398f8..0f39a93 100644 --- a/rootfs/etc/services.d/readsb/run +++ b/rootfs/etc/services.d/readsb/run @@ -39,7 +39,13 @@ if [ -n "${UUID}" ]; then READSB_CMD+=("--uuid-file=/run/uuid") fi -# ingest MLAT results data if MLAT clients have been defined: +# ingest MLAT results data from the MLATHUB if one is defined: +if [[ -n "${MLAT_CONFIG}" ]] || [[ -n "$MLATHUB_NET_CONNECTOR" ]] +then + READSB_CMD+=("--net-connector=localhost,${MLATHUB_BEAST_REDUCE_OUT_PORT:-31006},beast_in") +fi + +if MLAT clients have been defined: # parse MLAT_CONFIG string into mlat_configs array # note - it's OK for MLAT_CONFIG to be empty or unset readarray -td ";" mlat_configs < <(printf '%s' "${MLAT_CONFIG// /}") @@ -74,11 +80,20 @@ READSB_CMD+=("--net-json-port=30047") READSB_CMD+=(--net-api-port=30152) READSB_CMD+=(--net-sbs-in-port=32006) +if [[ -z "$READSB_NET_SBS_DISABLE_REDUCE" ]]; then + READSB_CMD+=("--net-sbs-reduce") +fi + if [[ -n "${READSB_FORWARD_MLAT}" ]]; then - echo "[$(date +"%Y-%m-%d %H:%M:%S")][readsb] WARNING -- READSB_FORWARD_MLAT has been set! Do not feed the output of this container to any aggregretors!" + echo "[$(date +"%Y-%m-%d %H:%M:%S")][readsb] WARNING -- READSB_FORWARD_MLAT has been set! Do not feed the output of this container to any aggregators!" READSB_CMD+=("--forward-mlat") fi +if [[ -n "${READSB_FORWARD_MLAT_SBS}" ]]; then + echo "[$(date +"%Y-%m-%d %H:%M:%S")][readsb] 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 + if [[ -n "$READSB_RX_LOCATION_ACCURACY" ]]; then READSB_CMD+=("--json-location-accuracy=$READSB_RX_LOCATION_ACCURACY") fi