Skip to content

Parser update for ELRS 4.0 - #18

Closed
sartstark wants to merge 2 commits into
AlfredoSystems:mainfrom
sartstark:main
Closed

Parser update for ELRS 4.0#18
sartstark wants to merge 2 commits into
AlfredoSystems:mainfrom
sartstark:main

Conversation

@sartstark

Copy link
Copy Markdown

Used Claude to update the parser for ELRS 4.0 support. I have tested it with the printAllChannels code and it works

claude and others added 2 commits May 2, 2026 20:49
ELRS 4.0's CRSF rewrite (PR #3198) made every serial frame use 0xC8 as
the sync byte regardless of the original device address, and PR #3429
allowed broadcast frames with zero payload (length byte == 2). The
existing parser rejected len < 3 and only handled ATTITUDE addressed
to RADIO_TRANSMITTER, so attitude telemetry from a 4.0 RX was dropped
and any zero-payload frame would desync the buffer.

- Accept length byte in [2, CRSF_MAX_PACKET_LEN-2] to match ELRS bounds
- Parse ATTITUDE under the FLIGHT_CONTROLLER address (0xC8)
- Add new frame types (AIRSPEED, HEARTBEAT, RPM, TEMP, CELLS,
  FLIGHT_MODE, ELRS_STATUS, DEVICE_PING/INFO, PARAMETER_*, COMMAND)
- Add BLUETOOTH_WIFI and ELRS_LUA addresses
- Use int16_t for the attitude struct (radians * 10000) so negative
  pitch/roll/yaw decode correctly
- Add PACKED to crsfLinkStatistics_t
- Document the ELRS extended-channels status byte appended after
  crsf_channels_t (CRSF_CHANNELS_STATUS_ARMED, ARMING_MODE_CH5)

https://claude.ai/code/session_016ERm16Sii4jtPwP9LcWhrh
Update parser for ExpressLRS 4.0 compatibility
@SaintSampo

Copy link
Copy Markdown
Collaborator

Has this been tested on both ELRS 3.0 and ELRS 4.0?

@sartstark

Copy link
Copy Markdown
Author

I am sorry I forgot to clarify but I tested it only for ELRS 4.0

It is probably better for this to live on a separate branch for now as the parser is not backwards compatible.

I'll look more into this and get something which is backwards compatible as well

@SaintSampo

Copy link
Copy Markdown
Collaborator

I just went through and along with adding 4.0 support, fixed some outstanding bugs/missing features (thanks Claude). Live on main now.

I've tested on ELRS 3.0 and ELRS 4.0 and everything looks good so far. I'm going to give it a few days before pushing the changes live to Arduino as a 2.0.0 release. If you get a chance check out the changes and let me know what you think.

@SaintSampo SaintSampo closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants