Closed jocelynke closed 4 years ago
Hi,
thank you for reporting the issue.
Let me explain the problem here: With a multi threading system you could just have one thread reading and providing the buffer to the main thread, while here there's no multi threading and when you write the process will start reading and then it waits for the other endpoint to finish writing.
This is fine, except for the fact that sometimes pyserial, which is used by ATtila to interface with serial devices, says there's nothing to read and the read returns. The timeout indeed is only used when no data has been read.
The last fix, improved a lot the performance, but in many cases it missed the bytes. This happens especially when using a low baud rate (such as 9600 indeed).
I've managed to fix this issue, but yep, the performance is lower. Still fast, but not superfast. The problem is that I want to guarantee my read function to wait for the endpoint to finish, but this involves delays, which are annoying. In my opinion it's not too slow, and should be fine. I don't think I want to make other fixes for this issue, since here I can choose between:
If you want to give it a try, there's a patch 1.1.5.
Let me know if it's ok for you.
OK thanks for the explanation. I will give it a try!
Describe the bug I often get bad response to the same command :
To Reproduce Run the following code
Expected behavior No exception since the command is correct and a timeout of 5 seconds should be sufficient. The sleep(1) makes sure to not run too many commands.
Desktop: