mkstlwtz mkstlwtz - 2 months ago 18
Java Question

RxTx on Mac - Serial port already in use

I have RXTX installed on a Mac. Both a Java JAR program and the Arduino software see the Arduino as a USB modem if it is Both claim the port is "already in use" if we try to open the serial port. Both claim "Unknown User". I have the

in the Java Extensions.

How do I get either of these to work?


The OS X has some kind of exclusion mechanism on the serials ports. The MacBook does not have any serial ports, but the USB ports emulate them. When the Arduino is hooked up, it appears in the port list as "/dev/tty.usbmodem..." where ... are some trailing digits.

When is said the port was busy, that's a standard I/O exception that meant that we could not get access. The current owner was undefined because there was no current owner. We just did not have the required access to the directory to take ownership.

Using the Apple Terminal, do the following:

 sudo mkdir /var/lock
 sudo chmod a+rw /var/lock

This creates the required directory and makes it accessible. The serial port will no longer be busy, unless of course something else is really using it!