We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpElectronics,  Serial Library › gnu.io.PortInUseException
Page Index Toggle Pages: 1
gnu.io.PortInUseException (Read 3473 times)
gnu.io.PortInUseException
Mar 25th, 2010, 11:56am
 
I am trying to run the SimpleWrite example from Examples->Libraries->Serial

I cannot because I always get.

Code:
Cannot run Java in 32 bit mode. Continuing in 64 bit mode.

Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
porto encontrado /dev/tty.usbserial-A8004IM1

gnu.io.PortInUseException: Unknown Application


I tried to follow http://processing.org/reference/libraries/serial/ but did not understand what was supposed to do for Mac.

I read http://processing.org/discourse/yabb2/num_1170029680.html#7 but what I tried didn't work.

I have searched high and low but alas, no answer was found  Cry
Re: gnu.io.PortInUseException
Reply #1 - Mar 28th, 2010, 2:31am
 
How many serial ports does your computer have?
Use this line of code to view available ports:
Serial.list();

Which one were you trying to use?
myPort = new Serial(this, "COM1", 9600);

Where "COM1" is the name of the port.
Re: gnu.io.PortInUseException
Reply #2 - Mar 31st, 2010, 5:46am
 
The port used instead of "COM1" (in your example) is /dev/tty.usbserial-A8004IM1

I am confident this is the correct port since is the same being used in the arduino and through there it works fine.

But I dunno  Huh

Thank you for the reply anyway  Cool
Re: gnu.io.PortInUseException
Reply #3 - Apr 1st, 2010, 12:24am
 
Is Arduino reading from that port when you run your sketch?

By chance does your sketch call "new Serial(...)" inside the draw() method?
Re: gnu.io.PortInUseException
Reply #4 - Apr 1st, 2010, 5:20am
 
Nope.

It's the example that comes with Processing - SimpleWrite (in Libraries->Serial).

I have been trying to fix this ever since so now I think the problem is on the command

Code:
myPort = new Serial(this, portName, 9600); 


on setup

I re-checked again and the serial monitor of Arduino IDE works just fine.  Shocked
Re: gnu.io.PortInUseException
Reply #5 - Apr 1st, 2010, 6:39am
 
I fixed this with the March release.

Dunno what the bug was but it works now  Grin

Oh and also changed the default Firmata with this http://at.or.at/hans/pd/objects.html#pduino
Page Index Toggle Pages: 1