Closed piotrg44 closed 2 years ago
That line and error code indicate that some other process on your computer already has an exclusive lock on the serial port, so jSerialComm cannot safely open the port. You can force it to skip this check by calling comPort.disableExclusiveLock()
before calling comPort.openPort()
, but this is just a band-aid, and you may still run into errors unless you find out what other process currently has your port locked.
Thanks, lsof list me a few process locking my serial port. It happen because i terminate application in Eclipse and the process which lock my serial port was not terminated. When i manually kill all of process the exception is gone.
Hi,
This block of code gives me error:
com.fazecast.jSerialComm.SerialPortIOException: This port appears to have been shutdown or disconnected. at com.fazecast.jSerialComm.SerialPort$SerialPortInputStream.read(SerialPort.java:1809) at UsbConnection.Main.main(Main.java:27)
comPort.getLastErrorCode() return -> 11 comPort.getLastErrorLocation() return -> 394
When I check value comPort.isOpen() after comPort.openPort() it always returns false.
crw-rw---- 1 root dialout 166, /dev/ttyACM0 I'm in dialot group in linux
Peter