diff --git a/mlat/client/coordinator.py b/mlat/client/coordinator.py index 571fb34..8abce02 100644 --- a/mlat/client/coordinator.py +++ b/mlat/client/coordinator.py @@ -162,7 +162,7 @@ def update_aircraft(self, now): self.last_aircraft_update = now def send_aircraft_report(self): - all_aircraft = {x.icao for x in self.aircraft.values()} + all_aircraft = {x.icao for x in self.aircraft.values() if x.messages > 1} seen_ac = all_aircraft.difference(self.reported) lost_ac = self.reported.difference(all_aircraft) @@ -195,6 +195,9 @@ def periodic_stats(self, now): adsb_req = adsb_total = modes_req = modes_total = 0 now = monotonic_time() for ac in self.aircraft.values(): + if ac.messages < 2: + continue + if now - ac.last_position_time < self.position_expiry_age: adsb_total += 1 if ac.requested: diff --git a/modes_reader.c b/modes_reader.c index 039a32e..c7f8b17 100644 --- a/modes_reader.c +++ b/modes_reader.c @@ -1261,9 +1261,14 @@ static int filter_message(modesreader *self, PyObject *o) } if (self->seen != NULL && self->seen != Py_None) { - /* note that we saw this aircraft, even if the message is filtered */ - if (PySet_Add(self->seen, message->address) < 0) { - return -1; + if (message->df == 11 || message->df == 17 || message->df == 18) { + /* note that we saw this aircraft, even if the message is filtered. + * only do this for CRC-checked messages as we get a lot of noise + * otherwise. + */ + if (PySet_Add(self->seen, message->address) < 0) { + return -1; + } } }