Error Inside Serial.<init>() :: no joy....
in
Integration and Hardware
•
1 year ago
I'm simply trying to initiate a serial port and encountered this error anytime I tried
- myPort = new Serial(this, Serial.list()[ndx], 9600);
where ndx is an int that cycles from 0 to < Serial.list().length. I thought it was my code and couldn't find any solution having read many many forum entries on this error. I then tried the "Simple Write" example that comes with P5 (v.1.5.1) and get the same error.
My RXTX versions are correct, and I get this before the error:
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
I can see and list my COM ports and print the following to the console:
serial port(s) found
[0] "COM1"
[1] "COM3"
However, as soon as I try to establish a port to communicate with I get the following error, every time:
Error Inside Serial.<init>()
gnu.io.PortInUseException: Unknown Application
at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354)
at processing.serial.Serial.<init>(Unknown Source)
at processing.serial.Serial.<init>(Unknown Source)
at Comm2Hydra_not_working_v1.setup(Commtest_not_working_v1.java:57)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
Exception in thread "Animation Thread" java.lang.RuntimeException: Error inside Serial.<init>()
at processing.serial.Serial.errorMessage(Unknown Source)
at processing.serial.Serial.<init>(Unknown Source)
at processing.serial.Serial.<init>(Unknown Source)
at Comm2Hydra_not_working_v1.setup(Commtest_not_working_v1.java:57)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
I know there are (and I have read them) many posts on this topic but none have a reason as to why this error occurs nor how to remedy this. It also baffles me as to why the example code also doesn't work, perhaps indicating that there is some library component missing in my P5 installation? However I've double-checked everything I can think of to no avail.
Any assistance on this would be very helpful as my project is now dead in the water until I can get past this error.
Thanks in advance
1