Mac 上的 RxTx - 串行端口已在使用中 [英] RxTx on Mac - Serial port already in use

查看:58
本文介绍了Mac 上的 RxTx - 串行端口已在使用中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Mac 上安装了 RXTX.Java JAR 程序和 Arduino 软件都将 Arduino 视为 USB 调制解调器,如果我们尝试打开串行端口,则两者都声称该端口已在使用中".两者都声称未知用户".我在 Java 扩展中有 rxtxcomm.jar.

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 rxtxcomm.jar in the Java Extensions.

如何让其中任何一个工作?

How do I get either of these to work?

推荐答案

OS X 在串行端口上有某种排除机制.MacBook 没有任何串行端口,但 USB 端口模拟它们.连接 Arduino 后,它在端口列表中显示为/dev/tty.usbmodem...",其中 ... 是一些尾随数字.

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.

当说端口繁忙时,这是一个标准的I/O 异常,这意味着我们不能获得访问权限.当前所有者未定义,因为没有当前所有者.我们只是没有获得所有权所需的目录访问权限.

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.

使用 Apple 终端,执行以下操作:

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!

这篇关于Mac 上的 RxTx - 串行端口已在使用中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