Mac Os X Terminal How to Read Serial Port

Mac's and serial TTY'due south

Prolific PL2303 serial-to-USB adapter

Mac's are splendid tools for accessing serial device TTY ports (to panel into PBX's, switches, and routers). You just need a serial to USB adapter, the right driver, and some Terminal software.
You can apply screen, although Minicom (or a GUI program) offering more features and functionality.

Drivers:

About Serial-to-USB adapters volition work on a Mac with ane of the post-obit OS Ten drivers...
UPDATE: Mavericks (10.ix) includes a driver for FTDI-based Serial-to-USB adapters.

NOTE: Information technology may exist necessary to remove whatsoever previous driver before installing a newer one,
eg: $ sudo rm -rf /System/Library/Extensions/ProlificUsbSerial.kext

If your adapter doesn't piece of work with either of these, attempt 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 series-USB adapter drivers can be establish in their Support Section.

After installing the right driver, plug in your USB-Serial adapter, and open up a Concluding session (Applications/Utilities).
Enter the control ls /dev/cu.*, and wait for something similar 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 plan.

Note: Check your adapter works after an OS Update, as you may have to re-install the driver.

Y'all might observe that each serial device shows up twice in /dev, once as a tty.* and once equally a cu.*. So, what's the departure? Well, TTY devices are for calling into UNIX systems, whereas CU (Call-Up) devices are for calling out from them (eg, modems). Nosotros 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-discover), eg, someone calling in, before responding. /dev/cu.* devices do not affirm DCD, and then they will always connect (respond or succeed) immediately.

Software:

Having installed the right driver, our USB-Serial adapter volition evidence up in /dev/cu.* (shown above). We now need to install some terminal emulation software before we can connect to anything.

  • Ii terminal methods are Screen and Minicom
  • For a GUI solution, run across OS X Series Port Apps

Annotation: If you can't observe a commuter for your adapter (eg, Belkin), try Serial which has built-in support for many USB-Serial devices.

Screen

It's not actually necessary to download an install extra software, as you lot tin utilize the Mac OS X congenital in Terminal and screen. Screen lacks some features, merely it does include VT100/ANSI final emulation, and can exist extremely useful.

  1. Open an OS X concluding session (window)
  2. Find the right TTY device. Blazon: ls /dev/cu.*
  3. With the USB-Serial adapter plugged in, yous'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          

    The 'man screen' page

  4. Then type: screen /dev/cu.usbserial 9600 (in this example).

  5. The 9600 at the cease is the baud rate. Yous tin use whatever standard rate,
    eg, 9600, or 19200 for a Sig Server!
  6. To quit the screen app, type CTRL-A, so CTRL-\.

Type man screen in Terminal for further data on screen. (utilize 'enter' or 'space' to curlicue, and 'q' to quit).

Minicom

Alternatively, if you lot'd like a few more features, and a retro experience, you can install minicom 2.ii .
Minicom supports VT100 emulation, which means it sorta kinda works with Meridian Mail (Part keys: fn + f-cardinal).

  1. Download and run the minicom 2.2 parcel installer.
  2. And so manually edit your $PATH with sudo nano /individual/etc/paths.
  3. Add together the following line to the bottom of the file: /opt/minicom/ii.ii/bin, salvage and get out - then relaunch the last.

Run minicom -s first to configure your series interface device proper noun, and other options. And then, Salve setup every bit dfl (default) and Exit. Your series interface device proper name is found with ls /dev/cu.* (as shown to a higher place). Ever launch minicom, with your selected serial adapter plugged in and available to avoid an fault. In the example below, the serial device is /dev/cu.usbserial:

Minicom Configuration Options

Configuration Options

Minicom Connected to Port /dev/cu.usbserial

Connected to Port

Minicom Command Summary

Control Summary

In minicom, commands can be chosen past CTRL-A <key>, for example, change your serial port settings with CTRL-A P
Press CTRL-A Z for a Command Summary, and aid on special keys. Enter CTRL-A X to quit.

HINT: Change your OS 10 concluding window size to 80x25 (1 line more) so y'all tin can meet the lesser Minicom status bar.
(Last Preferences ► Settings ► Window). Open up a new window for this modify to take consequence.

terminal settings

Notation, the minicom installer creates /opt, and its not hidden in the OS X finder. Rectify this with: sudo chflags hidden /opt

Connecting

With handshaking set to software (xon/xoff) or none, which covers most devices, serial information communication needs just three wires: RXD (2), TXD (3), and GND (five). More often than not, striking <enter> should crusade a response, or <ctrl-r> should 're-depict' the screen. If you don't get any characters, try adding a Null-Modem cable or adapter, which swaps RXD and TXD (pins 2 and 3). Betoken footing is Pin 5 in a DB-nine, or Pin seven in a DB-25.

Pin Functions for RS-232
Data
TXD (three) Serial Data Output
RXD (two) Serial Data Input
GND (5) Signal Basis
Other
RI (9) Ring Indicator
Handshake
RTS (vii) Request to Send
CTS (8) Articulate to Transport
DSR (6) Data Set Ready
DCD (ane) Data Carrier Detect
DTR (4) Data Terminal Set
DB-9 Male

Front (pin) view

alvarezjudden.blogspot.com

Source: https://pbxbook.com/other/mac-tty.html

0 Response to "Mac Os X Terminal How to Read Serial Port"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel