Two Independent 1090 Mhz ADS-B Receivers on One Pi (No UAT 978)

@obj
@wiedehopf
@caius

Any thoughts?

I have 2 Piaware instances running on one RPI

The “ExecStart=” lines in service files of these instances are as follows:
Instance 1:
sudo nano /lib/systemd/system/piaware.service

ExecStart=/usr/bin/piaware -p %t/piaware/piaware.pid -plainlog -statusfile %t/piaware/status.json

Instance 2:
sudo nano /lib/systemd/system/piaware2.service

ExecStart=/usr/bin/piaware -p %t/piaware2/piaware.pid -plainlog -statusfile %t/piaware2/status.json -configfile /etc/piaware2.conf -cachedir /var/cache/piaware2

.

Both instances are feeding logs to same file:

pi@raspberrypi:~ $ cat /var/log/piaware.log

Aug  4 22:40:23 raspberrypi piaware[550]: logged in to FlightAware as user abcd567
Aug  4 22:40:23 raspberrypi piaware[550]: my feeder ID is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Aug  4 22:40:23 raspberrypi piaware[572]: Starting faup1090: /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr 127.0.0.1 --net-bo-port 31005 --stdout --lat 43.xxx --lon -79.xxx
Aug  4 22:40:23 raspberrypi piaware[550]: site statistics URL: https://flightaware.com/adsb/stats/user/abcd567#stats-5252

......
......
Aug  4 22:40:23 raspberrypi piaware[572]: logged in to FlightAware as user abcd567
Aug  4 22:40:23 raspberrypi piaware[572]: my feeder ID is yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
Aug  4 22:40:23 raspberrypi piaware[572]: site statistics URL: https://flightaware.com/adsb/stats/user/abcd567#stats-6396

.

I tried two workarounds:
workaround-1: In service file of instance 2, in line starting with ExecStart=, replaced -plainlog by -logfile /var/log/piaware2.log . This did not work.

workaround-2: Added following line in service file of instance 2:
StandardOutput=file:/var/log/piaware2.log
This succeeded in diverting instance 2’s log to its own log file /var/log/piawar2.log, but completely spoiled the output of status command:

pi@raspberrypi:~ $ sudo systemctl status piaware2

