Os X Serial Port Terminal



Question or issue on macOS:

I have just started experimenting with Serproxy and Arduino to get some serial data into Flash Builder/Flex. Serproxy seems to work fine and seems to connect to whatever port is specified. However, I am not able to see or read any data from the serial port using ActionScript. This is odd, because the Arduino should be printing data on a loop.

The only thing I can think of is that I am not setting the correct serial port number. I have been trying to figure out how to find out what number should be set, that is, 5331, 5332, 5333, etc.

Port

How to Get the Serial Number of a Mac from Command Line in Mac OS X To try this yourself and get the serial number on any Mac OS machine, enter the appropriate command string below at the Terminal, depending on the version of Mac OS X in use on the Mac. Be sure the command is on a single line, as usual with command line syntax. Even though you can connect to these serial ports using the built-in OS X Terminal application, Serial provides a more streamlined solution for system administrators that need to maintain various.

How do I find out the port number? Is there a way to do this using Terminal on OS X maybe?

How to solve this problem?

Solution no. 1:

You can find your Arduino via Terminal with

then you can read that serial port using the screen command, like this

Serial Port Terminal Os X

for example:

Solution no. 2:

ioreg -p IOUSB -l -b | grep -E “@|PortNum|USB Serial Number”

Solution no. 3:

Mac os x usb serial port terminal

I was able to screen using the device’s name anyway so that wasn’t the issue. I was actually just trying to find the port number, i.e. 5331, 5332 etc. I managed to find this by a trial and error process using an app called TCP2Serial from the app store on Mac OS X. It isn’t free but that’s fine as long as I know it works!

Worth the 99c 🙂
http://itunes.apple.com/us/app/tcp2serial/id506186902?mt=12

Solution no. 4:

mac os x don’t use com numbers. you have to use something like
‘ser:devicename’ , 9600

Solution no. 5:

While entering the serial port name into the code in arduino IDE, enter the whole port address i.e:

or

Terminal Emulator Osx Serial Port

where the * is the port number.

And for the port number in case of mac just open terminal and type

and then search for the port that u have set in arduino IDE.

Solution no. 6:

Found the port esp32 was connected to by –

You would get a long list and you can find the port you need

Hope this helps!

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 Minicom (or a GUI program) offer more features and functionality.

Drivers:

Most Serial-to-USB adapters will work on a Mac with one of the following OS X drivers...
UPDATE: Mavericks (10.9) includes a driver for FTDI-based Serial-to-USB adapters.

➤ Prolific PL2303:PL2303_MacOSX_1_6_0.zip
➤ FTDI USB Serial:FTDIUSBSerialDriver_v2_3.zip
NOTE: It may be necessary to remove any previous driver before installing a newer one,
eg: $ sudo rm -rf /System/Library/Extensions/ProlificUsbSerial.kext

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.

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):

This indicates the USB-Serial driver is working. Select this port name in a terminal program.

Note: Check your adapter works after an 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.* (shown above). We now need to install some terminal emulation software before we can connect to anything.

  • Two terminal methods are Screen and Minicom
  • For a GUI solution, see OS X Serial Port Apps

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

Os x serial port terminal connector

Screen

Mac Os X Serial Port Terminal

It's not actually necessary to download an install extra software, as you can use the Mac OS X built in Terminal and screen. Screen lacks some features, but it does include VT100/ANSI terminal emulation, and can be extremely useful.

  1. Open an OS X terminal session (window)
  2. Find the right TTY device. Type: ls /dev/cu.*
  3. With the USB-Serial adapter plugged in, you'll get a list, including something like this:

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

  5. The 9600 at the end is the baud rate. You can use any standard rate,
    eg, 9600, or 19200 for a Sig Server!
  6. To quit the screen app, type CTRL-A, then CTRL-.

Type man screen in Terminal for further information on screen. (use 'enter' or 'space' to scroll, and 'q' to quit).

Minicom

Alternatively, if you'd like a few more features, and a retro feel, you can install minicom 2.2.
Minicom supports VT100 emulation, which means it sorta kinda works with Meridian Mail (Function keys: fn + f-key).

  1. Download and run the minicom 2.2 package installer.
  2. Then manually edit your $PATH with sudo nano /private/etc/paths.
  3. Add the following line to the bottom of the file: /opt/minicom/2.2/bin, save and exit - then relaunch the terminal.

Os X Serial Port Terminal Connectors

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 /dev/cu.usbserial:

Os X Serial Port Terminals

Configuration Options

Connected to Port

Command Summary

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

Connecting

With handshaking set to software (

Mac Os X Usb Serial Port Terminal

xon/xoff) or none, which covers most devices, serial data communication needs just 3 wires: RXD (2), TXD (3), and GND (5). Generally, hitting

Osx Serial Port Terminal

<enter> should cause a response, or <ctrl-r>Port should 're-draw' 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). Signal ground is Pin 5 in a DB-9, or Pin 7 in a DB-25.
Pin Functions for RS-232
Data
TXD(3)Serial Data Output
RXD(2)Serial Data Input
GND(5)Signal Ground
Other
RI(9)Ring Indicator
Handshake
RTS(7)Request to Send
CTS(8)Clear to Send
DSR(6)Data Set Ready
DCD(1)Data Carrier Detect
DTR(4)Data Terminal Ready
DB-9 Male

Front (pin) view