Give MAC-less feeds a distinct UID instead of a shared placeholder - #9
Merged
Conversation
Serial/MAVLink receivers (DroneScout Bridge, SiK) report no MAC at all,
so a Location- or System-only message from one has neither a MAC nor a
serial to identify it and rendered under the shared placeholder
Unknown-BasicID_0. Measured live on a DroneScout Bridge feeding
dronecot-dronescout: 57 correctly identified events alongside 3
placeholders, and the placeholder collides across every such source.
_rid_identity() now falls back to the feed/sensor id (FEED-<sensor_id>)
before the placeholder, so unidentified contacts from different receivers
stay distinct instead of piling onto one track.
Deliberately NOT keyed on the feed for AGGREGATION. I tried that first
and it is wrong twice over:
* It SPLITS rather than merges -- a BasicID message keys on the serial
while a Location message from the same aircraft keys on the feed, so
they land in two tracks and neither completes. Verified: track_key
gave ('rid','SERIAL9') and ('feed','dronescout') for one transmitter.
* Worse, it would MERGE DISTINCT AIRCRAFT. One DroneScout receiver
reports many drones over a single port, so a feed key would collapse
them into one track -- exactly the bug this module was written to fix,
reintroduced by another route.
So a record with neither MAC nor serial still passes through
unaggregated; only its rendered UID changes. track_key() carries a
comment explaining why the tempting fallback is absent, and a test
asserts it stays absent.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0197da7dhvcPoHxYKamrYqyM
ASTM F3411 accuracy fields are ENUM CODES; CoT <point ce= le=> are
metres. Emitting the raw code claimed a precision the aircraft never
reported, and the worst case inverted the meaning entirely: code 0 means
"unknown / >= 18.52 km" but rendered as ce="0", a PERFECT fix.
Observed live on a DroneBeacon DB120: HorizAccuracy=9 (ODID < 30 m) was
drawn on the map at 9 m -- 3.3x better than reported -- and
BaroAccuracy=0 (unknown) as zero error.
Codes now decode to metres via tables mirroring
decodeHorizontalAccuracy()/decodeVerticalAccuracy() in
opendroneid-core-c. Each code is an upper bound ("less than X") so X is
the conservative reading. Unknown (0), reserved, unparseable and missing
values all emit the CoT unknown sentinel rather than a fabricated number.
Also: <height value> defaulted to 0, rendering an absent altitude as sea
level. It now uses the same unknown sentinel as hae/ce/le.
Four existing tests in test_functions.py asserted the raw codes
(ce="12", le="5") and so encoded the bug; corrected to the decoded
metres (1.0 m and 3.0 m, from ODID_HOR_ACC_1_METER and
ODID_VER_ACC_3_METER).
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0197da7dhvcPoHxYKamrYqyM
This was referenced Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the remaining
Unknown-BasicID_0case, measured on live hardware.The problem
Serial/MAVLink receivers (DroneScout Bridge, SiK) report no MAC at all, so a Location- or System-only message from one has neither a MAC nor a serial to identify it, and rendered under the shared
Unknown-BasicID_0placeholder — which collides across every such source.Measured on a DroneScout Bridge feeding
dronecot-dronescout, watching Mesh SA:The fix
_rid_identity()falls back to the feed/sensor id (FEED-<sensor_id>) before the placeholder, so unidentified contacts from different receivers stay distinct instead of piling onto one track.What I tried first, and why it is not here
My initial approach was to key aggregation on the feed when no MAC or serial exists. It is wrong twice over, and I only found out by testing it:
1. It splits rather than merges. A BasicID message keys on the serial while a Location message from the same aircraft keys on the feed — two tracks, neither completing:
2. Worse, it would merge distinct aircraft. One DroneScout receiver reports many drones over a single port, so a feed key would collapse them into one track — exactly the bug this module was written to fix, reintroduced by another route.
So a record with neither MAC nor serial still passes through unaggregated; only its rendered UID changes.
track_key()now carries a comment explaining why the tempting fallback is deliberately absent, and a test asserts it stays absent:Tests
66 pass, zero warnings. New cases cover the feed-derived UID, two receivers staying distinct, serial still winning over feed, MAC still winning over both, and the negative assertion above.
🤖 Generated with Claude Code
https://claude.ai/code/session_0197da7dhvcPoHxYKamrYqyM