Required packages for running piaware, and more about mlats

GPS is used just to get an accurate location of the antenna in some parts of the world.
Useful for MLAT calculations.

The GPS source on the flightfeeders is incorporated on the ADS-B receiver board in hardware. Then it is useful for MLAT as the 12 MHz BEAST receiver clock can be put in relation to the GPS clock.

The clock source needs to be in the 1090 MHz receiver. Once you have traveled over USB the time that has elapsed while taking that journey is unknown :slight_smile:
And for the USB dongles you have no way to interface with a GPS clock, also they can’t timestamp their samples.

Well it needs a fairly accurate clock for the ADC. For example the rtl-sdr are used with a sample rate of 2.4MHz.
It also needs to be able to tune to frequencies.
For that it has a relatively precise clock, as in some crystal which in the good quality dongles is temperature compensated.

Now this is not a real-time clock, so you don’t know if it is 5 seconds or 10 seconds after the hour.
But the time that elapses between ticks is rather precise.

For example with dump1090-fa the ADC in the receiver (DVB-T/rtl-sdr usb stick) would be generating amplitude readings called samples with a frequency of 2.4 MHz.
So that is the clock that is used in the usual MLAT setup if you are using a Raspberry Pi.

Now the samples are sequentially transferred via USB.
They don’t carry a timestamp but you know the time between two samples is quite precisely 0.416 us.
So once they have been transferred via USB you assign each sample a number that is counted up.

Now the rest is as obj described.
You reconstruct a timeline based on randomly selected ADS-B position messages.
Because of the position you can calculated how long the message has traveled to the receiver.
This message is then just assigned time 0
The server regularly selects such messages to be references.

Based on that you build a time scale.
Relative to that timeline you then tell the server when you received a ModeS message of a plane which needs to be located via multilateration.

The server then calculates a position based on that.

I’m not sure flightaware uses the real time clock at all, even for finding the synchronization messages.
Probably not.

I honestly don’t know how planeplotter does it and why it wants NTP.

2 Likes

Well the timescale has reference ADS-B position messages.

While you don’t know what the time is, you know very precisely the ModeS message arrived 122.4 us after the ADS-B reference message.
You also know how long that reference message traveled to you because you know the position.

So it is actual time synchronization :slight_smile:
You just don’t know when a message arrived in relation to UTC.

But as long as you have a common reference, that is an actual synchronization.
That’s why you can only have synchronization with receivers which can see a subset of your ADS-B planes.

1 Like

great answers ! :+1:

in this age, where everything is…measured :wink: no interface (middle-man) exists
that can measure and display the…‘unknown’ ?
I mean all this about USB latency, which is it constant or sporadic ?

1 Like

MLAT playing hide-and-seek …

https://flightaware.com/adsb/stats/user/abcd567#stats-76000

Are you in sync w/ other nearby receivers consistently?

I’m not sure what you are getting at.

You can build all kinds of cool stuff, USB is just not designed to be in any shape or form synchronous.

Really computers are not designed to have precise latency.
Such accurate timing you need to do at the radio receiver, which is exactly where it is done.
In our case it is just not done with a label, instead it relies on the ordering of the samples.

USB is something like a shipping lane transporting a chopped up high speed train.
You can put the train back together and you also know the wagons were loaded while the train was going exactly xyz mph.
But knowing when wagon 23355 was loaded in relation to wagon 27433 is all you need for MLAT.

Now you better hope the f**** shipping lane didn’t lose a couple of wagons. Because then what you think is wagon 27433 is actually wagon 28222.

That is what is happening here with the virtual machines. USB data is lost.
Not entirely clear why that is the case but it is.

2 Likes

For last 30 minutes or so, yes.

1 Like

What does:

journalctl -u piaware | grep 'Receiver status\|Server status'

tell you?

@curtko
I am away from my Desktop, cant test & tell you. Replying from phone.

1 Like

maybe is just that I expect too much from VM or the 500e host PC which is
outperformed by the humble 30$ Rpi.

again, thanks for your time to answer my questions :grinning:

1 Like

Well -u piaware means journalctl will only produce log entries originating from the “unit” piaware.
Then the output is piped | to grep. Grep will only show you lines which contain either Receiver status or Server status.

In those lines is where “clock unstable” and “synchronized to xyz receivers” is printed.
So it reduces the log to the relevant parts.

1 Like

Thanks. I should have been more specific. I meant that as a question directed to @abcd567 asking him whether his setup is keeping in sync consistently or if it’s just getting lucky sometimes.

Few minutes ago I checked my stats, mlat button is red.

Now you see me, now you dont…

1 Like

I see.

You could always install a linux onto an USB stick from another USB stick while using the EeePC for example.
You could probably install it onto the harddrive but i get the impression you want to keep even that old Windows intact :wink:

Nicely explained here:
Anyone working with the new x86 Raspbian - #232 by abcd567

That way you could use the EeePC for your piaware needs without any VM problems.
(Could well be that the WiFi will not work but maybe you have some ethernet cable)

1 Like

Thanks. Yes, I’m considering trying this next. Actually there is quite a bit of info out there about putting Linux on an Asus Eee PC. It looks a bit daunting and not entirely foolproof. But I don’t mind taking a chance mucking it up, though if I could keep from blowing away Windows on it, that would be nice. I also have an old RPi B+ that I’ve never used. But that’s probably not capable enough.

That’s plenty.
Write piaware to an sd-card and you are all good.

2 Likes

:heart: RPi rocks :heart:

.

1 Like

… and if you must use x64_x86, then

:heart: Raspberry Pi Desktop rocks :heart:

.

2 Likes

Trying to fine-tune my VM setup (piaware running on Ubuntu 16 on VMware Player 6 on WIndows 10 (32-bit) on Asus Eee PC netbook circa 2010 with Atom CPU). Reduced size of VM memory to minimum (512 MB) in order to reduce memory pressure on the host OS (Windows 10). Shutdown all other apps on the laptop. So far, so good. Real test will be if it stays in sync for an extended period of time.

System rebooted overnight. I’ve since turned off automatic updates.

cpk@ubuntu:~$ 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 Wed 2019-03-06 21:32:06 PST; 17min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 775 (piaware)
   CGroup: /system.slice/piaware.service
           ├─ 775 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
           ├─1112 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout
           └─1117 /usr/lib/piaware/helpers/fa-mlat-client --input-connect localhost:30005 --input-type dump1090 --results beast,connect,loc

Mar 06 21:34:16 ubuntu piaware[775]: mlat-client(1117): Beast-format results connection with ::1:30104: connection established
Mar 06 21:37:43 ubuntu piaware[775]: 477 msgs recv'd from dump1090-fa (477 in last 5m); 477 msgs sent to FlightAware
Mar 06 21:42:43 ubuntu piaware[775]: 1123 msgs recv'd from dump1090-fa (646 in last 5m); 1123 msgs sent to FlightAware
Mar 06 21:47:43 ubuntu piaware[775]: 1776 msgs recv'd from dump1090-fa (653 in last 5m); 1776 msgs sent to FlightAware
Mar 06 21:49:15 ubuntu piaware[775]: mlat-client(1117): Receiver status: connected
Mar 06 21:49:15 ubuntu piaware[775]: mlat-client(1117): Server status:   synchronized with 190 nearby receivers
Mar 06 21:49:15 ubuntu piaware[775]: mlat-client(1117): Receiver:   86.3 msg/s received       28.5 msg/s processed (33%)
Mar 06 21:49:15 ubuntu piaware[775]: mlat-client(1117): Server:      0.0 kB/s from server    0.0kB/s TCP to server     0.3kB/s UDP to serve
Mar 06 21:49:15 ubuntu piaware[775]: mlat-client(1117): Results:  1.8 positions/minute
Mar 06 21:49:15 ubuntu piaware[775]: mlat-client(1117): Aircraft: 4 of 6 Mode S, 16 of 16 ADS-B used

● piaware.service - FlightAware ADS-B uploader
   Loaded: loaded (/lib/systemd/system/piaware.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-03-06 21:32:06 PST; 32min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 775 (piaware)
   CGroup: /system.slice/piaware.service
           ├─ 775 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
           ├─1112 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout
           └─1117 /usr/lib/piaware/helpers/fa-mlat-client --input-connect localhost:30005 --input-type dump1090 --results beast,connect,loc

Mar 06 21:49:15 ubuntu piaware[775]: mlat-client(1117): Aircraft: 4 of 6 Mode S, 16 of 16 ADS-B used
Mar 06 21:52:43 ubuntu piaware[775]: 2477 msgs recv'd from dump1090-fa (701 in last 5m); 2477 msgs sent to FlightAware
Mar 06 21:57:43 ubuntu piaware[775]: 3184 msgs recv'd from dump1090-fa (707 in last 5m); 3184 msgs sent to FlightAware
Mar 06 22:02:43 ubuntu piaware[775]: 3800 msgs recv'd from dump1090-fa (616 in last 5m); 3800 msgs sent to FlightAware
Mar 06 22:04:15 ubuntu piaware[775]: mlat-client(1117): Receiver status: connected
Mar 06 22:04:15 ubuntu piaware[775]: mlat-client(1117): Server status:   synchronized with 222 nearby receivers
Mar 06 22:04:15 ubuntu piaware[775]: mlat-client(1117): Receiver:   99.4 msg/s received       26.7 msg/s processed (27%)
Mar 06 22:04:15 ubuntu piaware[775]: mlat-client(1117): Server:      0.0 kB/s from server    0.0kB/s TCP to server     0.3kB/s UDP to serve
Mar 06 22:04:15 ubuntu piaware[775]: mlat-client(1117): Results:  4.1 positions/minute
Mar 06 22:04:15 ubuntu piaware[775]: mlat-client(1117): Aircraft: 3 of 11 Mode S, 10 of 10 ADS-B used
● piaware.service - FlightAware ADS-B uploader
   Loaded: loaded (/lib/systemd/system/piaware.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-03-06 21:32:06 PST; 48min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 775 (piaware)
   CGroup: /system.slice/piaware.service
           ├─ 775 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
           ├─1112 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout 
           └─1117 /usr/lib/piaware/helpers/fa-mlat-client --input-connect localhost:30005 --input-type dump1090 --results beast,connect,loc

Mar 06 22:04:15 ubuntu piaware[775]: mlat-client(1117): Aircraft: 3 of 11 Mode S, 10 of 10 ADS-B used
Mar 06 22:07:43 ubuntu piaware[775]: 4312 msgs recv'd from dump1090-fa (512 in last 5m); 4312 msgs sent to FlightAware
Mar 06 22:12:43 ubuntu piaware[775]: 4736 msgs recv'd from dump1090-fa (424 in last 5m); 4736 msgs sent to FlightAware
Mar 06 22:17:43 ubuntu piaware[775]: 5327 msgs recv'd from dump1090-fa (591 in last 5m); 5327 msgs sent to FlightAware
Mar 06 22:19:16 ubuntu piaware[775]: mlat-client(1117): Receiver status: connected
Mar 06 22:19:16 ubuntu piaware[775]: mlat-client(1117): Server status:   synchronized with 253 nearby receivers
Mar 06 22:19:16 ubuntu piaware[775]: mlat-client(1117): Receiver:   88.2 msg/s received       22.7 msg/s processed (26%)
Mar 06 22:19:16 ubuntu piaware[775]: mlat-client(1117): Server:      0.0 kB/s from server    0.0kB/s TCP to server     0.3kB/s UDP to serve
Mar 06 22:19:16 ubuntu piaware[775]: mlat-client(1117): Results:  8.2 positions/minute
Mar 06 22:19:16 ubuntu piaware[775]: mlat-client(1117): Aircraft: 8 of 12 Mode S, 10 of 10 ADS-B used
● piaware.service - FlightAware ADS-B uploader
   Loaded: loaded (/lib/systemd/system/piaware.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-03-06 21:32:06 PST; 1h 3min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 775 (piaware)
   CGroup: /system.slice/piaware.service
           ├─ 775 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
           ├─1112 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout
           └─1117 /usr/lib/piaware/helpers/fa-mlat-client --input-connect localhost:30005 --input-type dump1090 --results beast,connect,loc

Mar 06 22:19:16 ubuntu piaware[775]: mlat-client(1117): Aircraft: 8 of 12 Mode S, 10 of 10 ADS-B used
Mar 06 22:22:43 ubuntu piaware[775]: 5911 msgs recv'd from dump1090-fa (584 in last 5m); 5911 msgs sent to FlightAware
Mar 06 22:27:43 ubuntu piaware[775]: 6485 msgs recv'd from dump1090-fa (574 in last 5m); 6485 msgs sent to FlightAware
Mar 06 22:32:43 ubuntu piaware[775]: 7059 msgs recv'd from dump1090-fa (574 in last 5m); 7059 msgs sent to FlightAware
Mar 06 22:34:16 ubuntu piaware[775]: mlat-client(1117): Receiver status: connected
Mar 06 22:34:16 ubuntu piaware[775]: mlat-client(1117): Server status:   synchronized with 206 nearby receivers
Mar 06 22:34:16 ubuntu piaware[775]: mlat-client(1117): Receiver:   97.3 msg/s received       23.1 msg/s processed (24%)
Mar 06 22:34:16 ubuntu piaware[775]: mlat-client(1117): Server:      0.0 kB/s from server    0.0kB/s TCP to server     0.3kB/s UDP to serve
Mar 06 22:34:16 ubuntu piaware[775]: mlat-client(1117): Results:  3.9 positions/minute
Mar 06 22:34:16 ubuntu piaware[775]: mlat-client(1117): Aircraft: 5 of 10 Mode S, 9 of 9 ADS-B used
cpk@ubuntu:~$ journalctl -u piaware | grep 'Receiver status\|Server status'
Mar 06 21:49:15 ubuntu piaware[775]: mlat-client(1117): Receiver status: connected
Mar 06 21:49:15 ubuntu piaware[775]: mlat-client(1117): Server status:   synchronized with 190 nearby receivers
Mar 06 22:04:15 ubuntu piaware[775]: mlat-client(1117): Receiver status: connected
Mar 06 22:04:15 ubuntu piaware[775]: mlat-client(1117): Server status:   synchronized with 222 nearby receivers
Mar 06 22:19:16 ubuntu piaware[775]: mlat-client(1117): Receiver status: connected
Mar 06 22:19:16 ubuntu piaware[775]: mlat-client(1117): Server status:   synchronized with 253 nearby receivers
Mar 06 22:34:16 ubuntu piaware[775]: mlat-client(1117): Receiver status: connected
Mar 06 22:34:16 ubuntu piaware[775]: mlat-client(1117): Server status:   synchronized with 206 nearby receivers
1 Like