ADS-B Receiver Project Setup Scripts

Following are four (4) additional steps to make the hand-installed dump1090-fa work.

(1) Added rtl-sdr.rules, and rebooted, still spinning wheel on map

sudo wget -O  /etc/udev/rules.d/rtl-sdr.rules "https://raw.githubusercontent.com/osmocom/rtl-sdr/master/rtl-sdr.rules"   
sudo reboot   

.

(2) Added line START_DUMP1090="yes" to file /etc/default/dump1090-fa, so it became

START_DUMP1090="yes"

RECEIVER_OPTIONS="--device-index 0 --gain -10 --ppm 0 --net-bo-port 30005"
DECODER_OPTIONS="--max-range 360"
NET_OPTIONS="--net --net-heartbeat 60 --net-ro-size 1000 --net-ro-interval 1 --net-ri-port 0 --net-ro-port 30002 --net-sbs-port 30003 --net-bi-port 30004,30104 --net-bo-port 30005"
JSON_OPTIONS="--json-location-accuracy 1"

Rebooted, still spinning wheel on map, and now it gives this output

sudo systemctl status dump1090-fa -l
● dump1090-fa.service - LSB: dump1090 daemon (Flightaware variant)
   Loaded: loaded (/etc/init.d/dump1090-fa; generated; vendor preset: enabled)
   Active: active (exited) since Mon 2018-08-20 13:11:53 EDT; 5min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 404 ExecStart=/etc/init.d/dump1090-fa start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/dump1090-fa.service

Aug 20 13:11:53 raspberrypi systemd[1]: Starting LSB: dump1090 daemon (Flightaware variant)...
Aug 20 13:11:53 raspberrypi dump1090-fa[404]: start-stop-daemon: user 'dump1090' not found
Aug 20 13:11:53 raspberrypi systemd[1]: Started LSB: dump1090 daemon (Flightaware variant).

.

(3) Added user dump1090, and rebooted

