Fix LD2450 buffer overflow during initialization#42
Merged
TrevorSchirmer merged 1 commit intoApolloAutomation:betafrom Feb 14, 2026
Merged
Conversation
WalkthroughIncreases the UART receiver buffer size for the LD2450 sensor integration from its default to 1024 bytes in the ESPHome core configuration file, addressing a data reception issue causing detection drops. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Increase UART rx_buffer_size from 256 to 1024 bytes to prevent buffer overflow during boot sequence. The LD2450 sends ~750 bytes during the 2-second dump_config() block, which overflows the default 256-byte buffer and corrupts initialization commands. Fixes random detection failures reported in esphome/esphome#13956
b3bed43 to
515f5a3
Compare
bdraco
approved these changes
Feb 13, 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.
Summary
Adds
rx_buffer_size: 1024to the uart_ld2450 configuration to prevent buffer overflow during device initialization.Problem
The LD2450 sensor randomly stops detecting after several hours of operation. Root cause analysis (esphome/esphome#13956) revealed:
Solution
Increase rx_buffer_size to 1024 bytes to accommodate data accumulation during boot sequence.
Testing
Fixes esphome/esphome#13956
Summary by CodeRabbit