fix: prevent ESP32 KISS modem stalls under USB backpressure - #2819
Conversation
|
What do you think about this solution, @agessaman? I didn't want to butcher your branch/PR, so I made it a separate one. If we end up going with this approach, all the credit goes to you since you brought up the idea in the first place. Happy to add you as a co-author as well. It's a bigger change in terms of LOC, but with KISS gaining popularity, I think it makes sense to make it as resilient as possible. Most of the changes in this PR are test related anyway. If you filter on the three files under I've tested it both in code and on hardware, but if you get a chance to do the same and give it a try, it can get merged a bit quicker. |
|
In case this one gets merged, it might need a change on your side too or not? @rightup |
|
Thanks, @agessaman |
|
Sorry I didn't see this earlier. I'm vacationing at the moment and haven't been giving my email much time. I gave it a skim and I don't have any additional thoughts. Users will definitely appreciate being able to use those devices. |
|
Would be great if this one could go through @liamcottle @ripplebiz 💯 It doesnt affect many devices; but the devices it does (Heltec v4 for example) are probably amongst the most popular ones for this purpose. |
879037b to
03d1c09
Compare
Switch ESP32-S3 KISS modem environments to HWCDC and move outbound KISS writes to a non-blocking queued frame path so loop() and TX completion keep progressing when the host reads slowly. Add native backpressure regression tests and correct the native_kiss_modem test filter so this suite runs directly with pio test.
The new test_kiss_modem suite needs KissModem headers and sources that only native_kiss_modem provides. Scope native to test_utils and run both envs in the unit test workflow.
setTxTimeoutMs() and setTxBufferSize() are HWCDC-only APIs; calling them on HardwareSerial (UART-bridge boards like T-Beam) fails to compile. Co-Authored-By: Adam Gessaman <adam@gessaman.com>
03d1c09 to
3b69e78
Compare
|
Been running this for a while now; as stable as it gets. 💯 |
Epic! Thanks for your work on this :) |
Upstream commits: - e780cca Merge pull request meshcore-dev#3033 from liamcottle/board/lilygo-tbeam-sx1276 - 520fa77 increase tbeam sx1276 max group channels from 8 to 40 - d531a98 Merge pull request meshcore-dev#2819 from ViezeVingertjes/fix/kiss-modem-usb-backpressure - 3b69e78 fix: guard HWCDC serial config behind ARDUINO_USB_MODE - 39ff5b8 fix: run KISS modem unit tests in CI via native_kiss_modem env - fb2c61f fix: prevent ESP32 KISS modem stalls under USB backpressure Clean auto-merge (no conflicts). MQTT additions preserved. Affected files: 17 (KISS modem backpressure, T-Beam SX1276 channels, variant INIs)
Switch ESP32-S3 KISS modem environments to HWCDC and move outbound KISS writes to a non-blocking queued frame path so loop() and TX completion keep progressing when the host reads slowly. Add native backpressure regression tests and correct the native_kiss_modem test filter so this suite runs directly with pio test.
Also should resolve #2646
write()blocks →loop()permanently wedgedloop()keeps running