UART.read() times-out twice as fast on latest version compared to earlier versions #18456
Replies: 4 comments 3 replies
-
|
It's the opposite: a bug related to |
Beta Was this translation helpful? Give feedback.
-
|
@robert-hh thanks for the quick response! As soon as we saw this problem, we tried setting I looked at the 1.26.0 and 1.25.0 release notes to try to find the commit and PR to which you refer and found 155fa94 (#17135) and 2c2f0b2 (#17265) but neither seem to contain bugfixes for UART If it's easy for you to find, could you please provide the PR and/or commits which made the changes to mentioned? Test Results |
Beta Was this translation helpful? Give feedback.
-
|
The change happened with this PR: #17938 I just re-tested the behavior with the script below (and the result). The behavior looks fine. |
Beta Was this translation helpful? Give feedback.
-
|
@robert-hh Hi, I just stumbled across this discussion and thought I'd try it out on the RP2 with 1.26.1 Using your example I get this result. Do you know if the RP2 and other ports will be corrected too? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've just upgraded one of my ESP32-WROVER devices from 1.14 to 1.26.1 and noted that
UART.read()began returning incomplete data, i.e. the remainder of the data was present in the serial buffer afterUART.read()returned.I performed a rough experiment to estimate what I understand would be the inter-character timeout
timeout_charby reading a serial buffer containing either 0 bytes or pre-populated with 9 bytes. The elapsed time should be dominated by the timeout value. Sure enough, there's a big difference between 1.14 and 1.26.1:This would appear to be the cause of the problem and suggests a bug in the MicroPython UART class.
I'm open to suggestions on tracking-down the problem in the source code and working around the problem - preferably without implementing the UART
read()andreadline()method functionality in my MicroPython code.Technical Detail
The UART object is constructed with:
And, while I've tried setting
timeout_char, it shows similar unexpected behaviour totimeoutwhich I previously reported. My test function to be called on the REPL is:Beta Was this translation helpful? Give feedback.
All reactions