Repository navigation
Fix flow_control: "software" enabling RTS/CTS instead of XON/XOFF - #758
Merged
Merged
Conversation
Since #595, `uart._connect` treated every non-`None` `flow_control` value as hardware flow control, so `"software"` opened the serial port with `rtscts=True`. This was harmless as long as the USB-serial driver ignored `CRTSCTS`, but Linux 6.14 added real RTS/CTS support to the `ch341` driver, and CH340-based adapters running software-flow-control firmware (e.g. Elelabs ELU013/ELR023) now time out during the ASH reset because the bridge waits for CTS. Map `"software"` to XON/XOFF and only enable RTS/CTS for `"hardware"`. `None` keeps XON/XOFF enabled, as before. Assert the resulting serial port flags in the UART connect test and fix the CLI help text.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #758 +/- ##
==========================================
- Coverage 99.55% 99.55% -0.01%
==========================================
Files 64 64
Lines 4284 4282 -2
==========================================
- Hits 4265 4263 -2
Misses 19 19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
puddly
reviewed
Sep 28, 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.
Fixes #752, and the
"software"mapping reported in #709.uart._connect()derives the serial port flags withif flow_control is None: XON/XOFF else: RTS/CTS, so"software"selects hardware flow control. This regressed in #595 (0.37.0) when bellows moved to zigpy's device schema: the old check was== CONF_FLOW_CONTROL_DEFAULT, and that default was"software", so"software"did mean XON/XOFF – and being the schema default at the time, it is still stored in a lot of long-lived EZSP config entries.It stayed invisible on CH340 adapters because the Linux
ch341driver ignoredCRTSCTSuntil 6.14 (commit 35478bc369a6); HAOS 18.x ships 6.18. CH340-based adapters running software-flow-control firmware (Elelabs ELU013/ELR023) now fail the EZSP reset: theRSTframe is accepted by the kernel but apparently never transmitted, most likely because the bridge waits for CTS, which nothing on this firmware drives. Full analysis in #752."software"now meansxonxoff=True, rtscts=False, and only"hardware"enables RTS/CTS.Noneis unchanged; whether it should mean "no flow control" (as #709 suggested) is a separate decision.Anyone storing
"software"for an adapter that really does use RTS/CTS firmware reverts to the pre-0.37.0 XON/XOFF behaviour, as does the CLI, whose--flow-controldefault issoftware(its help text also claimed "use hardware flow control" and is corrected). The UART connect test now asserts the flags for all three values; the"software"case fails ondev.