Fazecast / jSerialComm

Platform-independent serial port access for Java
GNU Lesser General Public License v3.0
1.34k stars 287 forks source link

Very slow reading data #355

Closed gustavo-reis-wogen closed 3 years ago

gustavo-reis-wogen commented 3 years ago

Hello. I'm testing the library and in my tests I managed to write and read the same data very low for my reality, I managed to send and receive the same message 62 times within 1 second. I'm doing the test as follows, I send a message and wait for it to arrive before I can send it again. Without the use of serial ports I got more than 5,000 rounds, with the use of the serial only 62 per second. I implemented the timeout as 0 and nothing changed, is this normal? Because in Delphi, for example, using a library for their serial, I was able to send and receive the same message 2000 times per second with the same test.

gustavo-reis-wogen commented 3 years ago

I ended up solving the problem, it was actually a latency timer FTDI driver setting which was by default at 16 milliseconds, I switched to 1 and everything worked as expected. Fact is, in software made in Delphi, for some reason their serial library ignores this value, it can be up to 255 latency that it will work with 0, maybe it would be a new feature that this library could also have that would be to ignore this serial port latency timer.

zhupengfeivip commented 1 year ago

Thank you very much. Your plan is very useful to me and helps me a lot.