FlightAware Discussions

PiAware: Mach no longer in the aircraft.json file

The dump1090-fa aircraft.json no longer includes the aircraft mach data using PiAware 4.0

Anyone no how to calculate aircraft speed and from what JSON data category when I open the aircraft.json file?

Thanks

I haven’t checked the code but i would doubt that.

Mach is only sent by aircraft when queried by ATC and equipped to transmit it.
Are you sure it’s not that?

I’m sure. I’ve been accessing the aircraft.json file on my Raspberry Pi for years and logging specific aircraft data including an aircraft’s speed, calculated from an aircraft’s mach. The JSON used to refer to the speed as “speed” but it was changed to “mach” months ago. Any thoughts or help would be appreciated. I’m including a screenshot of a JSON that includes mach. Thanks

It was changed from speed to gs for ground speed, but very very long ago.

Also that screenshot shows mach in the json.
What does your current json look like?

        if (trackDataValid(&a->mach_valid))
            p = safe_snprintf(p, end, ",\"mach\":%.3f", a->mach);

https://github.com/flightaware/dump1090/blob/master/net_io.c

I don’t see why it wouldn’t output mach if it’s received.
So now that i’ve looked at the code i’m quite sure the current dump1090-fa version outputs mach in the json.

There were no changes to this in 4.0.

As wiedehopf says, it’ll still output Mach number if that data is received, and that data will only be received if there is a SSR querying for EHS parameters (and the transponder supports EHS)

edit: I see that you are located in the US. Most US SSRs (with a few exceptions) do not interrogate for EHS. You can see this on the “Weather” layer of https://flightaware.com/adsb/coverage#data-coverage (the weather data we collect depends on EHS data). Looks like you are near the edge of one of the few radars that do, but maybe the radar parameters have changed recently.

Thanks for your help. After a manual dump 1090 upgrade (again), the mach data is showing up in the JSON file.

After manually upgrading dump 1090 again, the category of “mach” is now showing back up in the JSON file. I’m not sure what occurred but my Python code is not failing on me, so that makes me happy. Yes, I’m located in the US about 20 miles south of Boston. Thanks again for the help.

Do you have some weird configuration making fr24feed or something install dump1090-mutability?
I would expect you would notice as /dump1090-fa shouldn’t be working anymore.

Anyhow can’t really imagine how you could have something working with /dump1090-fa and not have the mach.
Which leads me to believe it’s probably just luck that’s it’s being interrogated for again.

If you need something reliably sent by aircraft, use gs as in ground speed, not mach.
I’m not sure what exactly you’re doing of course, it’s not a replacement in itself but quite a different metric.
Also your code shouldn’t fail entirely just because a field is missing.

for ac in aircraft:
    if 'mach' in ac:

You’re probably iterating over the aircraft list called aircraft in the json.
Using mach should be behind such an if condition.

Thanks for the code. I wrote something similar for other fields and added it for mach as well.