You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the array will also include any serial ports that your application currently has open, even if the devices attached to those ports become disconnected. As such, it is important that you always call closePort() on a SerialPort object if it becomes disconnected, which is detectable by inspecting the return values from the various read calls or by registering a SerialPortDataListener for the LISTENING_EVENT_PORT_DISCONNECTED event.
Actual Behavior
If serial port gets disconnected (physically) & connected again while we do have a connection established we will have to ports available in OS. For example /dev/ttyUSB0 & /dev/ttyUSB1.
Steps to Reproduce the Problem
Check how many USB ports are available ls dev | grep ttyUSB
Connect serial port
Connect to port using ModbusSerialMaster
Disconnect port physically and reattach it
Check how many USB ports are available ls dev | grep ttyUSB - there should be 2 more ports allocated
Specifications
Version: 3.2.0
Platform: 12 (bookworm) Raspbian
Subsystem:
The text was updated successfully, but these errors were encountered:
MartynasRim
changed the title
Serial port is left hanging if
Serial port is left hanging in OS if it gets physically disconnected
Nov 20, 2023
Expected Behavior
If serial port is disconnected - lib should listen to LISTENING_EVENT_PORT_DISCONNECTED event and call closePort to prevent hanging serial port reference. More info at - https://fazecast.github.io/jSerialComm/javadoc/com/fazecast/jSerialComm/SerialPort.html#getCommPorts()
Actual Behavior
If serial port gets disconnected (physically) & connected again while we do have a connection established we will have to ports available in OS. For example
/dev/ttyUSB0
&/dev/ttyUSB1
.Steps to Reproduce the Problem
ls dev | grep ttyUSB
ls dev | grep ttyUSB
- there should be 2 more ports allocatedSpecifications
The text was updated successfully, but these errors were encountered: