Java – rxtx on MAC – serial port is already in use

I installed rxtx on my Mac Both Java jar program and Arduino software regard Arduino as a USB modem if they both claim that the port is "already in use", if we try to open the serial port All claim to be "unknown users" I have rxtxcomm jar.

How to make either of these two jobs work?

Solution

OS X has some exclusion mechanism on the serial port Macbooks don't have any serial ports, but USB ports emulate them When Arduino is connected, it displays as "/ dev / TTY. Usbmodem..." in the port list, where... Is some mantissa

When the port is busy, this is a standard I / O exception, which means we can't access it The current owner is not defined because there is no existing owner We just don't have the required permissions on the directory

Using the apple terminal, do the following:

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

This will create the required directory and make it accessible The serial port will no longer be busy unless something else really uses it!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>