You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Same problem happens as PR #61 (branch: ams/fix-read-methods). I meet some strange problems. I've made couple tests:
A. send binary data (such .jpg ) to serial A Tx, which connect to serial B Rx
B . send binary data (such .jpg ) to serial A Tx, which connect to serial A Rx
The function readuntil() (read() or nonblocking_read() in branch: ams/fix-read-methods) from Rx port (for both A and B test) will lose one byte every 1023 bytes received, or lose the last byte if I send less than 1024 bytes.
For example, If I send 1024 bytes (raw) to Tx, I got 1023 bytes from Rx port.
If I send 2048 bytes to Tx, I got 2046 bytes from Rx port !
If I send 100 bytes to Tx, I got 99 bytes from Rx port !
This strange problem happens no matter how much baudrate I set, e.g, 115200,921600.
BTW: The software cutecom test binary file send and receive without any problem for above hardware setup !
If I send a pure text file (all ASCII) to Tx, the above problem is gone!
[new test] function sp_blocking_read() : SAME problem: lose one byte every 1023 bytes received, or lose the last byte if less than 1024 bytes was sent !
The text was updated successfully, but these errors were encountered:
touchft
changed the title
lose data when read binary data as String !
lose data when read binary data !
Jul 9, 2020
In fact, when I turn off all flow control, the problem is gone ! When open serial, we has default attributes: RTS SP_RTS_ON and DTR SP_DTR_ON. Use set_flow_control() to turn off these two attributes so that we will remove above problems.
Suggestion: How about we take SP_RTS_OFF and SP_DTR_OFF as default ? Cutecom set these two off as default.
Same problem happens as PR #61 (branch: ams/fix-read-methods). I meet some strange problems. I've made couple tests:
A. send binary data (such .jpg ) to serial A Tx, which connect to serial B Rx
B . send binary data (such .jpg ) to serial A Tx, which connect to serial A Rx
The function
readuntil()
(read() or nonblocking_read() in branch: ams/fix-read-methods) from Rx port (for both A and B test) will lose one byte every 1023 bytes received, or lose the last byte if I send less than 1024 bytes.For example, If I send 1024 bytes (raw) to Tx, I got 1023 bytes from Rx port.
If I send 2048 bytes to Tx, I got 2046 bytes from Rx port !
If I send 100 bytes to Tx, I got 99 bytes from Rx port !
This strange problem happens no matter how much baudrate I set, e.g, 115200,921600.
BTW: The software cutecom test binary file send and receive without any problem for above hardware setup !
If I send a pure text file (all ASCII) to Tx, the above problem is gone!
[new test] function
sp_blocking_read()
: SAME problem: lose one byte every 1023 bytes received, or lose the last byte if less than 1024 bytes was sent !The text was updated successfully, but these errors were encountered: