Fazecast / jSerialComm

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

Stopped working after 2.9.3, no data can be read #539

Open lolhol opened 10 months ago

lolhol commented 10 months ago

Hi.

Was there some breaking change (except the one mentioned in the release) that could break the library usage between 2.9.3 and 2.10.0? It looks like 2.10.0 stopped receiving any data in my configuration (in VMWare Fusion installed Linux working with /dev/ttyUSB0). I tried to use strace to figure out the issues, but I couldn't find anything suspicious.

Screenshot 2024-01-01 at 10 50 36 PM

Here is a full screencast: https://streamable.com/schhu0

TL;DR:

In 2.9.3:

Screenshot 2024-01-01 at 10 47 28 PM

it works (and also, pyserial works too, it's able to send/receive data, so it's not about the device):

Screenshot 2023-12-30 at 10 57 42 PM

But starting from 2.10.0:

Screenshot 2024-01-01 at 10 48 47 PM

it stops receiving (and maybe sending?) data:

Screenshot 2023-12-30 at 10 57 08 PM
hedgecrw commented 10 months ago

No, there shouldn't be any breaking changes between 2.9.3 and the 2.10.X series. Just to verify, have you tried using the most current release (2.10.4), or have you just tested 2.10.0?

lolhol commented 10 months ago

Hi!

Firstly, sorry for the late response. Yes, I have started at that version and, seeing that something is broken, started experimenting.

Thanks!

TMSSassen commented 7 months ago

Hey lolhol, perhaps stupid question, but have you tried restarting your virtual machine? I had the oddest issue with JSerialComm not reading data after opening an outputstream / writing data for the first time (so before any call to getOutputStream() it received data events, but if I tried sending anything to my arduino I would never receive incoming data again). Tried a few different versions via Maven, had the same problem with all of them.

But now (a few days later) somehow I can't reproduce that behaviour anymore, and now everything works fine. I can send / read data no problem. Only thing I can think of that could've changed was that I rebooted my computer in between.

hedgecrw commented 6 months ago

Just curious if a restart resolved this issue for the original poster (or upgrading to 2.11.X). I can't see any reason why this would have stopped working after 2.9.3, but we can try to debug if the issue still persists.

phillipscheng commented 4 months ago

Perhaps related to https://github.com/Fazecast/jSerialComm/issues/562?

emilm commented 3 months ago

It stopped receiving data for me as well all of a sudden. I see in the native code that datetime functions are used to measure time. This is unreliable as the NTP server can shift the time during a wait. I suggest using a wall clock (stop watch).

https://github.com/Fazecast/jSerialComm/blob/master/src/main/c/Posix/SerialPort_Posix.c#L950