MAVLink: support mavlink 2.1 32 bit system IDs - #33734
Open
tridge wants to merge 21 commits into
Open
Conversation
tridge
force-pushed
the
pr-mavlink32bitsysid
branch
from
July 15, 2026 21:26
51c0de0 to
b5cd14b
Compare
tridge
force-pushed
the
pr-mavlink32bitsysid
branch
3 times, most recently
from
July 15, 2026 23:42
c7f01f7 to
76eb4fc
Compare
ntamas
reviewed
Jul 17, 2026
tridge
force-pushed
the
pr-mavlink32bitsysid
branch
2 times, most recently
from
July 18, 2026 07:57
8c631c4 to
b45972c
Compare
the component was compared against last_src_system, so chunked statustexts from different components on the same system were joined together.
Widen system ID handling throughout for MAVLink2.1 32 bit system IDs (mavlink/rfcs#20): - MAV_SYSID, MAV_GCS_SYSID and MAV_GCS_SYSID_HI become AP_Int32 with parameter width conversion. Values must stay below 2^24 until the parameter transport moves away from float32 - routing table entries, get_targets() and find_by_mavtype use the mavlink_msg_get_target_sysid/compid helpers so targets in the extended header are honoured - packet_overhead_chan() conservatively reserves the extended header - TSYN and MAVC log the full 32 bit source and target system IDs
Widen gimbal and target sysid storage and pass 32 bit targets via the extended header aware send path. MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE accepts a controller sysid up to 2^24-1, the largest a float command parameter can carry exactly.
Widen source/target system IDs in the MAVC log message and the MAVLink log transfer target. Write_Command() takes the target from the caller, as the packet's target_system byte is zero when the target travelled in the extended header.
FOLL_SYSID becomes AP_Int32 with parameter width conversion. Values must stay below 2^24 until the parameter transport moves away from float32. The conversion runs from the vehicle's load_parameters() as mode entry at startup can read the parameter.
Widen the CAN forwarding requester system ID so replies to a 32 bit GCS are not aliased.
Widen the recorded Loweheiser source sysid so the source-match guard and the commands we send back are not truncated. The LOEC log SI field widens to uint32 to match.
The basic ID packet is sent as a raw struct, so there is no extended header available for a target sysid over 255; clamp to zero as we do elsewhere rather than silently truncating.
The ADSB, SoloGimbal, MAVLink gimbal v2 and camera v2 simulators truncated the vehicle sysid they learn from its heartbeat, matched commands against the payload target byte (which is zero when the target travels in the extended header), and addressed replies through payload structs. The simulated heartbeats are also serialised properly rather than writing the mavlink_message_t memory as wire bytes, which is no longer the wire layout now that sysid is 32 bit.
Writing len bytes from &msg.magic assumed the mavlink_message_t header matched the wire format. With a 32 bit sysid the struct header is 3 bytes longer than a small-sysid wire header, so the frame was shifted and lost its last 3 bytes, including the CRC.
Reboots with MAV_SYSID 100000, checks the SYSID32 extended header is used, fetches parameters from a source system over 255, and runs mission upload and arming checks at the new sysid.
Accept 32 bit sysids in MAV_CMD_DO_FOLLOW and convert the Follow parameters at load time.
Convert the Follow parameters at load time, before mode entry can read FOLL_SYSID.
tridge
force-pushed
the
pr-mavlink32bitsysid
branch
from
July 27, 2026 21:38
b45972c to
9cd18bc
Compare
Contributor
Author
|
Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting. Review verdict: COMMENTA large but carefully staged change (one commit per subsystem, submodule bump isolated, parameter conversions complete). The blocking item is external: the Findings
Generated from an automated review of all PRs labelled |
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.
Summary
Implements 32 bit system IDs
See also:
Classification & Testing (check all that apply and add your own)
Description
This implements mavlink/rfcs#20 but with 32 bit system IDs to allow for IPv4 addresses to be used for system IDs. This should make large drone light shows easier.
I also plan on making full 32 bit integers work with mavlink parameters to make this more practical for real IPv4 addresses. That will be a separate effort. For now this PR is really 24 bit sysid support, but once we get the mavlink param change in it will work with 32 bit
Some open questions:
Testing done both in SITL and on a fixed wing (bixler) at Spring Valley
Note on MAVLink peripherals
Setting
MAV_SYSIDabove 255 means all packets are incompatible with older mavlink2 implementations. That means all packets to older peripherals will be dropped. We could add pre-arm checks in the future if this turns out to be an issue.