NeuronRobotics / nrjavaserial

A Java Serial Port system. This is a fork of the RXTX project that uses in jar loading of the native code.
Other
344 stars 142 forks source link

Sometime `NRSerialPort.connect()` never returns after device was rebooted #221

Open gillesB opened 2 years ago

gillesB commented 2 years ago

Hello,

I am maintaining an automated test environment, which tests devices, which are using PEI as their serial interface. One of the tests sends an AT-command to reboot the device and measures the time till it is ready for usage.

With nrjavaserial 5.2.1 on (X)Ubuntu 20.04 64-bit and Java 17 (Corretto 17.0.2.8.1) this test fails about every 100th time (it seems to be every 73, sometimes 74 time). The problem is that in these cases NRSerialPort.connect() never returns, after the device was rebooted.

Because the behaviour did not occur on our older setup (Windows 7 32-bit and Java 7) with nrjavaserial 3.15.0, I downgraded the newer setup from 5.2.1 to 3.15.0.

This now looks better from 1200 reboot tests only one got stuck. (I will update the numbers after the weekend.)

Update:

Update after weekend: