macos TrendNet TU-S9 RS232/USB 和 OS X
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5985117/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
TrendNet TU-S9 RS232/USB and OS X
提问by ejnorman
I recently bought a TrendNet TU-S9 USB to RS232 converter. I need to talk to microcontrollers that use RS232 at 9600 baud. The code I have for a Linux box works fine. I installed the drivers according to the instructions on my laptop and a Mac Mini both running OS X 10.6.7. I changed the device to /dev/cu.usbserial.
我最近买了一个 TrendNet TU-S9 USB 转 RS232 转换器。我需要与在 9600 波特下使用 RS232 的微控制器交谈。我为 Linux 机器编写的代码工作正常。我根据笔记本电脑和运行 OS X 10.6.7 的 Mac Mini 上的说明安装了驱动程序。我将设备更改为 /dev/cu.usbserial。
Here's what happens. It sure does look like communication will work the first time I try it. But if I exit the process I can't write to the serial device anymore. If I unplug the USB connection and plug it in again, then I can go one more time. I.e. it looks like plugging in the USB connector is what is necessary to get things reset to a usable state.
这就是发生的事情。我第一次尝试通信时,它确实看起来确实有效。但是如果我退出这个过程,我就不能再写入串行设备了。如果我拔掉 USB 连接并重新插入,那么我可以再去一次。即看起来插入 USB 连接器是将事物重置为可用状态所必需的。
When I get the error the second time I try to start the process, I can open the device, but the error happens the first time I try to send a byte over the serial interface. The error from perror is "Serial: No such file or directory".
当我第二次尝试启动该过程时出现错误时,我可以打开设备,但第一次尝试通过串行接口发送字节时发生错误。perror 的错误是“串行:没有这样的文件或目录”。
I can get around this problem by writing a second program that merely opens the cu.usbserial device and then loops forever. This doesn't seem like the best way to fix it, though.
我可以通过编写仅打开 cu.usbserial 设备然后永远循环的第二个程序来解决这个问题。不过,这似乎不是解决它的最佳方法。
Has any one seen this behavior? Can anyone replicate it? Does anyone know how to fix it?
有没有人见过这种行为?任何人都可以复制它吗?有谁知道如何修理它?
Note: this might be related to a previous post Programmatically talking to a Serial Port in OS X or Linux, or it might not.
注意:这可能与之前的文章以编程方式与 OS X 或 Linux 中的串行端口对话有关,也可能与此无关。
Eric
埃里克
回答by LeTanc
I don't really have an answer to you're exact problem, but I had a problem getting the TU-S9 working with my MacBook Pro today. I have the new 2011 MBP running 10.6.7. I installed the drivers from TrendNet and the device showed up in my System Profiler as a Prolific USB serial adapter, but the device wasn't available from either of my terminal programs (zterm and goSerial).
对于您的确切问题,我真的没有答案,但是我今天在让 TU-S9 与我的 MacBook Pro 一起工作时遇到了问题。我有运行 10.6.7 的新 2011 MBP。我安装了 TrendNet 的驱动程序,该设备在我的 System Profiler 中显示为 Prolific USB 串行适配器,但该设备在我的任一终端程序(zterm 和 goSerial)中均不可用。
I later discovered that I needed to actually download the latest drivers from Prolific directly http://prolificusa.com/pl-2303hx-drivers/(md_PL2303_MacOSX10.6_dmg_v1.4.0.zip). As soon as I installed the latest drivers and rebooted it worked perfectly.
后来我发现我需要直接从 Prolific 下载最新的驱动程序http://prolificusa.com/pl-2303hx-drivers/(md_PL2303_MacOSX10.6_dmg_v1.4.0.zip)。一旦我安装了最新的驱动程序并重新启动,它就完美地工作了。
In /dev I had cu.usbserial and tty.usbserial. I was able to get terminal access using either of them by using command "screen tty.usbserial 9600" (it also worked from zTerm)
在 /dev 我有 cu.usbserial 和 tty.usbserial。通过使用命令“screen tty.usbserial 9600”(它也可以从zTerm运行),我能够使用它们中的任何一个获得终端访问权限
Hope this helps somebody!
希望这对某人有帮助!