Skip to content

Only process/forward MAVLink messages which pass frame check - #3679

Merged
CapnBry merged 1 commit into
ExpressLRS:masterfrom
CapnBry:mavlink-reject
Jun 26, 2026
Merged

CapnBry merged 1 commit into
ExpressLRS:masterfrom
CapnBry:mavlink-reject

Conversation

@CapnBry

@CapnBry CapnBry commented Jun 24, 2026

Copy link
Copy Markdown
Member

Adds a check to incoming and forwarded MAVLink messages to verify they pass CRC and framing requirements before using them.

Details

mavlink_frame_char() returns non-zero any time there is a possible message, including those with bad CRCs or framing characters. Our code takes both of these cases as "good message received" indicators and parse them or forward them to external systems. I believe this can cause output spam to Ardupilot and blow out their receive buffer with garbage until the stream coming OTA resyncs to a valid packet. A user reported this and I suggested this change, after which they tried to PR it and then ghosted me. 👻

We previously (4.0 RC) ran into this problem with force-switching to MAVLink mode on virtually any USB serial input due to how loosely the underlying parser would return that these were MAVLink messages* ("But I said they were invalid messages!!").

I think it is the right thing to do to verify the CRC/Framing before acting on them, like we do with CRSF.

@CapnBry
CapnBry merged commit e95b950 into ExpressLRS:master Jun 26, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants