fu-tyan / java-simple-serial-connector

Automatically exported from code.google.com/p/java-simple-serial-connector
0 stars 0 forks source link

Method name - openPort(); Exception type - Port busy. #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I get Method name - openPort(); Exception type - Port busy.

This exception is not documented.  How do I recover from this?  I cannot close 
the port either.

Original issue reported on code.google.com by justm...@gmail.com on 23 Mar 2012 at 2:02

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Please, give me more information about this situation. Your OS, jSSC version, 
and code example where you have this problem.

Then you have "Port busy" exception, it's mean that jSSC can't get serial port 
handle. In jSSC-0.8 you can get this exception in 2 situations: if port not 
exist or if port really busy. In jSSC-0.9 this exception you can get only then 
port really busy, and if port not found "Port not found" exception will be 
thrown.

Original comment by scream3r.org@gmail.com on 4 Apr 2012 at 4:15

GoogleCodeExporter commented 9 years ago
Hi, I got almost the game issue when reloading the applet in browser. Every 
time, I have to close the browser and got the program reloaded and run in 
normal way. I wonder if there is any other means to kill the previous process 
and get the serial port resume normal.

I have already tried to close the serial port when catching serial port error. 
Of course, it doesn't work.

Anyway to sort it out?

Original comment by ngk...@gmail.com on 19 Apr 2012 at 4:24

GoogleCodeExporter commented 9 years ago
Same issue here for virtual ports....

Original comment by luis.m...@gmail.com on 30 May 2012 at 5:40

GoogleCodeExporter commented 9 years ago
+ info
I use isOpened() first, try to closeport() if open,
but is not open....

Situation is that jSSC can't get serial port handle after open it for the first 
time

Using in windows 7 64 bits with virtual ports

Original comment by luis.m...@gmail.com on 30 May 2012 at 5:43

GoogleCodeExporter commented 9 years ago
The

return serialInterface.writeBytes(portHandle, buffer);

Doesn't return....

Original comment by luis.m...@gmail.com on 30 May 2012 at 5:46

GoogleCodeExporter commented 9 years ago
Hi, have the same issue on Mac OS X 10.7.4 with VirtualSerialPortApp.
When you opening port for first time you'll not able to do it next time while 
don't restart virtual ports.

Original comment by a.milu...@gmail.com on 15 Jun 2012 at 8:17

GoogleCodeExporter commented 9 years ago
Hi! I have the same issue with Virtual COM ports opened via 'socat' utility. 
Linux x86_64, jssc 0.9.0. 

bash$ socat -d -d PTY,raw,echo=0 TCP4-LISTEN:6001,fork,reuseaddr

First time port open OK, but when port was closed and try to open it generate 
exception "Port busy."

With real ports all works fine.

Original comment by w...@posten.ru on 30 Aug 2012 at 1:43

GoogleCodeExporter commented 9 years ago
I am having the same issue with the port busy issue
I am on Mac OS X 10.6.8

I am also using VirtualSerialPortApp
the names of the Ports are master and slave.
I have attached the code that will produce this error.

If you run it the first time it works fine.
but the second time it does not work at all

Original comment by Dtrac...@gmail.com on 24 Oct 2012 at 9:20

Attachments:

GoogleCodeExporter commented 9 years ago
Same behavior as in comment 8.

After opening the connection first time, and closing it successfully 
(closePort() returns true) I cannot connect to the same port again (exception 
"Port busy."), unless I'm running my program as root.

Ports opened via socat (socat -d -d PTY: PTY:)

Original comment by ako...@gmail.com on 15 Dec 2012 at 6:10

GoogleCodeExporter commented 9 years ago
i have the same problem. First opening is fine. After port was closed I can't 
open it again

Original comment by mitch3...@gmail.com on 22 Mar 2013 at 3:37

GoogleCodeExporter commented 9 years ago
I have the same problem, was solved by changing mode of serial ports (both 
/dev/ttyUSB0 and /dev/ttyS0). Question is if it is someway necesary to change 
mode (with chmod) or its some bug. But as statndar user i cant even use commant 
"cat" to send data to port after using jssc. So far i dont know if it is just 
about rights or jssc did something which then leads to this situation.

Original comment by Michal.V...@gmail.com on 4 Apr 2013 at 12:41

GoogleCodeExporter commented 9 years ago
HI,
I am also having this issue.  Can you describe what you did to change the mode 
of the serial ports?  i can use the ports once, maybe twice before I have to 
reboot to use them again.
Thanks

Original comment by mrh...@gmail.com on 13 Jun 2013 at 12:10

GoogleCodeExporter commented 9 years ago
I also tried running the app as root and it made no difference.  Help!

Original comment by mrh...@gmail.com on 13 Jun 2013 at 12:15

GoogleCodeExporter commented 9 years ago
Hello?

Original comment by mrh...@gmail.com on 18 Jun 2013 at 12:56

GoogleCodeExporter commented 9 years ago
I'm disappointed that there is absolutely no support for this product.  It 
works great in a Windows environment but falls over on a Mac.  I even tried 
contacting the developer and offering a considerable donation if they would get 
it working for a Mac.  I never received any response.

Oh well, will have to move to another product.

Original comment by mrh...@gmail.com on 26 Jun 2013 at 2:16

GoogleCodeExporter commented 9 years ago
Serial port exclusive access problem on *nix based OS's was fixed in 2.* 
version, not enough technical information in this thread.

Original comment by scream3r.org@gmail.com on 26 Jul 2013 at 2:49

GoogleCodeExporter commented 9 years ago
I found the solution, performing a purge before closing Port:

if (serialPort! = null && serialPort.isOpened ()) {
  serialPort.purgePort (1);
  serialPort.purgePort (2);
  serialPort.closePort ();
}
After the lines will connect successfully.

Original comment by leout...@gmail.com on 18 Sep 2013 at 3:51

GoogleCodeExporter commented 9 years ago
Muy buen codigo gracias 

Original comment by JhonMast...@gmail.com on 10 Nov 2014 at 11:11

GoogleCodeExporter commented 9 years ago
Great!Thanks!

Original comment by ant...@pres.global on 2 Feb 2015 at 12:15