sudo adduser --system dump1090
Adding system user `dump1090' (UID 109) ...
Adding new user `dump1090' (UID 109) with group `nogroup' ...
Creating home directory `/home/dump1090' ...

sudo reboot

.

After reboot, the spinning whell still there.
Checked dump1090-fa status, new error messages now

pi@raspberrypi:~ $ sudo systemctl status dump1090-fa -l
● dump1090-fa.service - LSB: dump1090 daemon (Flightaware variant)
   Loaded: loaded (/etc/init.d/dump1090-fa; generated; vendor preset: enabled)
   Active: active (exited) since Mon 2018-08-20 13:23:18 EDT; 1min 20s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 401 ExecStart=/etc/init.d/dump1090-fa start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/dump1090-fa.service

Aug 20 13:23:18 raspberrypi systemd[1]: Starting LSB: dump1090 daemon (Flightaware variant)...
Aug 20 13:23:18 raspberrypi dump1090-fa[401]: touch: missing file operand
Aug 20 13:23:18 raspberrypi dump1090-fa[401]: Try 'touch --help' for more information.
Aug 20 13:23:18 raspberrypi dump1090-fa[401]: chown: missing operand after ‘dump1090:root’
Aug 20 13:23:18 raspberrypi dump1090-fa[401]: Try 'chown --help' for more information.
Aug 20 13:23:18 raspberrypi dump1090-fa[401]: /etc/init.d/dump1090-fa: 134: /etc/init.d/dump1090-fa: cannot create : Directory nonexistent
Aug 20 13:23:18 raspberrypi systemd[1]: Started LSB: dump1090 daemon (Flightaware variant).

.
Checked if /run/dump1090-fa directory (for json files) and log file /var/log/dump1090-fa.log is created by init script or not. Found

  • directory /run/dump1090-fa exists
  • file /var/log/dump1090-fa.log does not exist.

.

(4) Added line LOGFILE="/var/log/dump1090-fa.log" to file /etc/init.d/dump1090-fa and rebooted. The file became like this

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="dump1090-fa daemon"
NAME=dump1090-fa
DAEMON=/usr/bin/$NAME
ARGS="--measure-noise "
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
DUMP1090_USER="dump1090"
JSON_DIR="/run/dump1090-fa"
LOGFILE="/var/log/dump1090-fa.log"

.

SUCCESS !!!

sudo systemctl status dump1090-fa -l

● dump1090-fa.service - LSB: dump1090 daemon (Flightaware variant)
   Loaded: loaded (/etc/init.d/dump1090-fa; generated; vendor preset: enabled)
   Active: active (running) since Mon 2018-08-20 13:43:11 EDT; 3min 15s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 411 ExecStart=/etc/init.d/dump1090-fa start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/dump1090-fa.service
           └─493 /usr/bin/dump1090-fa --measure-noise --net --max-range 300 --net-ri-port 0 --net-ro-port 0 --net-bi-port 0 --net-bo-port 0 --net-sbs-

Aug 20 13:43:10 raspberrypi systemd[1]: Starting LSB: dump1090 daemon (Flightaware variant)...
Aug 20 13:43:11 raspberrypi systemd[1]: Started LSB: dump1090 daemon (Flightaware variant).

.

Edited file /usr/share/dump1090-fa/html/config.js and updated following 3 parameters

SiteShow    = true;           // true to show a center marker
SiteLat     = xx.xxxx;            // position of the marker
SiteLon     = yy.yyyy;

.

1 Like

@obj

New challenge

First the good news …

With the hand-built and hand configured dump1090-fa, the good news was that finally the SkyView map started working (please see my last 2 posts above).

Now the bad news…

Piaware: no program is serving data at port 30005.
Pfclient: unable to connect to 127.0.0.1:30005

:angry: :angry: :angry:

Next try, possibly tomorrow:

  1. Delete file /etc/init.d/dump1090-fa
  2. sudo update-rc.d dump1090-fa remove
  3. Copy from cloned source-code, the file
    dump1090-fa.service
    to folders
    /etc/systemd/system/multi-user.target.wants/
    /usr/lib/systemd/system/
    /usr/run/systemd/system/

This is why you should just use the debian package, tbh.

2 Likes

I have installed the FA package manually and then re-run the script without selecting to install the FA.
It worked perfectly.

2 Likes

Thanks Oliver. Fully agree with you. That is what I mostly do.

The hand-built/hand-configured attempt is just to excercise the brain, to kill the spare time, and to satisfy curiosity. :slight_smile:

2 Likes

@obj

Continued …hand-built/hand-configured dump1090-fa.

1- Removed old start-up method (init.d)

sudo rm /etc/init.d/dump1090-fa
sudo update-rc.d dump1090-fa remove   
sudo systemctl daemon-reload 

.

2 - Created new start-up method (systemd/dump1090-fa.service)

2.1 - Copied file dump1090-fa.service from cloned source-code to folder /lib/systemd/system/

sudo cp ~/build-dump-fa/dump1090/debian/dump1090-fa.service  /lib/systemd/system/dump1090-fa.service

2.2 - Created required directory default.target.wants to hold symlink

sudo mkdir /etc/systemd/system/default.target.wants

2.3 - Created symlink

sudo ln -s ~/build-dump-fa/dump1090/debian/dump1090-fa.service /etc/systemd/system/default.target.wants/

2.4 - Checked symlink

ls -l /etc/systemd/system/default.target.wants/dump1090-fa.service
lrwxrwxrwx 1 root root 58 Aug 21 01:53 /etc/systemd/system/default.target.wants/dump1090-fa.service -> /home/pi/build-dump-fa/dump1090/debian/dump1090-fa.service

2.5 - Rebooted Pi

sudo reboot

2.6 - After reboot checked status

.
2.6.1 - dump1090-fa

 sudo systemctl status dump1090-fa -l

● dump1090-fa.service - dump1090 ADS-B receiver (FlightAware customization)
   Loaded: loaded (/lib/systemd/system/dump1090-fa.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-08-21 02:17:02 EDT; 3s ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 3109 (dump1090-fa)
   CGroup: /system.slice/dump1090-fa.service
           └─3109 /usr/bin/dump1090-fa --device-index 0 --gain -10 --ppm 0 --net-bo-port 30005 --max-range 360 --net --net-heartbeat 60 --

Aug 21 02:17:02 raspberrypi systemd[1]: Started dump1090 ADS-B receiver (FlightAware customization).
Aug 21 02:17:02 raspberrypi dump1090-fa[3109]: Tue Aug 21 02:17:02 2018 EDT  dump1090-fa  starting up.
Aug 21 02:17:02 raspberrypi dump1090-fa[3109]: rtlsdr: using device #0: Generic RTL2832U (Realtek, RTL2832U, SN 00000000)
Aug 21 02:17:02 raspberrypi dump1090-fa[3109]: Detached kernel driver
Aug 21 02:17:02 raspberrypi dump1090-fa[3109]: Found Rafael Micro R820T tuner
Aug 21 02:17:03 raspberrypi dump1090-fa[3109]: rtlsdr: enabling tuner AGC

.
.

2.6.2 - Piaware

pi@raspberrypi:~ $ sudo systemctl status piaware -l

● piaware.service - FlightAware ADS-B uploader
   Loaded: loaded (/lib/systemd/system/piaware.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-08-21 02:13:29 EDT; 19min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 408 (piaware)
   CGroup: /system.slice/piaware.service
           ├─ 408 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
           ├─3451 /usr/lib/piaware/helpers/fa-mlat-client --input-connect localhost:30005 --input-type dump1090 --results beast,connect,localhost:30104
           └─3460 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout --lat 43.xxx --lon -79.xxx

Aug 21 02:18:05 raspberrypi piaware[408]: piaware has successfully sent several msgs to FlightAware!
Aug 21 02:19:04 raspberrypi piaware[408]: 22 msgs recv'd from dump1090-fa (22 in last 5m); 22 msgs sent to FlightAware
Aug 21 02:24:04 raspberrypi piaware[408]: 93 msgs recv'd from dump1090-fa (71 in last 5m); 93 msgs sent to FlightAware
Aug 21 02:29:04 raspberrypi piaware[408]: 163 msgs recv'd from dump1090-fa (70 in last 5m); 163 msgs sent to FlightAware
Aug 21 02:32:34 raspberrypi piaware[408]: mlat-client(3451): Receiver status: connected
Aug 21 02:32:34 raspberrypi piaware[408]: mlat-client(3451): Server status:   synchronized with 46 nearby receivers
Aug 21 02:32:34 raspberrypi piaware[408]: mlat-client(3451): Receiver:    8.4 msg/s received        3.9 msg/s processed (46%)
Aug 21 02:32:34 raspberrypi piaware[408]: mlat-client(3451): Server:      0.0 kB/s from server    0.0kB/s TCP to server     0.1kB/s UDP to server
Aug 21 02:32:34 raspberrypi piaware[408]: mlat-client(3451): Results:  5.1 positions/minute
Aug 21 02:32:34 raspberrypi piaware[408]: mlat-client(3451): Aircraft: 0 of 1 Mode S, 2 of 2 ADS-B used

.
.
2.6.3 - Planefinder

2018-08-21 06:17:04.347864 [-] TCP connection established: 127.0.0.1:30005
2018-08-21 06:18:50.328681 [-] Successfully sent 41 aircraft updates across 10 packets (6.00KB)
2018-08-21 06:20:34.287589 [-] Successfully sent 33 aircraft updates across 10 packets (6.00KB)
2018-08-21 06:22:17.945602 [-] Successfully sent 32 aircraft updates across 10 packets (5.00KB)
2018-08-21 06:24:01.559075 [-] Successfully sent 37 aircraft updates across 10 packets (6.00KB)
2018-08-21 06:24:03.78770  [-] User location has been verified.
2018-08-21 06:25:45.478128 [-] Successfully sent 41 aircraft updates across 10 packets (6.00KB)
2018-08-21 06:27:29.530524 [-] Successfully sent 26 aircraft updates across 10 packets (5.00KB)
2018-08-21 06:29:04.835623 [V] Performing NTP sync (0.planefinder.pool.ntp.org)...
2018-08-21 06:29:04.895812 [V] NTP sync succeeded with settings:
2018-08-21 06:29:04.896023 [V]  Stratum: 1
2018-08-21 06:29:04.896143 [V]  System clock time: 1534832944.8958
2018-08-21 06:29:04.896229 [V]  Corrected clock time: 1534832944.9275
2018-08-21 06:29:04.896308 [V]  Corrected clock time: 1534832944.9132 (est)
2018-08-21 06:29:04.896377 [V]  NTP drift: 0.0010s/min
2018-08-21 06:29:04.896439 [V]  NTP offset: 0.0317s
2018-08-21 06:29:13.265125 [-] Successfully sent 28 aircraft updates across 10 packets (6.00KB)
2018-08-21 06:30:57.524170 [-] Successfully sent 30 aircraft updates across 10 packets (6.00KB)
2018-08-21 06:32:41.216236 [-] Successfully sent 28 aircraft updates across 10 packets (6.00KB)
2018-08-21 06:34:25.279779 [-] Successfully sent 22 aircraft updates across 10 packets (6.00KB)
2018-08-21 06:34:39.877218 [V] Low-traffic detected, restarting client (this is standard behaviour and is safe to ignore)
2018-08-21 06:34:39.877668 [-] Closed TCP connection: 127.0.0.1:30005
2018-08-21 06:34:39.877765 [-] Client restarted successfully
2018-08-21 06:34:39.878574 [-] TCP connection established: 127.0.0.1:30005
2018-08-21 06:35:03.741624 [V] Low-traffic detected, restarting client (this is standard behaviour and is safe to ignore)

.
.
2.6.3 - SkyView Map

1 Like

Usually you’d do this via “systemctl enable”

Thanks Oliver for pointing out this. I was not aware of it, knew only ln -s method. Next time I will use it.

I discovered that I have made a mistake in creating symlink.
Instead of creating symlink to file
/lib/systemd/system/dump1090-fa.service,
I created symlink to the copy of same file in cloned directory, i.e. to
~/build-dump-fa/dump1090/debian/dump1090-fa.service.
However it is still working ok (for now).
Result of working late at night :slight_smile:

Thanks for all your help and guidance.

.

Installing dump1090-fa on Debian 9.5 amd64 (on Intel PC).

The asdsb-receiver project script (JProchazka) failed due to packages for bladeRF (same as it happened on RPi).

Installed by hand, and it works fine. Thanks to Oliver @obj for guidance.

1- INSTALL PRE-REQUISITES

sudo apt update  
sudo apt install git  
sudo apt install libncurses5-dev  
sudo apt install librtlsdr-dev  

sudo apt install make
sudo apt install pkg-config
sudo apt install build-essential

2 - BUILD

sudo mkdir ~/build-dump-fa  
cd ~/build-dump-fa  
sudo git clone https://github.com/flightaware/dump1090.git  
cd ~/build-dump-fa/dump1090  

sudo make BLADERF=no  

3 - TEST

cd ~/build-dump-fa/dump1090
sudo ./dump1090

Thu Aug 23 10:58:16 2018 EDT  dump1090-fa  starting up.
rtlsdr: using device #0: Generic RTL2832U (Realtek, RTL2832UFA, SN 00000001)
Detached kernel driver
Found Rafael Micro R820T tuner
rtlsdr: tuner gain set to 49.6 dB

4 - CONFIGURATION & INSTALLATION TO AUTO-START AT BOOT

sudo cp -r ~/build-dump-fa/dump1090/dump1090  /usr/bin/dump1090-fa  

sudo cp ~/build-dump-fa/dump1090/debian/dump1090-fa.default /etc/default/dump1090-fa 

sudo cp ~/build-dump-fa/dump1090/debian/dump1090-fa.service  /lib/systemd/system/dump1090-fa.service  

sudo systemctl enable dump1090-fa.service 

sudo adduser --system dump1090 

sudo wget -O  /etc/udev/rules.d/rtl-sdr.rules "https://raw.githubusercontent.com/osmocom/rtl-sdr/master/rtl-sdr.rules"  

sudo reboot

5 - SETUP WEB SERVER AND SKYVIEW MAP

sudo apt install lighttpd 
sudo mkdir /usr/share/dump1090-fa  
sudo cp -r ~/build-dump-fa/dump1090/public_html /usr/share/dump1090-fa/html  

sudo cp ~/build-dump-fa/dump1090/debian/lighttpd/89-dump1090-fa.conf  /etc/lighttpd/conf-available/89-dump1090-fa.conf  
sudo lighty-enable-mod dump1090-fa  
sudo service lighttpd force-reload  

ENABLED RANGE CIRCLES AND CENTER MARKER
sudo nano /usr/share/dump1090-fa/html/config.js

Edited following entries
SiteShow = true; // true to show a center marker
SiteLat = xx.xxxx; // position of the marker
SiteLon = yy.yyyy;

.
.

2 Likes

I would add the step #1 the installation of netcat - for the case that dump978 is to be installed. That failed too…
sudo apt install netcat

How do I shut down dump1090-mutability after I am done using ads-b receiver web portal? I want to use my rtl-sdr in GQRX as well.

How do I restart dump1090-mutability the with the correct arguments so the webportal can see it running? WQhat are the correct arguments?

I can see the arguments in Task Manager using the ‘command line’ option but the line is too long and it doesn’t allow copy and pasting.

ADSB Receiver Project installed and ran successfully on Lubuntu 18.04.02.

shut down temporarily :
sudo systemctl stop dump1090-mutability or
sudo service dump1090-mutability stop
(to restart use same commands substituting stop with restart)

shut down - prevent start after reboot
dpkg-reconfigure dump1090-mutability then select [No] in first screen and press
the ‘enter’ key. then continue pressing ‘enter’ for the next 3 pop-up screens. now
dump1090-mutability will be deactivated until you run the same command again, select [yes] and confirm your settings in the screens that follow.

that will stop the decoder and ‘release’ the receiver for use by other programs
such as GQRX.
Not sure about the web portal, I think is still there ‘dormant’ and not interfering with other software, so no need to ‘touch it’
.
HTH
evangel

1 Like

I appreciate your reply. That was no doubt a helpful reply. I did post a Feature Request for this sort of thing. It did work.

How do I check to see if the “Advanced Features” are turned on or off?
And how can I change them? Running the “.install” again doesn’t offer that option anymore.

1 Like

when you select ‘Advanced Features’ will ask you to install Sqlite or MySql.
do you remember installing any of these ?
another way is to watch the disk capacity. if it is dropping fast, it probably means
that your traffic is logged by mutability.

also in the admin/maintenance page it will show the size of database if any.

I don’t have those databases in admin page.
However, I see that the “Disk I/O Bandwidth” is averaging/current 44kB/sec Writes. Zero reads current.

I am using basic HTML function. I need to change the range rings. How do I change it? Do I need to rerun the script? whats the command for dpkg to reconfigure the html functionality?

edit nano /usr/share/dump1090-mutability/html/config.js
line SiteCirclesDistances = new Array(100,200,250);
to whatever range you need, add, delete or modify these numbers.

no

dpkg-reconfigure dump1090-mutability
as per my earlier post. when you select [yes] it will take you through
all the configuration steps

1 Like

Thanks!

It works! The heywatsthat site has made my jaws drop! It’s range rings are very close to what I see in the real world. I see the terrain also has a bit of influence on reception.

My last question is how do i make it work for MLAT with my flightaware account? I chose Flightaware Piaware in the script.