# [EN] Linux — ADS-B.Pro feeder installation

This guide is for Raspberry Pi and other Linux computers. Supported architectures are `amd64`, `arm64`, `armv6`, and `armv7`.

The new feeder connects to ADS-B.Pro over encrypted TLS. Your token is needed only for the first pairing of an installation — it is not sent with every ADS-B frame.

## Before you start

You need:

- an ADS-B.Pro account and a token beginning with `ADS-`;
- a working ADS-B data source on the same machine;
- an account with `sudo` access;
- outbound access to `feed.ads-b.pro` on port `48582`.

The installer looks for valid frames, not for particular program names:

1. Beast Binary on `127.0.0.1:30005`;
2. if no valid Beast frame is received within 5 seconds — BaseStation/SBS on `127.0.0.1:30003`.

This works with `readsb`, `dump1090`, `tar1090`, and other software exposing a compatible stream.

## Installation

Run in a terminal:

```bash
curl -fsSL https://raw.githubusercontent.com/br3jski/radarview/main/radarview_setup.sh | sudo bash
```

If no previous configuration is found, the installer asks for your ADS-B.Pro token without displaying it on screen.

The installer:

- downloads the correct feeder build for the computer;
- verifies the signed release manifest and the file's SHA-256 checksum;
- creates the dedicated `adsbpro-feeder` system user;
- stores the installation's private key locally only;
- installs and starts a hardened systemd service;
- enables the local status page on port `54321`;
- waits for the connection and the first frame accepted by ADS-B.Pro.

The temporary token copy is removed after successful pairing.

## Migrating from `/opt/radarview.py`

Do not remove the old `radarview` service before installation.

The installer can read the token from the old script without printing it. It disables the old service only after the new feeder connects to ADS-B.Pro and sends its first accepted frame. The old script stays on disk for emergency rollback.

Do not run both the legacy and the new feeder for the same receiver. That sends duplicate data and wastes bandwidth.

## Verify the installation

Feeder status:

```bash
sudo /usr/local/bin/adsbpro-feeder status
```

Service status and recent logs:

```bash
sudo systemctl status adsbpro-feeder --no-pager
sudo journalctl -u adsbpro-feeder -n 50 --no-pager
```

Status page:

```text
http://FEEDER-IP-ADDRESS:54321
```

On the same machine use `http://localhost:54321`. The status port is intended for your LAN or VPN only — do not expose it to the Internet with router port forwarding.

The expected state is **ACTIVE**. The page also shows aircraft count, message rate, current upload rate, and feeder version.

## Adding another installation to the same account

The first v2 installation can be paired with the token alone. Before pairing every additional installation, open a 10-minute pairing window in your ADS-B.Pro account and then run the installer on the new computer.

## Non-standard source address or port

For a source running on a different host or port, download the setup script and pass explicit options, for example:

```bash
curl -fsSL https://raw.githubusercontent.com/br3jski/radarview/main/radarview_setup.sh -o /tmp/radarview_setup.sh
sudo bash /tmp/radarview_setup.sh --source-host 192.168.1.25 --source-mode beast --beast-port 30005
```

For BaseStation/SBS use `--source-mode sbs --sbs-port PORT_NUMBER`.

## Updating

The feeder does not update itself. When the status page displays **UPDATE AVAILABLE**, run the same installation command again. The paired installation identity is preserved.

## Emergency rollback

```bash
sudo /usr/local/sbin/adsbpro-feeder-rollback
```

This disables the new service and, when a previous `radarview` service was detected, restores it.

## If the feeder is not ACTIVE

Check:

1. that data is really available on `127.0.0.1:30005` or `127.0.0.1:30003`;
2. the output of `sudo /usr/local/bin/adsbpro-feeder status`;
3. `sudo journalctl -u adsbpro-feeder -n 100 --no-pager`;
4. outbound TCP access to `feed.ads-b.pro:48582`;
5. for an additional installation, that the pairing window is open in the account panel.

The installer and feeder source code are public: [github.com/br3jski/radarview](https://github.com/br3jski/radarview).