見出し画像

Memorandum: fr24feed and dump1090-mutability

Since I bought a Raspberry Pi, I built an ADS-B feeder for FlightRader24. In this article, I assume the reader has experience building his/her feeder. I also assume the Raspberry Pi has been configured to work with the Raspberry Pi OS version 6.1 or later.

First, the package for USB dongles should be installed.

$ sudo apt install rtl-sdr

The blacklist file has to be prepared to avoid conflict between drivers. In /etc/modprobe.d directory, there must be a file containing the name of the device as follows:

/etc/modprobe.d t-$ cat blacklist-blacklist-_usb_rtl28xxu.conf
blacklist dvb_usb_rtl28xxu

Then, insert a USB dongle to a USB port, and test it working.

$ rtl_test
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
[R82XX] PLL not locked!
Sampling at 2048000 S/s.

Info: This tool will continuously read from the device, and report if
samples get lost. If you observe no further output, everything is fine.

Reading samples in async mode...
Allocating 15 zero-copy buffers
lost at least 84 bytes

Okay, it looks working.
Next, the decoder, dump1090 should be installed. Since dump1090 is now obsolete, "dump1090-mutability" is available as a package for Raspberry Pi (it is also obsolete, though).

$ sudo apt install dump1090-mutability 

During the installation process, you would be asked if it is set to automatically start. Here select "no". After installation, check if everything is okay as follows:

$ dump1090-mutability
Tue Nov  7 20:29:06 2023 JST  EB_SOURCE EB_VERSION starting up.
Using sample converter: UC8, integer/table path
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001 (currently selected)
Found Rafael Micro R820T tuner
Max available gain is: 49.60 dB
Setting gain to: 49.60 dB
Gain reported by device: 49.60 dB
Allocating 15 zero-copy buffers

If it does not run, perhaps it might be necessary to set appropriate permissions. If it seems running, hook up an antenna via a coaxial cable. Then run dump1090 with interactive mode.

$ dump1090-mutability --interactive
 Hex    Mode  Sqwk  Flight   Alt    Spd  Hdg    Lat      Long   RSSI  Msgs  Ti\
-------------------------------------------------------------------------------
 ****** S     ****  *******  17000  333  093   43.558  142.829 -26.5    47  0
 ****** S     ****  *******  12350  189  245   43.395  142.747 -28.6    72  1

Soon some flights are displayed on the terminal. Yes. it works perfectly.
Next, the installation script of fr24feed is downloaded.

$ wget http://repo.feed.flightradar24.com/install_fr24_
rpi.sh

Then, run the script.

$ sudo sh ./install_fr24_rpi.sh

Wait a while. It would be good to have coffee or tea. Soon you are asked some questions on your rader site. It should be noted that dump1090-mutability is linked to dump1090 during the installation process.

Welcome to the FR24 Decoder/Feeder sign up wizard!

Before you continue please make sure that:

 1 - Your ADS-B receiver is connected to this computer or is accessible over network
 2 - You know your antenna's latitude/longitude up to 4 decimal points and the altitude in feet
 3 - You have a working email address that will be used to contact you
 4 - fr24feed service is stopped. If not, please run: sudo systemctl stop fr24feed

To terminate - press Ctrl+C at any point


Step 1.1 - Enter your email address (username@domain.tld)
$:***@*****.***

Step 1.2 - If you used to feed FR24 with ADS-B data before, enter your sharing key.
If you don't remember your sharing key, you can find it in your account on the website under "My data sharing".
https://www.flightradar24.com/account/data-sharing

Otherwise leave this field empty and continue.
$:**********

Verifying sharing key...OK



Step 1.3 - Would you like to participate in MLAT calculations? (yes/no)$:no
pgrep: pattern that searches for process name longer than 15 characters will result in zero matches
Try `pgrep -f' option to match against the complete command line.

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)$:1
Checking for dump1090...FOUND

Step 4.3 - Enter your additional dump1090 arguments or leave empty
$:

Step 5.1 - Would you like to enable RAW data feed on port 30002 (yes/no)$:yes

Step 5.2 - Would you like to enable Basestation data feed on port 30003 (yes/no)$:yes

Saving settings to /etc/fr24feed.ini...OK
Settings saved, please run "sudo systemctl restart fr24feed" to use new configuration.

Starting the fr24feed service, it may take a while if dump1090 needs to be installed...
Installation and configuration completed!

Now the received ADS-B data is automatically fed to the FlightRader24 server. The present status of fr24feed can be shown on the browser by connecting the 8754 port of the IP address of the feeder (Raspberry Pi).

Status of fr24feed through the Port 8754

In addition, the received data can be seen through lighttpd, which has been installed with dump1090-mutability. Check the 80 port (HTTP) of the Raspberry Pi with the browser. A neatly organized page would be shown on the display. However, I had a problem: no flight was shown on the map, nor did the clock seem to tick. There was a warning at the bottom-left of the map, saying "Problem fetching data from dump1090. AJAX call failed (error: Not Found). Maybe dump1090 is no longer running? The displayed map will be out of date."

Warning message

This might be caused by the lost connection between dump1090-mutability and lighttpd. When it is invoked by fr24feed, it is running with the options as follows:

/usr/bin/dump1090-mutability --raw --write-json /run/dump1090-mutability/

Dump1090-mutability periodically writes data in the directory /run/dump1090-mutability/, while lighttpd reads them. Hence, if the directory did not exist, the connection between them might be lost.
Check this guess by typing the following commands:

$ sudo mkdir /run/dump1090-mutability/
$ sudo chown fr24 /run/dump1090-mutability
$ sudo chmod 755 /run/dump1090-mutability

In my case, the trouble has been solved by these commands. The annoying message on the map disappeared, and the two clocks on the right pane began synchronizing.
Please notice the /run directory is on the tmpfs file system, which is created on RAM. Hence it should be created every booting. Make a file on /usr/lib/tmpfiles.d/ to specify the temporary directory.

/usr/lib/tmpfiles.d $ cat dump1090-mutability.tmpfile.conf
d /run/dump1090-mutability 0755 fr24 fr24 -

I think the Raspberry Pi is now ready for work on the ADS-B feeder. With your fingers crossed, reboot the system and see what happens.

de JI3XOK/JM8SMO K. h. I.


この記事が気に入ったらサポートをしてみませんか?