Closed ar99 closed 2 years ago
I tried with jSerialComm-2.6.2 and it's the same.
Well more info about.
Port is working but in different manner that I expect: Restart VM didn't solve.
First of all, the list of available ports:
SerialPort[] arrayOfSerialPort = SerialPort.getCommPorts();
String[] arrayOfString = new String[arrayOfSerialPort.length];
for (byte b = 0; b < arrayOfSerialPort.length; b++) {
arrayOfString[b] = arrayOfSerialPort[b].getSystemPortName();
System.out.print(arrayOfString[b] + ", ");
}
ttyS0, ttyUSB2, ttyUSB0, ttyUSB3, ttyUSB1, ttyUSB7, ttyUSB5, ttyUSB6, ttyUSB4,
Second: open port:
SerialPort serialPort = SerialPort.getCommPort(port);
serialPort.disablePortConfiguration​();
if (!serialPort.openPort()) {
System.out.println("Could not open port: " + port);
return;
}
**port** **result**
ttyUSB0 Could not open port -> (time in the past this works!!)
ttyUSB1 OK
ttyUSB2 OK
ttyUSB1 OK
ttyUSBx OK
dev/ttyUSB0 OK!
dev/ttyUSB1 OK!
dev/ttyUSB2 OK!
dev/ttyUSBx OK!
So ttyUSB0 don't work but dev/ttyUSB0 yes!
Ask me if you want extra info or printout. Thanks.
That's crazy!: Sometimes work ttyUSB0 instead of dev/ttyUSB0, sometimes opposite!! Anyone can help?
OS - Windows Version - 2.6.2
I am facing similar issue. The improper closing of COM port restricts the java application from re-opening port. Although removing USB and re-plugging it works. Tried JVM Shutdown Hook and added comPort.close()
but still no luck. Anyone having any solution or some other library who handles COM port events.
Please test the attached library version on a non-Windows OS and see if it works any better for you. There have been a ton of recent changes that have not made it into an actual release yet. Thanks!
https://drive.google.com/file/d/1hH2hXCEj39WUN1iz3F1TzLrpNvUro_aL/view?usp=sharing
I will be adding a Windows-enable version for testing soon as well.
Please actually test using this version of the library (all OS's are now enabled): https://drive.google.com/file/d/1QzWPJg5MU_2YrnsB1MsOWeTbjYD84D2h/view?usp=sharing
Solved in release of jSerialComm v2.8.0.
Hi, I am still (with v2.9.1) experiencing the exactly same issue in MacOS apple-silicon. When not properly closing the serial port, I have to re-plug-in to be able to open the port, otherwise the openPort-call never completes. Am I missing anything there or is there still an issue in the library?
@lorenzfb, no this should have all been resolved since 2.8.0. Yours is the first issue since then about this, and I'm unable to replicate myself on a MacBook Pro with Apple Silicon. Would you be able to post a minimal set of code here that causes the issue on your computer? I mainly need to see exactly what configuration and function calls you are using, as well as how you are exiting/ending the program to see if I can reproduce on my end. Also, what type of serial device are you connecting to when this happens? Finally, please include the following line somewhere in your code, just to verify that it is definitely picking up the latest version: System.out.println("\nUsing jSerialComm Library Version v" + SerialPort.getVersion());
Thanks!
Sorry for that, I just figured out, it was a bug on serial device side (RP2040 errata...). Sorry for the wasted effort, but the side effects looked incredibly similar... Thanks anyway, I love your library :-)
On Mon, Jun 13, 2022 at 6:48 PM Will Hedgecock @.***> wrote:
@lorenzfb https://github.com/lorenzfb, no this should have all been resolved since 2.8.0. Yours is the first issue since then about this, and I'm unable to replicate myself on a MacBook Pro with Apple Silicon. Would you be able to post a minimal set of code here that causes the issue on your computer? I mainly need to see exactly what configuration and function calls you are using, as well as how you are exiting/ending the program to see if I can reproduce on my end. Also, what type of serial device are you connecting to when this happens? Finally, please include the following line somewhere in your code, just to verify that it is definitely picking up the latest version: System.out.println("\nUsing jSerialComm Library Version v" + SerialPort.getVersion());
Thanks!
— Reply to this email directly, view it on GitHub https://github.com/Fazecast/jSerialComm/issues/292#issuecomment-1154153200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZTOFPIILG2NF545ONQTVHLVO5Q6PANCNFSM4M4ENQ7A . You are receiving this because you were mentioned.Message ID: @.***>
Hi. Jserialcomm is working fine, I am using jSerialComm-2.6.1.jar but after a program exit without proper closing, afterwards it is impossible to open. The OpenPort () result is negative. The machine has 8 usb ports, but only the one indicated fails. Iterating with the port with another program like minicom works perfectly. I am using a virtualized Ubuntu machine and the only solution I have found is to restart the virtual machine.
Help appreciated