MLAT on Raspberry Pi Model B, high CPU, problem?

Hi all,

I’m running the latest PiAware on a Raspberry Pi Model B (not the B+ or the Pi 2, though I have a Pi 2 on order). Specifically, I’m using the SD card image. No problems to report: data is being collected and reported exactly as expected.

If I disable MLAT, “top” says the load average is typically around 0.50-0.70 with about 30-50% idle time on the CPU depending on the number of planes being tracked. I’m located in the center of Switzerland, and so can track planes by both the Geneva and Zurich airports. Typically there are 50-70 planes being tracked at any given time during the day.

However, if MLAT is enabled the CPU usage spikes. Even with the Pi overclocked to the “High” (950MHz) level, it’s not uncommon for the CPU to be idling 0% of the time (though there are times where it can get 5-15% idle time), with 45% of the CPU being used by dump1090 and around 30% used by fa-mlat-client. The piaware process uses only a few percent CPU, as do the feeders to FlightRadar24 and Planefinder. Load averages range between 1.20 to 2.00 during the day.

Feeds work normally and MLAT appears to be functioning (several MLAT flights are shown and tracked in the dump1090 web interface), though the CPU certainly seems to be working hard. I was doing some reading on the forum and elsewhere that said that if a receiving system gets bogged down and data packets get lost (for example, due to the CPU being unable to keep up) then it’s not possible to use that data for MLAT.

Is this a problem for the FlightAware system? Does the system detect and ignore bogus data that might be sent from a system struggling to cope with the amount of data being processed? Alternatively, does fa-mlat-client detect if it’s falling behind so it can discard potentially bogus data before sending it to the servers?

It is a problem.

I think I read the PiAware needs to be on the same machine as Dump1090, otherwise it might be good to move DUMP1090 onto another Pi B (keep PiAware where it is since that provided the feed identity, keep the streak going)

Otherwise it’s time to un-box a Pi2

Uh-oh. Hopefully it isn’t a problem in regards to sending bogus data. If so, I’ll just turn off MLAT so as not to cause problems.

I think I read the PiAware needs to be on the same machine as Dump1090, otherwise it might be good to move DUMP1090 onto another Pi B (keep PiAware where it is since that provided the feed identity, keep the streak going)

It would be nice to have the Pi run as a simple data collector and feed data to a system with more computing power, combine the data into one datastream, and then send the processed data off to FlightAware.

Otherwise it’s time to un-box a Pi2

Indeed. That’ll be here in the next week or two. I’m also looking at setting up a receiver/Pi2 combo at the local solar observatory run by a colleague: it’s located at relatively high elevation and has a clear view of the sky in all directions. I’ll do some testing with the existing setup (a NooElec DVB-T dongle with the supplied telescopic antenna) and if it’s particularly good then I’ll see about getting another Pi2, an outdoor antenna, an amplifier, and some extra cable.

The CPU load will just tend to reduce the number of mlat results more than anything, as some of the time you won’t have good clock synchronization.

I hope to rewrite (fa)-mlat-client at some point so it requires less CPU, but that’s not a trivial task as I’ve already squeezed most of what I can out of the Python implementation - it’d need to be a straight C implementation to get much more improvement, and that requires some heavy lifting. So it’s some way down the list.

Ok. That’s fine with me. I don’t mind sending fewer MLAT results when the CPU is busy, so long as the results it does send are valid and won’t break things horribly.

I hope to rewrite (fa)-mlat-client at some point so it requires less CPU, but that’s not a trivial task as I’ve already squeezed most of what I can out of the Python implementation - it’d need to be a straight C implementation to get much more improvement, and that requires some heavy lifting. So it’s some way down the list.

No worries at all. I’m sure there’s plenty more things that are higher priority (thanks for all your work!).

Hello, I have exactly the same problem. I run two Pi’s and sometimes both of them are getting synced with the nearby receivers for some time, sometimes the MLAT support just fails… I know the RPi CPU is the bottleneck, but is there any progress in rewriting the client? Any advice? Something I should try before I’ll be able to collect data on something more powerful? Thanks for any information!

The next iteration of piaware should have a somewhat faster mlat client; but to be honest, it’s probably simpler to just get a current-generation Pi. The Pi 2 has more than enough CPU.

Thank you @obj. Good news to know we’ll have a faster mlat client. And I’ll sure wait for the Pi 3. :slight_smile: I’ve just overclocked both Pi’s to 1000MHz and it seems much better for now. But it’s almost 23.00 here, so the # of messages drops fast with less planes. And I’m curious what will tomorrow’s traffic make during the day.

I have a pi2 and pi3.
The pi2 runs at 20-22% running dump1090 and dump978.
The pi3 runs at 8-10% running the same setup.
I only get 200,000-300,000 position reports per day as the antenna are low to the ground.
This should be fixed soon.

I know a pi1b not plus(2 USB and 256mb ram) that runs 100% cpu because it is in a good location.

both of my RPis (B, rev2, not plus, 512MB RAM, 2 USB ports) are running with CPU load of 85-100% when overclocked to 1000MHz. MLAT works for now. with uptime of 11 hours now the temperature did not exceed 49°C. I hope everything will be okay… and I use USB hubs to power everything up, if someone’s interested in details.

How many aircraft are you guys tracking that fa-mlat-client uses so much CPU? :open_mouth: I am not in the busiest airspace, so for me dump1090 is the CPU gobbler; mlat-client is usually 1/4 of dump1090’s CPU usage, or less.

@BartJr about 1000-1200 adsb and 200-270 mlat aircrafts today. see flightaware.com/adsb/stats/user/LukasLKHK