Add statistics to 2nd instance of dump1090-fa on same Pi?

Hello all… I currently use a RPI 3b along with a package installation of PiAware 3.6.3 installed from the jprochazka package installer…I’m using the performance graphs in that package, and also feeding FR24, ADSBExchange, Opensky, and Planefinder… I use the FA antenna, mounted in my attic with 25’ of LMR400, which goes to a FA external filter… That in turn connects to an SMA Y-splitter and feeds into (1) Pro Stick and (1) Pro Stick Plus. I’ve already set up a 2nd instance of dump1090-fa, and that works well…

The reason I have two receivers is because I am only ~ 3.5 mi from KISP, and directly in the flight path for Runway 24 there… I like to just track those close flights for my own viewing… So the ProPlus receiver is set with a gain of 48, and is also the instance that reports to FA and has MLAT enabled, etc… The Pro receiver has gain set to 20, and is feeding into a desktop instance of VRS and I also have Skyview set up for the 2nd instance of dump1090-fa. This setup works very well for me, as I can combine the outputs from the two into a combined feed of VRS.

What I’d like to do is set up a 2nd independent set of performance graphs for the 2nd instance of dump1090-fa… Can anyone tell me how I could go about doing this?

Thank you
Rick

That’s going to be quite some work no matter how you do it.
To be honest i’m not sure of a good way to display the generated images but anyway i’ll leave you this here so you get an idea of what to do.

The data collection side:
In the file

/etc/collectd/collectd.conf

in the last block after <Module dump1090>
you need to duplicate this subblock:

                <Instance localhost>
                        URL "http://localhost/dump1090"
                </Instance>

Change the instance name from localhost to something else.
Also you need to modify to URL so it points to where you have the webinterface from your second dump1090.
Let’s say you choose localhost2 as an Instance name.

                <Instance localhost2>
                        URL "http://localhost/dump2"
                </Instance>

If you don’t have that yet you need to modify lighttpd to serve that webinterface. (I’ll explain later if you don’t know how to and still want to go ahead)

Second part is creating the images.
In the directory

/home/pi/adsb-receiver/build/portal/graphs

make a copy of make-collectd-graphs.sh
In the copy modify the 2nd last line:

dump1090_receiver_graphs localhost localhost "ADS-B" "$period" "$step"

change the 2nd localhost to localhost2 or what ever you previously named your second instance in collectd.conf

dump1090_receiver_graphs localhost localhost2 "ADS-B" "$period" "$step"

Also you need edit

/etc/cron.d/adsb-receiver-performance-graphs

Basically duplicate the entries so that the copy of the make-collectd-graphs.sh you made is also executed.

Now the pictures will be generated and you need create a webpage to display them.
Honestly i’m not quite sure how to do that.
Maybe the webinterface will just display them? :stuck_out_tongue:
Don’t think so.

It’s a lot of things to do.
Maybe you could just copy the /var/www/html folder and serve it on another port with lighttpd.
Then you could change make-collectd-graphs.sh to write the pictures to the graphs folder of that directory and they should be served.
Could well be that you need to adjust make-collectd-graphs.sh so it names the pictures localhost instead of localhost2

1 Like

Excellent… I was already on the right track – I had gotten as far as changing collectd.conf and adding the 2nd instance in there… I already had modified lighttpd to serve up an interface page at http://ipaddress/dump1090-fa-2, and that instance was dropping /data/stats.json… I did the additional steps you posted above, and that got me the graph images… Then I had to get a 2nd page created that pulled the proper graph files for the 2nd instance… It may not be elegant – but it does seem to work and show me the correct set of data… You’ll notice from my graphs that I’ve been playing around with the gain settings a little bit…Additionally I had previously installed some other tweaks such as the ability to change gain settings on the Skyview page and the modified graph files that show “Messages > -3 dbFM/10 mins” – and those were available on the 2nd instance as well.

This is what else I did in addition to what you had…

cd /var/www/html
sudo cp graphs.php graphs2.php

cd /var/www/html/templates/default
sudo cp graphs.tpl graphs2.tpl

cd /var/www/html/templates/default/assets/js
sudo cp graphs.js graphs2.js

Then edit graphs2.js to change the hostName to the 2nd instance name I added in collectd.conf… I changed localhost in Line 8 to localhost2:

cd /var/www/html/templates/default/assets/js
sudo nano graphs2.js

Then, edited graphs2.tpl to point to the changed graphs2.js:

cd /var/www/html/templates/default
sudo nano graphs2.tpl

This change is in the 2nd to last line in graphs2.tpl:

<script src="/templates/{setting:template}/assets/js/graphs2.js"></script>

I think that is just about all I changed in addition… The graphs for the 2nd instance are available at http://ipaddress_of_pi_/graphs2.php

Thank you so much for your help…
Rick


1 Like

Thank you as well, I wasn’t sure how to modify the web interface portion.
Now i know where to look for the innards of that stuff :slight_smile:

And wow you are quick, i was kinda expecting either
“That’s too involved for my taste”
or some problems along the way :stuck_out_tongue:

On a related note… My primary instance of dump1090-fa is the only instance sending data to FA… I’ve enabled my 2nd instance along with the Skyview map… All of the ports of the 2nd instance were changed from 30xxx to 31xxx in /etc/default/dump1090-fa-2. I would like to view MLAT results on the map of the 2nd instance… I’ve found that this appears to work:

/usr/bin/socat -u TCP:localhost:30105 TCP:localhost:31104

Will this in any way break my MLAT reporting/participation with FA on the primary receiver?

Thanks,
Rick

Why would it?

You are only sending the MLAT results to a dump1090 that isn’t even feeding piaware.
Even if the second dump1090 would be feeding another piaware it wouldn’t be a problem because dump1090-fa won’t forward mlat results anyway.

For anyone interested in running 2 instances of dump1090 with 2 dongles on one RPI:

One Pi, Two Dongles, Two Maps, Two Receivers