From 3275696a161c7d40f2ffa828fdf871386a095450 Mon Sep 17 00:00:00 2001 From: kx1t Date: Mon, 23 Oct 2023 11:01:55 -0400 Subject: [PATCH] updated README --- README.md | 114 +++++++++++++++++++++++++++++++++++++++++++++++++- build-here.sh | 25 ----------- buildnow.sh | 29 ------------- 3 files changed, 112 insertions(+), 56 deletions(-) delete mode 100644 build-here.sh delete mode 100644 buildnow.sh diff --git a/README.md b/README.md index e9356a4..8045a7d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,112 @@ -# docker-radar1090 -Radar1090 feeder container https://www.1090mhz.uk/ +# sdr-enthusiasts/docker-radar1090 + +Radar1090 UK feeder container +[https://www.1090mhz.uk](https://www.1090mhz.uk/) + +- [sdr-enthusiasts/docker-radar1090](#sdr-enthusiastsdocker-radar1090) + - [Introduction](#introduction) + - [Getting a sharing key](#getting-a-sharing-key) + - [Installing `docker-radar1090`](#installing-docker-radar1090) + - [Prerequisites](#prerequisites) + - [Adding and configuring Radar1090 UK](#adding-and-configuring-radar1090-uk) + - [Watchdog](#watchdog) + - [Supported parameters](#supported-parameters) + - [Logging](#logging) + - [Getting help](#getting-help) + +## Introduction + +[![Discord](https://img.shields.io/discord/734090820684349521)](https://discord.gg/sTf9uYF) + +This container helps feeding your ADS-B data to [Radar1090 UK](https://www.1090mhz.uk/). Radar1090 UK is an aggregator based in the UK. They are mostly interested in getting data feeds from the UK, the Republic of Ireland, and its direct neighboring countries, so if you are located in their operating area, feel free to start feeding them. + +## Getting a sharing key + +The following information was copied from the [Radar1090 UK website](https://www.1090mhz.uk/setup.html). Please go there for the most accurate and latest way to get a sharing key. + +> **Station name** +> We need to give your receiver a "station name". Station names string of 3-9 characters in length which can be a placename, callsign, nickname, etc. +> +> We have receivers called things like: +> +> FERNHILL (place) +> PENBREY (place) +> BIRTIES (nickname) +> In many cases an approximate location works well as it reminds us where the receiver is located but provides a degree of privacy. +> +> **Antenna location** +> We need the Latitude/Longitude of your antenna... +> +> The latitude and longitude of your antenna should be in degrees and decimal degrees to six decimal places, for example 52.212457 -2.187936. You can get your antenna's location using Google Maps. + +Please send the desired station name and latitude/longitude to Mike Tubby via [email](mailto:mike@tubby.org) or [WhatsApp](whatsapp:+441905888020). + +If accepted, you will receive a feeder key that looks like this: `0x7A3DF151D95F3E9A`. + +## Installing `docker-radar1090` + +### Prerequisites + +You need an existing feeder setup supporting the Beast protocol (or AVR, bur we strongly recommend using Beast). This setup can either be containerized or installed directly on your machine. If you don't have this, here are a few resources that can help you get started: + +- [ADSB Gitbook](https://sdr-enthusiasts.gitbook.io/ads-b/) with all the background information you need to set up your containerized station in a way that is easy to understand +- [adsb.im](https://adsb.im) which is a GUI based setup mechanism that creates an SD card image for your SBC that is ready to use for receiving ADSB data with a SDR dongle +- [SDR Enthusiasts' Docker Install Repo](https://github.com/sdr-enthustiasts/docker-install) with a script to easily add and setup Docker on any Debian Linux machine, and example `docker-compose.yml` and `.env` files that you can use as a starting point for your own deployment. + +### Adding and configuring Radar1090 UK + +Once you have your basic feeder installed, you can add the following minimal configuration to your `docker-compose.yml` file to start feeding Radar1090 UK. Additionally supported parameters are listed further down this document. + +```yaml + radar1090: + image: ghcr.io/sdr-enthusiasts/docker-radar1090:latest + tty: true + container_name: radar1090 + hostname: radar1090 + restart: always + environment: + - TZ=${FEEDER_TZ} + - RADAR1090_KEY=${RADAR1090_KEY} # replace ${RADAR1090_KEY} with your sharing key + - VERBOSE=false # set to true to get lots of feeder information in your container logs + - BEASTHOST=ultrafeeder # replace ultrafeeder with the container name of your ADSB receiver or the IP address of your host machine if your feeder is not in the same container stack + tmpfs: + - /run:exec,size=256M + - /tmp:size=128M + - /var/log:size=32M +``` + +Once you have added this to your setup, simply do `docker compose up -d` in the directory where your `docker-compose.yml` file is located, and you will start feeding your ADS-B data to Radar1090 UK! + +## Watchdog + +The container uses an internal Watchdog to ensure that data is still flowing to the Radar1090 Server. Data flow can stop for any reason, and often the container can self-repair to get the data flow starting again. +The watchdog runs by default every 15 minutes, and when it runs, it samples the data stream for 15 seconds. If no data flow was detected going from the container to the Radar1090 Server, it will try to restart the internal feeder module in an attempt to get data flowing again. + +Additionally, it will increase the *failure counter* (or reset this counter if data is flowing again). +Once the *failure counter* is greater or equal to 3, the container's HEALTHCHECK will go *UNHEALTHY*. This will enable external management containers like `autoheal` to automatically restart the entire container. + + +## Supported parameters + +The following parameters are supported for the `docker-radar1090` container. Please note that only the `RADAR1090_KEY` parameter is mandatory, the rest are optional. + +| Parameter | Description | Default value if omitted | +|-----------|-------------|---------------| +| `TZ` | Sets the timezone for the container, in the format `Europe/London` | Unset (UTC) | +| `RADAR1090_KEY` | Sharing Key (in this format `0x7A3DF151D95F3E9A`) as provided by Radar1090 UK | Unset | +| `BEASTHOST` | Hostname or IP address of the Beast-format data source. Use the container name if available, or use the host machine's IP address (and not `localhost` or `127.0.0.1`!) if your feeder is not containerized | `ultrafeeder` | +| `RADARSERVER` | Hostname or IP address of the Radar1090 Server. You shouldn't have to set this parameter unless Radar1090 asks you to change it | `adsb-in.1090mhz.uk` | +| `RADARPORT` | UDP Port number of the Radar1090 Server. You shouldn't have to set this parameter unless Radar1090 asks you to change it | `2227` | +| `MEASURE_INTERVAL` | Watchdog measurement interval (in secs) - interval in which the internal Watchdog verifies that data is still flowing to the Radar1090 Server | `300` | +| `MEASURE_TIME` | Watchdog measurement time (in secs) - How long the internal Watchdog will monitor that stat is still flowing to the Radar1090 Server | `15` | +| `FAILURES_TO_GO_UNHEALTHY` | HEALTHCHECK related parameter - the minimum number of consecutive Watchdog failures that will make the container go `UNHEALTHY` | `3` | + +## Logging + +- All processes are logged to the container's stdout, and can be viewed with `docker logs [-f] radar1090`. + +## Getting help + +Please feel free to [open an issue on the project's GitHub](https://github.com/sdr-enthusiasts/docker-radar1090/issues). + +We don't always immediately see issues filed on Github. Please join us on the `#adsb-containers` channel on the [SDR-Enthusiasts Discord Server](https://discord.gg/sTf9uYF) where there are always a number of us able and willing to help! diff --git a/build-here.sh b/build-here.sh deleted file mode 100644 index aeb3eea..0000000 --- a/build-here.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# -set -x -set -e -trap 'echo -e "[ERROR] $0 in line $LINENO when executing: $BASH_COMMAND"' ERR - -# rebuild the container -mv rootfs/usr/share/planefence/airlinecodes.txt /tmp -curl --compressed -s -L -o rootfs/usr/share/planefence/airlinecodes.txt https://raw.githubusercontent.com/kx1t/planefence-airlinecodes/main/airlinecodes.txt - -# make the build certs root_certs folder: -# Note that this is normally done as part of the github actions - we don't have those here, so we need to do it ourselves before building: -#ls -la /etc/ssl/certs/ -mkdir -p ./root_certs/etc/ssl/certs -mkdir -p ./root_certs/usr/share/ca-certificates/mozilla -cp --no-dereference /etc/ssl/certs/*.crt ./root_certs/etc/ssl/certs -cp --no-dereference /etc/ssl/certs/*.pem ./root_certs/etc/ssl/certs -cp --no-dereference /usr/share/ca-certificates/mozilla/*.crt ./root_certs/usr/share/ca-certificates/mozilla - -echo "$(git branch --show-current)_($(git rev-parse --short HEAD))_$(date +%y-%m-%d-%T%Z)" > rootfs/usr/share/planefence/branch - -docker build . -t planefence -mv /tmp/airlinecodes.txt rootfs/usr/share/planefence/ -rm -f rootfs/usr/share/planefence/branch -rm -rf ./root_certs diff --git a/buildnow.sh b/buildnow.sh deleted file mode 100644 index fd12d45..0000000 --- a/buildnow.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC2086 - -[[ "$1" != "" ]] && BRANCH="$1" || BRANCH="$(git branch --show-current)" -[[ "$BRANCH" == "main" ]] && TAG="latest" || TAG="$BRANCH" -[[ "$ARCHS" == "" ]] && ARCHS="linux/armhf,linux/arm64,linux/amd64" - -BASETARGET1=ghcr.io/sdr-enthusiasts -#BASETARGET2=kx1t - -IMAGE1="$BASETARGET1/docker-planefence:$TAG" -#IMAGE2="$BASETARGET2/$(pwd | sed -n 's|.*/docker-\(.*\)|\1|p'):$TAG" - - -echo "press enter to start building $IMAGE1 from $BRANCH" - -#shellcheck disable=SC2162 -read - -starttime="$(date +%s)" -# rebuild the container -set -x - -git pull -a - -docker buildx build -f Dockerfile --compress --push $2 --platform $ARCHS --tag "$IMAGE1" . -# [[ $? ]] && docker buildx build --compress --push $2 --platform $ARCHS --tag $IMAGE2 . - -echo "Total build time: $(( $(date +%s) - starttime )) seconds"