[转]Mac's and serial TTY's
Mac's are excellent tools for accessing serial device TTY ports (to console into PBX's, switches, and routers). You just need a serial to USB adapter, the right driver, and some Terminal software.
You can use screen, although ZTerm, goSerial, or Minicom offer more features and functionality.
Drivers
Most Serial-to-USB adapters will work on a Mac with one of the following OS X drivers:
Prolific PL2303:
PL2303_MacOSX_v1_5_1.zip FTDI USB Serial:
FTDI_MacOSX_v2.2.18.zip
If your adapter doesn't work with either of these, try the following sources:
- Silicon Labs - CP210x USB to UART Bridge Virtual COM Port (VCP) drivers.
- Belkin - USB Serial Adapters: F5U257, F5U103, F5U003 (poor OS X support).
- Keyspan serial-USB adapter drivers can be found in their Support Section.
NOTE: It may be necessary to remove any previous driver before installing a newer one, eg:
$ sudo rm -rf /System/Library/Extensions/ProlificUsbSerial.kext
After installing the correct driver, plug in your USB-Serial adapter, and open a Terminal session (Applications/Utilities).
Enter the command ls /dev/cu.*
, and look for something like usbserial
(or similar):
$ ls /dev/cu.*
/dev/cu.Bluetooth-Modem /dev/cu.iPhone-WirelessiAP
/dev/cu.Bluetooth-PDA-Sync /dev/cu.usbserial
This indicates the USB-Serial driver is working. Select this port name in a terminal program.
Note: Check your adapter still works after a Mac OS Update, as you may have to re-install the driver.
You might notice that each serial device shows up twice in /dev, once as a tty.* and once as a cu.*. So, what's the difference? Well, TTY devices are for calling into UNIX systems, whereas CU (Call-Up) devices are for calling out from them (eg, modems). We want to call-out from our Mac, so /dev/cu.* is the correct device to use.
The technical difference is that /dev/tty.* devices will wait (or listen) for DCD (data-carrier-detect), eg, someone calling in, before responding. /dev/cu.* devices do not assert DCD, so they will always connect (respond or succeed) immediately.
Software
Having installed the right driver, our USB-Serial adapter will show up in /dev/cu.* (as shown above). We now need some terminal emulation software before we can connect to anything. Here are some Mac OS X terminal emulation programs:
GUI apps: Zterm
![]()
goSerial
Terminal apps: screen *
minicom
I use and (highly) recommend minicom, but there are several alternatives.
* screen is built-in to Mac OS X, the alternatives require downloading and installing.
ZTerm
ZTerm is a well known terminal emulation program thats been around for years, updated for Intel Macs. It supports VT100 emulation, which means it sorta kinda works with Meridian Mail (Function keys on a MacBook: fn + f-key). Shareware, but registration is $20.
To configure ZTerm, open Settings > Modem Preferences and select your USB-Serial device as the default modem (Serial Port). Then edit your connection in Settings > Connection. Remember to connect the USB-Serial cable before launching ZTerm. The following pictures explain the steps:
![]() |
![]() |
goSerial
goSerial can open multiple connections simultaneously, send and receive files, log sessions, and it supports scripting. There is no terminal emulation (VT100) support. goSerial is Donation ware.
To configure goSerial, click the light switch in the Toolbar and select your USB-Serial device as the Serial Port. The communication settings are set in the same window. The serial ports dynamically updates if devices are added or removed. The following picture shows the settings window:
![]() |
screen
You can also use the Mac OS X built in Terminal program and screen, there's no extra software needed:
- Open an OS X terminal session (window)
- Find the right TTY device. Type:
ls /dev/cu.*
With the USB-Serial adapter plugged in, you'll get a list, including something like this:
$ ls /dev/cu.*
/dev/cu.Bluetooth-Modem /dev/cu.iPhone-WirelessiAP
/dev/cu.Bluetooth-PDA-Sync /dev/cu.usbserial - Then type:
screen /dev/cu.usbserial 9600
The 9600 at the end is the baud rate. You can use any standard rate, eg, 9600, or 19200 for a Sig Server! - To quit the screen app, type CTRL-A, then CTRL-\.
Type man screen
in Terminal for further information on screen commands.
minicom
Alternatively, if you'd like a few more features, and a retro feel, you can install minicom 2.2 which is also my program of choice.
The linked version works under OS X 10.7 Lion, and 10.8 Mountain Lion. Minicom supports VT100 emulation, which means it sorta kinda works with Meridian Mail (Function keys on a MacBook: fn + f-key).
Download and run the minicom package installer, then manually edit your $PATH with sudo nano /private/etc/paths
.
Add the following line to the bottom of the file: /opt/minicom/2.2/bin
, save and exit - then relaunch the terminal.
Run minicom -s
first to configure your serial interface device name, and other options. Then, Save setup as dfl (default) and Exit. Your serial interface device name is found with ls /dev/cu.*
(as shown above). Always launch minicom, with your selected serial adapter plugged in and available to avoid an error. In the example below, the serial device is configured as /dev/cu.KeySerial1:
![]() |
![]() |
![]() |
Click image to view, or right-click and Open Link in a new window/tab |
In minicom, commands can be called by CTRL-A <key>, for example, change your serial port settings with CTRL-A P
Press CTRL-A Z for a Command Summary, and help on special keys. Enter CTRL-A X to quit.
HINT: Change your OS X terminal window size to 80x25 (1 line more) so you can see the bottom Minicom status bar.
(Terminal Preferences -> Settings -> Window). Open a new window for this change to take effect.
![]() |
Note, the minicom installer creates /opt, and its not hidden in the OS X finder. Rectify this with: sudo chflags hidden /opt
[转]Mac's and serial TTY's的更多相关文章
- esp8266 免费wifi强推广告神器(4) 发现当前WIFI下的用户数目,IP,MAC请求http信息 在用户请求跳转后跳转
需求: 1 获取当前连接客户端的HTTP请求各种信息 方法 get http 请求路径 例如 /index.html / /pic.jpg 请求版本 HTTP/1.0 HT ...
- 获取与esp8266连接的客户端的Mac地址 IP 端口 控制停止等问题
两个关键的库 ESP8266WebServer.h WiFiClient.h ESP8266WiFiAP.cpp C:\Users\dongdong\Desktop\Arduino-master\li ...
- virsh console配置
If you're trying to get to the console, you can either use virt-viewer for the graphical console or ...
- pppd - 点对点协议守护进程
总览 SYNOPSIS pppd [ tty_name ] [ speed ] [ options ] 描述 点对点协议 (PPP) 提供一种在点对点串列线路上传输资料流 (datagrams)的方法 ...
- devices-list
转自:https://www.kernel.org/pub/linux/docs/lanana/device-list/devices-2.6.txt LINUX ALLOCATED DEVICES ...
- Linux procfs详解
1.0 proc文件系统总览在类Unix系统中体现了一种良好的抽象哲学,就是几乎所有的数据实体都被抽象成一个统一的接口--文件来看待,这样我们就可以用一些简单的基本工具完成大量复杂的操作.在Linux ...
- 微信客户端+微信公众平台+新浪云SAE+Arduino+WS100(控制LED)
第一步:准备 1.智能手机微信客户端或微信电脑版 2.注册微信公众平台 https://mp.weixin.qq.com 3.注册新浪账号 http://www.sinacloud.com 4.拥有一 ...
- 微信客户端+微信公众平台+新浪云SAE+Arduino+WS100(控制LED)
第一步:准备 1.智能手机微信客户端或微信电脑版 2.注册微信公众平台 https://mp.weixin.qq.com 3.注册新浪账号 http://www.sinacloud.com 4.拥有一 ...
- android获取设备唯一标示
概述 有时需要对用户设备进行标识,所以希望能够得到一个稳定可靠并且唯一的识别码.虽然Android系统中提供了这样设备识别码,但是由于Android系统版本.厂商定制系统中的Bug等限制,稳定性和唯一 ...
随机推荐
- C#工具类(包含获取枚举描述方法)
//把一个对象转换成功键值对字典格式 var obj = new { CustomerId = customerId }; var dic = obj.ToDictionray(); public s ...
- 第23章 访问者模式(Visitor Pattern)
原文 第23章 访问者模式(Visitor Pattern) 访问者模式 导读:访问者模式是我个人认为所有行为模式中最为复杂的一种模式了,这个模式可能看一遍会看不懂,我也翻了好几个例子,依然不能很好的 ...
- 浅谈javascript中的call()和apply()方法
话说在js中,每个函数都包含两个非继承而来的放方法,apply()和call(),使得我们能在特定的作用域中调用函数. 官方定义: 语法: fun.call(thisArg[, arg1[ ...
- 【Swift初见】Swift词典
顾名思义.当我们仰望的时候,我们将基于索引查找我们需要找到的资源.在swift这同样适用,每个对象包括字典key和value.我们key为了找到当前这个key相应的value.与数组不同的是,字典项字 ...
- Java数据结构与算法(3) - ch04栈(栈和转置)
栈的基本特性是后进先出,最简单的用途是用于转置,还有其他诸如括号匹配,中序表达式(A+B*(C-D/(E+F)) --> ABCDEF+/-*+)和后续表达式(345+*612+/- --> ...
- Java数据结构与算法(2) - ch03排序(冒泡、插入和选择排序)
排序需要掌握的有冒泡排序,插入排序和选择排序.时间为O(N*N). 冒泡排序: 外层循环从后往前,内存循环从前往后到外层循环,相邻数组项两两比较,将较大的值后移. 插入排序: 从排序过程的中间开始(程 ...
- PHP_零基础学php_3PHP函数、传参函数、默认参数、函数返回值
<?php function say_hello() //无参数 { $name="tang"; echo "hello,".$name; echo &q ...
- 剖析Jetty实现原理
之前写一个简单易用Jetty文章.Jetty对于做JAVA Web发展的方面来说并不陌生,他是一个servlet集装箱,只有相对Tomcat这是比较简单的设计,并且也相对简单,使用灵活,我是学习和使用 ...
- NSNotification、delegate和KVO的区别
1.效率:delegate比nsnotification高.2. delegate方法比notification更加直接,最典型的特征是,delegate方法往往需要关注返回值, 也就是delegat ...
- 用windows性能监视器监控sqlserver的常见指标
用windows性能监视器监控sqlserver的常见指标 上边文章中提到win的性能监视器是监控数据库性能必备的工具,接下来我就给大家介绍一些常见的监控指标,其实无非就是磁盘,cpu,内存等硬件 ...