Parser update for ELRS 4.0 - #18
Closed
sartstark wants to merge 2 commits into
Closed
Conversation
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
Collaborator
|
Has this been tested on both ELRS 3.0 and ELRS 4.0? |
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 |
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. |
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.
Used Claude to update the parser for ELRS 4.0 support. I have tested it with the printAllChannels code and it works