Skip to content

Commit

Permalink
Revert "use readsb's built-in autogain if READSB_GAIN param is om…
Browse files Browse the repository at this point in the history
…itted (#162)"

This reverts commit eab238a.

This PR is BROKEN
it has a bunch of code in there that doesn't belong
  • Loading branch information
wiedehopf committed Nov 28, 2024
1 parent 4983ba6 commit e32e9ee
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 77 deletions.
30 changes: 10 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
- [Mandatory Parameters](#mandatory-parameters)
- [Optional Parameters](#optional-parameters)
- [Getting ADSB data to the Ultrafeeder](#getting-adsb-data-to-the-ultrafeeder)
- [Connecting to an SDR or other hardware device](#connecting-to-an-sdr-or-other-hardware-device)
- [Connecting to an SDR or other hardware device](#connecting-to-a-sdr-or-other-hardware-device)
- [Mandatory parameters](#mandatory-parameters-1)
- [Optional/Additional Parameters](#optionaladditional-parameters)
- [Ultrafeeder AutoGain for RTLSDR Devices](#ultrafeeder-autogain-for-rtlsdr-devices)
- [Using `readsb`'s built-in AutoGain (recommended)](#using-readsbs-built-in-autogain-recommended)
- [Using the original AutoGain algorithm](#using-the-original-autogain-algorithm)
- [AutoGain for RTLSDR Devices](#autogain-for-rtlsdr-devices)
- [Connecting to external ADSB data sources](#connecting-to-external-adsb-data-sources)
- [All-in-One Configuration using `ULTRAFEEDER_CONFIG`](#all-in-one-configuration-using-ultrafeeder_config)
- [Networking parameters](#networking-parameters)
Expand Down Expand Up @@ -52,7 +50,6 @@
- [Output from Ultrafeeder to InfluxDBv2](#output-from-ultrafeeder-to-influxdbv2)
- [Message decoding introspection](#message-decoding-introspection)
- [Minimalist setup](#minimalist-setup)
- [Offline maps](#offline-maps)
- [Logging](#logging)
- [Getting help](#getting-help)
- [License and Trademarks](#license-and-trademarks)
Expand Down Expand Up @@ -243,20 +240,12 @@ If you want to connect your SDR to the container, here's how to do that:

| Variable | Description | Controls which `readsb` option | Default |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | -------- |
| `READSB_GAIN` | Set gain (in dB). Use `autogain` to have the container determine an appropriate gain, more on this below. Leave this parameter empty (recommended) to use [`readsb`'s built-in auto-gain](#using-readsbs-built-in-autogain-recommended), or set it to `omit` or `off` to not pass this parameter to `readsb` | `--gain=<db>` | Max gain |
| `READSB_GAIN` | Set gain (in dB). Use `autogain` to have the container determine an appropriate gain, more on this below. | `--gain=<db>` | Max gain |
| `READSB_RTLSDR_PPM` | Set oscillator frequency correction in PPM. See [Estimating PPM](https://github.com/sdr-enthusiasts/docker-readsb-protobuf/#estimating-ppm) | `--ppm=<correction>` | Unset |

##### Ultrafeeder AutoGain for RTLSDR Devices
##### AutoGain for RTLSDR Devices

###### Using `readsb`'s built-in AutoGain (recommended)

As of November 2024, we are recommending to leave the `READSB_GAIN` parameter empty by not including it in your configuration. This will engage the new built-in [autogain of `readsb`](https://github.com/wiedehopf/readsb?tab=readme-ov-file#autogain). This new algorithm uses continuous noise and signal strength measurements and is highly effective in environments with a mix of strong, local signals and distant, weak signals.

(Experts only:) If you want to pass in any autogain parameters to `readsb`, you can do so by setting `READSB_GAIN` to (for example) `READSB_GAIN=auto-verbose,0,25,31,243`. See the explanation at Wiedehopf's [`readsb` repository](https://github.com/wiedehopf/readsb?tab=readme-ov-file#autogain) for more information about these parameters

###### Using the original AutoGain algorithm

You can still use the original autogain algorithm by setting `READSB_GAIN=autogain`. That algorithm is built into the container and it will take signal strength measurements to determine the optimal gain. The AutoGain functionality is based on a (slightly) modified version of [Wiedehopf's AutoGain](https://github.com/wiedehopf/autogain). AutoGain will only work with `rtlsdr` style receivers.
If you have set `READSB_GAIN=autogain`, then the system will take signal strength measurements to determine the optimal gain. The AutoGain functionality is based on a (slightly) modified version of [Wiedehopf's AutoGain](https://github.com/wiedehopf/autogain). AutoGain will only work with `rtlsdr` style receivers.

Note that AutoGain is not related to the SDR's AGC setting (controlled with the `READSB_RTLSDR_ENABLE_AGC` variable). We do not recommend enabling AGC for Ultrafeeder or any other ADS-B decoder.

Expand Down Expand Up @@ -370,7 +359,7 @@ bash <(wget -qO - https://raw.githubusercontent.com/sdr-enthusiasts/docker-adsb-

Instead of (or in addition to) using `BEASTHOST`, you can also define ADSB data ingests using the `READSB_NET_CONNECTOR` parameter. This is the preferred way if you have multiple sources or destinations for your ADSB data. This variable allows you to configure incoming and outgoing connections. The variable takes a semicolon (`;`) separated list of `host,port,protocol[,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX]`, see the section [All-in-One Configuration using `ULTRAFEEDER_CONFIG`](#all-in-one-configuration-using-ultrafeeder_config) for explanation of these parameters.

Note: if you have a UAT dongle and use `dump978` to decode this, you should use `READSB_NET_CONNECTOR` to ingest UAT data from `dump978`. See example below
NOTE: If you have a UAT dongle and use `dump978` to decode this, you should use `READSB_NET_CONNECTOR` to ingest UAT data from `dump978`. See example below

```yaml
environment:
Expand Down Expand Up @@ -746,7 +735,7 @@ Note - on some systems (DietPi comes to mind), `/sys/class/thermal/` may not be

#### Reducing Disk IO for Graphs1090

Note - *this feature is still somewhat experimental. If you are really attached to your statistics/graphs1090 data, please make sure to back up your mapped drives regularly*
Note - _this feature is still somewhat experimental. If you are really attached to your statistics/graphs1090 data, please make sure to back up your mapped drives regularly_

If you are using a Raspberry Pi or another type of computer with an SD card, you may already be aware that these SD cards have a limited number of write-cycles that will determine their lifespan. In other words - a common reason for SD card failure is excessive writes to it.

Expand Down Expand Up @@ -886,7 +875,7 @@ No paths need to be mapped through to persistent storage. However, if you don't

| Path | Purpose |
| ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `/opt/adsb/ultrafeeder/globe_history:/var/globe_history` | Holds range outline data, heatmap / replay data and traces if enabled. *Note: this data won't be automatically deleted, you will need to delete it eventually if you map this path.* |
| `/opt/adsb/ultrafeeder/globe_history:/var/globe_history` | Holds range outline data, heatmap / replay data and traces if enabled. _Note: this data won't be automatically deleted, you will need to delete it eventually if you map this path._ |
| `/opt/adsb/ultrafeeder/timelapse1090:/var/timelapse1090` | Holds timelapse1090 data if enabled. (We recommend against enabling this feature, see above) |
| `/opt/adsb/ultrafeeder/collectd:/var/lib/collectd` | Holds graphs1090 & performance data |
| `/proc/diskstats:/proc/diskstats:ro` | Makes disk statistics available to `graphs1090` |
Expand Down Expand Up @@ -947,7 +936,7 @@ docker exec -it ultrafeeder /usr/local/bin/viewadsb --cpr-focus 3D3ED0

## Minimalist setup

If you want to use `ultrafeeder` *only* as a SDR decoder but without any mapping or stats/graph websites, without MLAT connections or MLAT-hub, etc., for example to minimize CPU and RAM needs on a low CPU/memory single board computer, then do the following:
If you want to use `ultrafeeder` _only_ as a SDR decoder but without any mapping or stats/graph websites, without MLAT connections or MLAT-hub, etc., for example to minimize CPU and RAM needs on a low CPU/memory single board computer, then do the following:

- in the `ULTRAFEEDER_CONFIG` parameter, remove any entry that starts with `mlat` or `mlathub`. This will prevent any `mlat-client`s or `mlathub` instances to be launched. If you still want to connect the `mlat-client`(s) to external MLAT servers but you don't want to run the overhead of a MLATHUB, you can leave any entries starting with `mlat` in the `ULTRAFEEDER_CONFIG` parameter, and set `MLATHUB_DISABLE=true`
- Set the parameter `TAR1090_DISABLE=true`. This will prevent the `nginx` webserver and any websites to be launched and no `collectd` (graphs1090) or `rrd` (ADSB message history) data to be collected or retained.
Expand All @@ -965,6 +954,7 @@ There is the option to use some basic offline maps limited in zoom:
- /usr/local/share/osm_tiles_offline:/usr/local/share/osm_tiles_offline
```


## Logging

All logs are to the container's stdout and can be viewed with `docker logs -t [-f] container`.
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ services:
- READSB_LAT=${FEEDER_LAT}
- READSB_LON=${FEEDER_LONG}
- READSB_ALT=${FEEDER_ALT_M}m
- READSB_GAIN=${ADSB_SDR_GAIN}
- READSB_RX_LOCATION_ACCURACY=2
- READSB_STATS_RANGE=true
#
Expand Down
Empty file.
2 changes: 0 additions & 2 deletions rootfs/etc/s6-overlay/s6-rc.d/cleanup_globe_history/run

This file was deleted.

1 change: 0 additions & 1 deletion rootfs/etc/s6-overlay/s6-rc.d/cleanup_globe_history/type

This file was deleted.

Empty file.
40 changes: 0 additions & 40 deletions rootfs/etc/s6-overlay/scripts/cleanup_globe_history

This file was deleted.

2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/scripts/mlat-client
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if grep -qs "gpsd" <<< "$ULTRAFEEDER_CONFIG" || grep -qs "gpsd" <<< "$ULTRAFEEDE
GPSD=1
LOCATION_PERSIST=/var/globe_history/gpsd_last_location
if [[ -f "$LOCATION_PERSIST" ]]; then
read -r new_lat new_lon new_alt < "$LOCATION_PERSIST"
read new_lat new_lon new_alt < "$LOCATION_PERSIST"
fi
# initialize "old" location for gpsd movement detection
# use zero island as starting point if location persist does not exit
Expand Down
6 changes: 1 addition & 5 deletions rootfs/etc/s6-overlay/scripts/readsb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ fi

LOCATION_PERSIST=/var/globe_history/gpsd_last_location
if [[ -f "$LOCATION_PERSIST" ]] && { grep -qs "gpsd" <<< "$ULTRAFEEDER_CONFIG" || grep -qs "gpsd" <<< "$ULTRAFEEDER_NET_CONNECTOR"; }; then
# shellcheck disable=SC2034
read -r LAT LONG ALT < "$LOCATION_PERSIST"
read LAT LON ALT < "$LOCATION_PERSIST"
READSB_LAT=""
READSB_LON=""
# shellcheck disable=SC2034
READSB_ALT=""
fi

Expand Down Expand Up @@ -307,8 +305,6 @@ if [[ -n "$READSB_GAIN" ]]; then
[[ "${READSB_GAIN,,}" == "autogain" ]] && gain="${READSB_AUTOGAIN_INITIAL_GAIN:-49.6}" || gain="${READSB_GAIN}"
fi
READSB_CMD+=("--gain=$gain")
elif [[ "${READSB_GAIN,,}" != "omit" ]] && [[ "${READSB_GAIN,,}" != "off" ]]; then
READSB_CMD+=("--gain=auto")
fi

##### RTL-SDR OPTIONS #####
Expand Down
8 changes: 0 additions & 8 deletions rootfs/scripts/interpret_ultrafeeder_config
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,6 @@ do
done
# Now add $readsb_str to the READSB_CONF_ARR() as --net-connector argument:
READSB_CONF_ARR+=("--net-connector=${readsb_str}")

if [[ ${param[1],,} == "in.adsb.lol" ]]; then
myadsblol="$(curl -sLD - https://my.adsb.lol -o /dev/null -w '%{url_effective}' 2>&1 | sed '/location: /h;g;$!d;s/^.* \(.*\)$/\1/')"
if [[ -n "$myadsblol" ]] && [[ ! $myadsblol =~ sorry-but-i-could-not-find-your-receiver ]]; then
"${s6wrap[@]}" echo "ADSB.LOL station map available at $myadsblol"
fi
fi

;;

mlat)
Expand Down

0 comments on commit e32e9ee

Please sign in to comment.