● piaware2.service - FlightAware ADS-B uploader
   Loaded: loaded (/lib/systemd/system/piaware2.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-08-04 23:02:13 EDT; 4s ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 7055 (piaware)
    Tasks: 4 (limit: 2200)
   Memory: 9.6M
   CGroup: /system.slice/piaware2.service
           ├─7055 /usr/bin/piaware -p /run/piaware2/piaware.pid -plainlog -statusfile /run/piaware2/status.json -configfile /etc/piaware2.conf -cachedir /v
           ├─7088 /usr/lib/piaware/helpers/fa-mlat-client --input-connect 127.0.0.1:31005 --input-type auto --results beast,connect,localhost:31104 --udp-t
           └─7099 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr 127.0.0.1 --net-bo-port 31005 --stdout --lat 43.xxx --lon -79.xxx

Aug 04 23:02:16 raspberrypi sudo[7063]:  piaware : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=list /bin/netstat --program --tcp --wide --all --numeric
Aug 04 23:02:16 raspberrypi sudo[7065]:  piaware : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/netstat --program --tcp --wide --all --numeric
Aug 04 23:02:16 raspberrypi sudo[7065]: pam_unix(sudo:session): session opened for user root by (uid=0)
Aug 04 23:02:16 raspberrypi sudo[7065]: pam_unix(sudo:session): session closed for user root
Aug 04 23:02:17 raspberrypi sudo[7078]:  piaware : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/netstat --program --tcp --wide --all --numeric
Aug 04 23:02:17 raspberrypi sudo[7078]: pam_unix(sudo:session): session opened for user root by (uid=0)
Aug 04 23:02:17 raspberrypi sudo[7078]: pam_unix(sudo:session): session closed for user root
Aug 04 23:02:17 raspberrypi sudo[7089]:  piaware : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/netstat --program --tcp --wide --all --numeric
Aug 04 23:02:17 raspberrypi sudo[7089]: pam_unix(sudo:session): session opened for user root by (uid=0)
Aug 04 23:02:17 raspberrypi sudo[7089]: pam_unix(sudo:session): session closed for user root

.
I added one more line (StandardError) in service file, but it did not change the output of systemcl status piaware:

StandardOutput=file:/var/log/piaware2.log
StandardError=file:/var/log/piaware2error.log

.
The log file piaware2.log shows piaware2 is working OK.

pi@raspberrypi:~ $ cat /var/log/piaware2.log

creating pidfile /run/piaware2/piaware.pid
****************************************************
....
....
logged in to FlightAware as user abcd567
my feeder ID is yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyy
site statistics URL: https://flightaware.com/adsb/stats/user/abcd567#stats-6396
multilateration data requested
.....
.....
mlat-client(7088): Aircraft: 6 of 11 Mode S, 18 of 22 ADS-B used
1567 msgs recv'd from dump1090-mutabi (594 in last 5m); 1567 msgs sent to FlightAware

The usual logging path goes: piaware → stdout/stderr → systemd → journald → rsyslogd → piaware.log

If you want to keep the journald logging but write a separate logfile, look at the rsyslogd config in /etc/rsyslog.d/

1 Like

Thank Oliver. Will follow your advise.

SUCCESS, Independent log files for two instances of piaware.

.
Thanks @obj for guidance

STEP-1

pi@raspberrypi:~ $ sudo nano /etc/rsyslog.d/piaware.conf

if $programname == 'piaware' then /var/log/piaware.log
& stop

.

Added line starting with else if:

if $programname == 'piaware' then /var/log/piaware.log
else if $programname == 'piaware2' then /var/log/piaware2.log
& stop

Saved file, rebooted.
No Luck. Only one log file with both instances as before.

STEP-2

Added line SyslogIdentifier=piaware2 in the file piaware2.service.

pi@raspberrypi:~ $ sudo nano /lib/systemd/system/piaware2.service

[Unit]
Description=FlightAware ADS-B uploader
Documentation=https://flightaware.com/adsb/piaware/
Wants=network-online.target
After=dump1090-fa2.service network-online.target time-sync.target
[Service]
User=piaware
RuntimeDirectory=piaware2
SyslogIdentifier=piaware2
ExecStart=/usr/bin/piaware -p %t/piaware2/piaware.pid -plainlog  -statusfile %t/piaware2/status.json -configfile /etc/piaware2.conf -cachedir /var/cache/piaware2
ExecReload=/bin/kill -HUP $MAINPID
Type=simple
Restart=on-failure
RestartSec=30
# exit code 4 means login failed
# exit code 6 means startup failed (bad args or missing MAC)
RestartPreventExitStatus=4 6
[Install]
WantedBy=default.target

Saved file, rebooted RPi.

SUCCESS

pi@raspberrypi:~ $ ls /var/log/piawa*

/var/log/piaware2.log  /var/log/piaware.log

Checked both files piaware.log and piaware2.log, found logging properly

LOG of 1st instance:

pi@raspberrypi:~ $ cat /var/log/piaware.log

Aug  5 14:44:03 raspberrypi piaware[503]: creating pidfile /run/piaware/piaware.pid
Aug  5 14:44:03 raspberrypi piaware[503]: ****************************************************
...
...
Aug  5 14:44:08 raspberrypi piaware[503]: logged in to FlightAware as user abcd567
Aug  5 14:44:08 raspberrypi piaware[503]: my feeder ID is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Aug  5 14:44:08 raspberrypi piaware[503]: site statistics URL: https://flightaware.com/adsb/stats/user/abcd567#stats-5252
...
...
Aug  5 14:59:20 raspberrypi piaware[503]: mlat-client(939): Aircraft: 20 of 42 Mode S, 26 of 50 ADS-B used
Aug  5 14:59:38 raspberrypi piaware[503]: 6031 msgs recv'd from dump1090-mutabi (1914 in last 5m); 6031 msgs sent to FlightAware


LOG of 2nd instance:

pi@raspberrypi:~ $ cat /var/log/piaware2.log
Aug  5 14:44:03 raspberrypi piaware2[500]: creating pidfile /run/piaware2/piaware.pid
Aug  5 14:44:03 raspberrypi piaware2[500]: ****************************************************
...
Aug  5 14:44:08 raspberrypi piaware2[500]: logged in to FlightAware as user abcd567
Aug  5 14:44:08 raspberrypi piaware2[500]: my feeder ID is yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
Aug  5 14:44:08 raspberrypi piaware2[500]: site statistics URL: https://flightaware.com/adsb/stats/user/abcd567#stats-6396
...
Aug  5 14:59:20 raspberrypi piaware2[500]: mlat-client(940): Aircraft: 12 of 24 Mode S, 30 of 53 ADS-B used
Aug  5 14:59:38 raspberrypi piaware2[500]: 5697 msgs recv'd from dump1090-mutabi (1728 in last 5m); 5697 msgs sent to FlightAware
Aug  5 15:04:38 raspberrypi piaware2[500]: 7187 msgs recv'd from dump1090-mutabi (1490 in last 5m); 7187 msgs sent to FlightAware

STATUS of 1st Instance:

pi@raspberrypi:~ $ sudo systemctl status piaware

● piaware.service - FlightAware ADS-B uploader
   Loaded: loaded (/lib/systemd/system/piaware.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-08-05 14:44:01 EDT; 29min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 503 (piaware)
    Tasks: 4 (limit: 2200)
   Memory: 15.1M
   CGroup: /system.slice/piaware.service
           ├─503 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
           ├─908 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout --lat 43.xxx --lon -79.xxx
           └─939 /usr/lib/piaware/helpers/fa-mlat-client --input-connect localhost:30005 --input-type dump1090 --results beast,connect,localhost:30104 --r

Aug 05 14:54:38 raspberrypi piaware[503]: 4117 msgs recv'd from dump1090-mutabi (1979 in last 5m); 4117 msgs sent to FlightAware
Aug 05 14:59:20 raspberrypi piaware[503]: mlat-client(939): Receiver status: connected
Aug 05 14:59:20 raspberrypi piaware[503]: mlat-client(939): Server status:   synchronized with 151 nearby receivers
Aug 05 14:59:20 raspberrypi piaware[503]: mlat-client(939): Receiver:  342.9 msg/s received      111.3 msg/s processed (32%)
Aug 05 14:59:20 raspberrypi piaware[503]: mlat-client(939): Server:      0.1 kB/s from server    0.0kB/s TCP to server     1.0kB/s UDP to server
Aug 05 14:59:20 raspberrypi piaware[503]: mlat-client(939): Results:  50.5 positions/minute
Aug 05 14:59:20 raspberrypi piaware[503]: mlat-client(939): Aircraft: 20 of 42 Mode S, 26 of 50 ADS-B used
Aug 05 14:59:38 raspberrypi piaware[503]: 6031 msgs recv'd from dump1090-mutabi (1914 in last 5m); 6031 msgs sent to FlightAware
Aug 05 15:04:38 raspberrypi piaware[503]: 7650 msgs recv'd from dump1090-mutabi (1619 in last 5m); 7650 msgs sent to FlightAware

.

STATUS of 2nd instance:

pi@raspberrypi:~ $ sudo systemctl status piaware2

● piaware2.service - FlightAware ADS-B uploader
   Loaded: loaded (/lib/systemd/system/piaware2.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-08-05 14:44:01 EDT; 26min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 500 (piaware)
    Tasks: 4 (limit: 2200)
   Memory: 15.0M
   CGroup: /system.slice/piaware2.service
           ├─500 /usr/bin/piaware -p /run/piaware2/piaware.pid -plainlog -statusfile /run/piaware2/status.json -configfile /etc/piaware2.conf -cachedir /v
           ├─911 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr 127.0.0.1 --net-bo-port 31005 --stdout --lat 43.xxx --lon -79.xxx
           └─940 /usr/lib/piaware/helpers/fa-mlat-client --input-connect 127.0.0.1:31005 --input-type auto --results beast,connect,localhost:31104 --udp-t

Aug 05 14:54:38 raspberrypi piaware2[500]: 3969 msgs recv'd from dump1090-mutabi (2063 in last 5m); 3969 msgs sent to FlightAware
Aug 05 14:59:20 raspberrypi piaware2[500]: mlat-client(940): Receiver status: connected
Aug 05 14:59:20 raspberrypi piaware2[500]: mlat-client(940): Server status:   synchronized with 159 nearby receivers
Aug 05 14:59:20 raspberrypi piaware2[500]: mlat-client(940): Receiver:  373.8 msg/s received      119.5 msg/s processed (32%)
Aug 05 14:59:20 raspberrypi piaware2[500]: mlat-client(940): Server:      0.1 kB/s from server    0.0kB/s TCP to server     1.2kB/s UDP to server
Aug 05 14:59:20 raspberrypi piaware2[500]: mlat-client(940): Results:  44.5 positions/minute
Aug 05 14:59:20 raspberrypi piaware2[500]: mlat-client(940): Aircraft: 12 of 24 Mode S, 30 of 53 ADS-B used
Aug 05 14:59:38 raspberrypi piaware2[500]: 5697 msgs recv'd from dump1090-mutabi (1728 in last 5m); 5697 msgs sent to FlightAware
Aug 05 15:04:38 raspberrypi piaware2[500]: 7187 msgs recv'd from dump1090-mutabi (1490 in last 5m); 7187 msgs sent to FlightAware

.

2 Instances of Set Gain

When I added “Set Gain” button & dropdown in SkyAware map, I faced a problem: Changing gain by browser’s “Set Gain” button on both instances of SkyAware map will change the gain of only 1st instance’s dongle, and 2nd instance’s gain remained unchanged.

Solved it as follows:

(1) cd /usr/share/dump1090-fa
sudo cp -r html html2

(2) sudo nano /etc/lighttpd/conf-enabled/89-dump1090-fa2.conf
Changed all (2) occurances of html by html2

(3) cd /usr/local/sbin/
sudo cp -r gain gain2

(4) sudo nano /usr/local/sbin/gain2/setgain.sh
Changed all (2) occurances of /usr/local/sbin/gain to /usr/local/sbin/gain2

(5) sudo nano /usr/share/dump1090-fa/html2/gain.php
Changed all (2) occurances of /usr/local/sbin/gain to /usr/local/sbin/gain2

(6) sudo crontab -e
Last line was:
@reboot /bin/bash /usr/local/sbin/gain/setgain.sh
Added the line shown below
@reboot /bin/bash /usr/local/sbin/gain2/setgain.sh

(7) sudo reboot

.

1st instance, gain of dongle 1 set to 49.6


.
.

2nd instance, gain of dongle 2 set to -10

Unfortunately Kinetic appears to be a dormant company.

Thanks for the detailed instructions.

Is there a way to feed ADSBexchange and/or RB24 in a similar fashion? I’m set up, 1 RPi, feeding FA, with 1 dongle using dump1090-fa and and a 2nd dongle feeding dump978-fa. My 3rd dongle with dump1090-fa2 to add a second FA site; 2 sites total. Also feeding FR24 with the 2 instances of dump1090-fa per the above instructions. Feeding dump978-fa also to ADSB and RB24.

Thank you!
-Mark

EDIT: To clarify the # of dongles I have, total of 3.

2 x RB24 on one Pi: No because of conflict in using same ports, and they never documented how to modify ports from default.

2 x Adsbexchange on one Pi: Yes, but requires manupulation of files manually.

 

How can you feed both 1090 and 978 with only one dongle? How many dongles in total you have plugged into one RPi?

Sorry, that was badly written. :man_facepalming:

I have 3 dongles.

I started with 1 instance of piaware for 1 FA site. That site uses 2 dongles to feed 1090 and 978. I then followed the directions in this post to add a 2nd instance of piaware and create a 2nd FA site using a 3rd dongle. So, 1 Raspberry Pi. 3 Antennas (2 FA1090 and 1FA 978). 3 Dongles.

1 Like

I hope your RPi and Power Supply can sustain the load of 3 dongles.

Had not thought about that. Anything I should look out for? So far, it appears to be working. Thanks!

1 Like

Great! Hope it continues working OK. I dont think there are many persons using 3 dongles with one RPi.

Just keep an eye, check logs every few days to ensure everything is OK

2 Likes

Will do. Thank you very much

The current crop of Orange FA ProSticks cannot be renumbered (purchased in May). There is no eeprom. The Blue ProStiuck+ that I obtained at the same time can.

This is interesting in that I am running two feeders here. One with the typical Omni and the other with a small Circular Polarized antenna near the ground. It sees things the other doesn’t at times.image0

Mail adsbsupport@flightaware.com and we’ll get you a replacement (there is an eeprom present, there’s just a manufacturing problem that means it’s not usable)

OK - Not usable period or just can’tn be renumbered but otherwise functions?

@W6cz please see our statement about this here: Pro Stick Orange v1.2 issue

Okay, I have been successful in following the instructions and have set up a 2nd ADSB dongle. I use it with low gain to track close aircraft that I normally lose signal when they fly overhead. With the 1st, I also have a UAT antenna/dongle and upload that data along with ADSB. My question is how to set up a 2nd UAT antenna/dongle and upload that data with my 2nd FA account. I guess I’m asking how to set up a 2nd instance of dump978-fa. Apologies for the long winded question!

Given that is exactly the opposite of the thread title, you would be better starting another thread.

The 2nd instance of dump978-fa is theoretically possible, though I have never attemted it because it means 4 dongles plugged into single RPi. This may result in space issue + usb power capacity issues. In fact I did not go for 1st instance of dump978 when there are already 2 instance of dump1090 + 2 dongles.