Skip to content

Instantly share code, notes, and snippets.

@7h3rAm
Forked from EvenAR/adsb-and-liveatc-feed.md
Created December 31, 2023 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7h3rAm/33a06a57f0b921a1716bd61b7a4082b8 to your computer and use it in GitHub Desktop.
Save 7h3rAm/33a06a57f0b921a1716bd61b7a4082b8 to your computer and use it in GitHub Desktop.

ADS-B and LiveATC feeder

Setup for feeding data from my Raspberry Pi to:

Hardware:

  • Raspberry Pi 4 Debian Bullseye, arm64
  • Mode-S Beast MkII (USB ADS-B receiver)
  • CM108 USB sound card with bias voltage removed from mic input (see how to)
  • Scanner radio

The Raspberry Pi will be configured to start each feeding service automatically after it boots.

ADS-B feeding setup

This tool redistributes the data stream coming from the Mode-S Beast so multiple software can read from it.

$ dpkg-buildpackage -b
$ sudo dpkg -i ../beast-splitter_8.2_arm64.deb

Install FlightAware feeder

sudo bash -c "$(wget -O - https://raw.githubusercontent.com/abcd567a/piaware-ubuntu-debian-amd64/master/install-piaware.sh)"

Configure:

sudo piaware-config feeder-id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 
sudo piaware-config allow-manual-updates yes 
sudo piaware-config allow-auto-updates yes 
sudo systemctl restart piaware

It should automatically detect the data stream from Beast Splitter. The FlightAware feed should now be up and running.

Install Flightradar24 feeder

$ sudo bash -c "$(wget -O - http://repo.feed.flightradar24.com/install_fr24_rpi.sh)"

Important setup steps

Step 1.3 - Would you like to participate in MLAT calculations? (yes/no)$:no
...
Would you like to use autoconfig (*yes*/no)$:no
...
Step 4.1 - Receiver selection:

 1 - DVBT Stick (USB)
 -----------------------------------------------------
 2 - SBS1/SBS1er (USB/Network)
 3 - SBS3 (USB/Network)
 4 - ModeS Beast (USB/Network)
 5 - AVR Compatible (DVBT over network, etc)
 6 - microADSB (USB/Network)

Enter your receiver type (1-7)$:4
...
Step 4.2 - Please select connection type:

 1 - Network connection
 2 - USB directly to this computer

Enter your connection type (1-2)$:1
...
Step 4.3A - Please enter your receiver's IP address/hostname
$:localhost 

Step 4.3B - Please enter your receiver's data port number
$:30005

The FlightRadar24 feed should now be up and running.

Install opensky feeder

wget https://opensky-network.org/files/firmware/opensky-feeder_latest_armhf.deb
sudo dpkg -i opensky-feeder_latest_armhf.deb

See https://opensky-network.org/community/projects/30-dump1090-feeder

LiveATC feed setup

Install Darkice. This software is used for streaming audio to Icecast servers.

$ sudo apt-get install libmp3lame0 libtwolame0
$ sudo apt-get install -y darkice

Create the file /etc/darkice.cfg (this is the file darkice reads by default)

[general]
duration        = 0
bufferSecs      = 5
reconnect       = yes

[input]
device          = plughw:1,0     # sound device
sampleRate      = 44100          # 22050 or 44100
bitsPerSample   = 16             # only use 16
channel         = 1              # use mono

[icecast2-0]
bitrateMode     = cbr
format          = mp3
bitrate         = 16             
server          = audio-in.liveatc.net
port            = 8010
sampleRate      = 22050
lowpass         = 3500
mountPoint      = ASSIGNED-BY-LIVEATC
password        = ASSIGNED-BY-LIVEATC
name            = FEED-DESCRIPTION
description     = FEED-DESCRIPTION
url             = http://www.liveatc.net
genre           = ATC
public          = no

Create /lib/systemd/system/darkice.service:

[Unit]
Description=DarkIce live audio streamer

[Service]
Restart=always
RestartSec=3
ExecStart=darkice
ExecStop=/usr/bin/pkill darkice

CPUSchedulingPolicy=fifo
CPUSchedulingPriority=4

[Install]
WantedBy=multi-user.target

Then activate the new service

$ sudo systemctl daemon-reload
$ sudo systemctl enable darkice
$ sudo systemctl start darkice

Darkice should now be streaming to LiveATC. Use alsamixer to adjust the volume:

$ alsamixer -c 1

To ensure the audio device ID is the same every time the PI boots

List the available audio devices using cat /proc/asound/modules. This should give an output similar to this:

 0 snd_bcm2835
 1 snd_usb_audio
 2 vc4
 3 vc4

Create the file /etc/modprobe.d/alsa-base.conf and specify which index each audio device should get. Since the Darkice config specifies device = plughw:1,0 the USB sound card should have index 1. Setting vc4 index=-2 ensures that the micro-HDMI outputs are never used as default audio device. More info here.

options snd_bcm2835 index=0
options snd_usb_audio index=1
options vc4 index=-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment