Fazecast / jSerialComm

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

jSerialComm 2.5.2 not working as expected on Windows 10 (1903) #250

Closed hypfvieh closed 5 years ago

hypfvieh commented 5 years ago

I recently updated the used version of jSerialComm in my application from 2.5.1 to 2.5.2. Everything was working fine on my linux development workstation. Testing my application on windows, showed that the serial port communication did not work as is should.

Calling openPort() on the serial port object always returned false, no matter if I increased the sleep time or use the default. Switching back to 2.5.1 and everything was working.

So I started digging into the SerialPort class. I saw that openPortNative() always failed instantly.

When running everything with a debugger and stepping through the extraction and loading of the DLL file,openPortNative() worked again. Disabling class loading breakpoint and not stepping, openPortNative() fails again.

So I'm not really sure what's going on here, but I guess it has something to do with moving the DLL file from temp-root to a temp-subdirectory (seems to be the only related change).

Anyhow, during running or debugging, no exception is thrown or printed on stderr/stdout, so I have no clue why the heck openPortNative() fails (as everything serial port related is done in SerialPort class without any additional threads, a concurrency issue or race condition does not seem to be the cause).

For now I stick to 2.5.1 as this version is working for me on windows. Maybe you have an idea why the newer version fails.

hypfvieh commented 5 years ago

never mind, I found something else which was causing this issue .. don't know why this only happens with the newer version...