140

What programs can act as a terminal and access serial ports?

This is not for terminal access on an IP connection, this is so I can access a hardware device plugged into a USB/serial converter running at 9600/8/N/1.

4
  • 2
    You mean like a modem port 20 years ago?
    – nohillside
    Dec 2, 2011 at 18:29
  • @patrix, yes. I can load vmware, run windows, and use putty, but that seems like a lot of trouble to perform such a simple task. Dec 2, 2011 at 18:33
  • 1
    Lol. 9600/8/N/1. like a mantra to me. you can use zterm which still works at least up to 10.6. It old software. But was built to configure , communicate with Modems and transmit files modem to modem. dalverson.com/zterm
    – markhunte
    Jan 3, 2013 at 0:11
  • 1
    The latest zterm works with 10.9.
    – Dan Pritts
    Mar 23, 2014 at 18:35

14 Answers 14

84

There's a new Mac app called Serial, available in the app store. Full disclosure- I wrote it. The main advantage over other apps is it can work with most USB to serial devices without having to install any drivers, as it has its own drivers built-in. It also does full terminal emulation so you can use it to work with Linux or other devices that require it. You can try it for free, too.

Also, Apple began including their own driver for FTDI-based devices in Mavericks (10.9). So, if you're on 10.9 or later and your device has an FTDI chip inside, you can use the built-in screen command in the terminal to access your device without worrying about drivers.

13
  • 6
    I just tried Serial today. So far, I'm quite impressed. I'll purchase it just for sparing me from having to worry about USB to serial drivers. I won't miss ssh'ing into my Linux box to run minicom. Feb 13, 2015 at 0:16
  • 1
    WOW, I am using Serial right now and I think this is how every single piece of software should work. As I only need it for a very specific job and it comes with some free trial days, and I am broke, I won't get the full version... if any of the three conditions were false, I would get it... they deserve it!
    – kikusin
    Oct 24, 2015 at 9:45
  • 19
    fyi Serial is not free
    – Szundi
    Apr 7, 2018 at 23:36
  • 1
    was hesitant to spend 30$, but I did and no regrets. totally worth it. Works perfect. Plug in and be done. Absolutely hassle free. thumbs up mate. May 15, 2018 at 11:47
  • 2
    wow. really wow. I've been using screen for years and always found ttys just .. annoying. I randomly found this thread, was like I'm not paying $30 for - oh wait there's a trial. So I tried. 2 minutes after I bought the software pretty much regardless how often I need it just to support Chris, cause it is truly amazing. Haven't seen a well written thing like this for a while.
    – lukash
    Feb 7, 2019 at 3:43
151

You can use the terminal command screen to do this!!!

As seen on ServerFault:

I love using [screen] for connecting to serial consoles, i.e.

screen /dev/ttyS0 19200

Or, if you prefer Mac OS X hints...

I often have to do router configuration via a console port, so I use a Keyspan Serial Adapter to get access. Two problems then present themselves: ZTerm is a horrible Mac OS X app. It hasn't been updated in five years or so, and isn't a Universal Binary. The developer doesn't seem in any hurry to rectify the situation. It is not worth the shareware fee in its current form. Minicom requires installation of Fink or MacPorts and is overly complex. Solution: Use screen, Terminal, and a little AppleScripting.

First, launch Script Editor and type/paste in the following code:

tell application "Terminal"
  do script with command "screen /dev/tty.KeySerial1"
  set number of rows of window 1 to 100
  set number of columns of window 1 to 80
  set background color of window 1 to "black"
  set normal text color of window 1 to "green"
  set custom title of window 1 to "SerialOut"
end tell

Compile and save as an app from within Script Editor, and you have a double-clickable application to launch a serial Terminal session. You may want to customize this slightly -- you can change the screen colors or number of columns or rows. You may also need to customize the screen command with a different device name if you are using something other than the Keyspan Serial Adapter (do an ls tty* of the /dev/ directory to get the right name).

screen uses Control-A to take commands directed to it. So type Control-A followed by Control-\ to exit your screen session. If you fail to do this and exit a Terminal session, you'll leave the screen session alive and the serial resource unavailable until you kill the screen session manually. man screen will show you further commands to send to a screen session.

If anyone can reply with a link to a tutorial on how to wrap an interactive Unix App in Cocoa, that would be the next step -- it would be nice to do this without involving Terminal. If you prefer to use Minicom, you could still use the AppleScript to wrap it into a nice launchable app -- use this older hint to find the right command line commands.

Many USB-Serial adapters use the chip from FTDI. Install the "Virtual COM Port" driver and look for the proper TTY name in /dev. For example, on a PowerBook G4 it came up as /dev/tty.usbserial-FTALKY8I.

5
  • 1
    For USB-Serial adapters with PL2303 chip, see sourceforge.net/projects/osx-pl2303
    – Dan Pritts
    Mar 23, 2014 at 18:37
  • 1
    Clearly the best answer: Terminal + screen + osx-pl2303 (in production use since… many years ☺).
    – dan
    Aug 4, 2014 at 16:49
  • 3
    It's worth looking at Chris K's answer below; apparently OS X comes with FTDI drivers since 10.9 (after this answer was written), so the installation isn't necessary.
    – krs013
    Dec 8, 2014 at 19:16
  • Screen (or minicom for that matter) is not quite right. It looks good until you try to run nano or vi. It can't handle those. The arrow keys and return key generate garbage. If there's a setting on screen to fix that, please let me know.
    – garyp
    Nov 19, 2015 at 16:05
  • 2
    I love screen but: how do you get it to translate lf into crlf? Aug 13, 2019 at 1:39
41

My preference is cu. I use it for Arduino or Bus Pirate related fun. It's installed by default and supports parity settings among other options (type man cu for more info).

sudo cu -s 115200 -l /dev/tty.usbserial-A6005kdh

To bail out when you're done, type ~. as you would with SSH

8
  • 1
    This seems like the start of a good answer, but running it as root feels wrong; other programs don't need that to acess /dev/tty.xxx or /dev/cu.xxx programs, yet cu seems to fail with an error about lock files, when run as a user who has access to the port itself. Perhaps the default install of the program is misconfigured?
    – user221106
    Jan 21, 2017 at 20:45
  • 1
    No? The permissions should be on the device, not the program. I've been pretty lazy researching permissions to be honest. Have you tried "/dev/ttyS0" as in the screen solution? Does cu cause permissions problems then? Jan 24, 2017 at 18:57
  • A fun issue with this that I hit this weekend is that if you require different line feed settings, you'll have to learn the stty commands to set your console. Dec 18, 2017 at 17:13
  • 1
    does not support midi baud rate 31250 it says rate not supported
    – becker
    Dec 21, 2019 at 16:21
  • 1
    I've had success with cu on other platforms, and I can use screen successfully on mac. But when I try cu on my mac, I can only receive the data; transmitting data doesn't work. Ever deal with this?
    – Chris
    Jan 24, 2021 at 23:38
35

The best program I know of for this is minicom, available from Homebrew, fink, and macports.

Minicom is a serial communication program. It is a Unix clone of the well-known MS-DOS Telix program. It has ANSI color, a dialing directory, dial-a-list, and a scripting language.

Homebrew installation:

brew install minicom
2
  • 3
    The meta key is Esc. So Esc-Q to quit, Esc-O for options, etc. I found minicom (and Serial.app) to be best at handling disconnects/reconnects which are basically implicit when running LinkitOne (all Arduino?) development. Most other apps crash or lose the connection and cannot reconnect until relaunch.
    – owenfi
    Mar 18, 2015 at 5:10
  • There's also Serial 2 brew install --cask serial Apr 12, 2022 at 22:47
20

If you prefer not to work in Terminal, you might mant to try CoolTerm (free). Scroll down a bit for description and download. Don’t let the fact it‘s written in RealBasic turn you away... I have used it to connect to plotters, Arduino boards and receipt printers via a Keyspan USB<->Serial Adaptor.

3
  • Already a CoolTerm user, just searching for a "send in HEX" feature brought me back to this thread. CoolTerm is so great and even has this feature included in Menu "Connection > Send String ..." then toggle to HEX for send format! Aug 30, 2016 at 14:44
  • I never understood the "send in HEX" use-case. Can you please enlighten me? I only ever use it for ASCII input/output.
    – Frak
    Jun 8, 2019 at 15:20
  • CoolTerm still the simple setup worked on Monterey 12.3. Had to use "Line Mode" in settings for my particular testing. Still not actual answer though, since not command line option.
    – ndasusers
    Apr 4, 2022 at 12:40
16

You should have a look at ZOC, what I think to be the best terminal emulation program available for the Mac. I use it everyday for my job. It has the ability to do direct communication with a serial port. Of course it does way more than just serial communication.

ZOC is a professional SSH/telnet client and terminal emulator. With its impressive list of emulations it lets you easily connect to hosts and mainframes, using communication methods like secure shell, telnet, serial cable or modem/isdn.

Its sleek user interface has many ways of making your life easier. In its own way, this is the swiss army knife of thin clients: versatile, robust, proven.

Key features:
- Tabbed sessions with thumbnails
- Customizable to meet your preferences and needs
- Scripting and automation features
- Compatible with Windows 7 and OS X Lion
- Administrator friendly (deployment, configuration)
- Now $79.99 with attractive bulk discounts

4
  • 5
    80$ for a terminal emulator seems a bit steep if he just needs that feature!
    – Agos
    Dec 2, 2011 at 23:42
  • 2
    Price was not mentioned as a criteria in the question. Please don't diminish an answer just because you don't agree with the price.
    – Carter
    Dec 3, 2011 at 13:11
  • 3
    I second Agos' comment. He's not "diminishing" your answer, just saying that he thinks that ZOC is not a good solution considering everything (cost, features, etc)
    – cyphunk
    Jul 11, 2012 at 7:57
  • 1
    Also, combined with the other answers above, it seems (from the quoted description) like the only difference between ZOC and Terminal is tab thumbnails (and the price).
    – Matt
    Aug 2, 2012 at 16:15
12

C-Kermit is alive and well in Brew, and can be installed with:

brew install c-kermit

Naturally you would require Brew to be installed first. You can find information on how to do this here: http://brew.sh

Alternatively use Macports

sudo port install kermit

This would too require you to have Macports installed

0
7

And then there still is the old ZTerm which is just as old as it's looks suggest yet it gets the job done just fine and it is available for free. Works fine with Prolific (PL 2303) and FTDI based USB serial adapters.

2
  • 1
    Wow, ZTerm lives! Brings backs many memories and old Macs.
    – lhf
    Jun 7, 2014 at 15:08
  • Just downloaded ZTerm… and it’s as bad as I remember… CRASH… CRASH… CRASH… (delete ZTerm).
    – geowar
    Oct 2, 2018 at 0:22
5

+1 for minicom:

brew install minicom

get address of your USB to Serial adapter:

ls /dev/tty.*
/dev/tty.Bluetooth-Incoming-Port    /dev/tty.usbserial-1440

and set it up: minicom -s

        +-----[configuration]------+
        | Filenames and paths      |
        | File transfer protocols  |
        | Serial port setup        |
        | Modem and dialing        |
        | Screen and keyboard      |
        | Save setup as dfl        |
        | Save setup as..          |
        | Exit                     |
        | Exit from Minicom        |
        +--------------------------+

Choose Serial port setup

Press A to setup you USB to Serial device

Press F to disable Hardware flow control

So it would look like this:

+-----------------------------------------------------------------------+
| A -    Serial Device      : /dev/tty.usbserial-1440                   |
| B - Lockfile Location     : /usr/local/Cellar/minicom/2.7.1/var       |
| C -   Callin Program      :                                           |
| D -  Callout Program      :                                           |
| E -    Bps/Par/Bits       : 115200 8N1                                |
| F - Hardware Flow Control : No                                        |
| G - Software Flow Control : No                                        |
|                                                                       |
|    Change which setting?                                              |
+-----------------------------------------------------------------------+

Hardware flow control must be disabled for you to be able to send inputs to terminal in typical PL2303 USB to Serial cables.

Esc key is the Meta key for this program. Esc and arrow down to exit menu. Do not forget to save default!

    | Save setup as dfl        |

and Exit from Minicom

Next time you start it, it expects defaults you just configured and in my case ready to go from second 1.

4

After trying other approaches (incl. screen) unsuccessfully, I started using goSerial from this list of serial port apps for mac. Seems to be working fine. It's a free (donation based) program.

3

I have had success with cutecom on Ubuntu 16.04

Supported on OSX: http://cutecom.sourceforge.net/

4
  • Welcome to Ask Different! Please don't give link-only answers. We're looking for answers that provide explanations as to why it answers the question as well as why it's the best answer. Links can change over time and then we'll lose the question-answer context. See How to Answer for info on what makes up a good answer. - From Review -
    – fsb
    Jun 8, 2016 at 16:03
  • Unfortunately it requires a very old version of Qt to be installed on your system to build it.
    – Oscar
    Mar 25, 2019 at 8:23
  • @Oscar What is the Qt version requirement? What symptoms did you observe with the new version of Qt? Is there a good workaround?
    – gatorback
    Sep 27, 2021 at 11:24
  • @gatorback Wow, I don't even remember this... so unfortunately I don't remember which version of Qt it wanted. It must've been earlier than 5, though.
    – Oscar
    Sep 29, 2021 at 6:49
3

Another serial terminal for Mac OS X is Cornflake!

It features Device Selection with a Refresh Button, Baud Rate & Packet Type & Flow Control Selection, Port Control and a View Filter to view incoming data as ASCII, ASCII+, Integer or HEX.

3

SerialTools on App Store (free). Good for me

1
  • It is only the one that I could run normally because a lot of others are left on x86 architecture and I can't run it on MacOS x64. It is not ideal, but at least works! Nov 7 at 9:02
2

I use screen to connect to my router's serial port on my Mac.

After installing it- using either macports or homebrew depending on your preference- use the following syntax:

sudo screen /dev/(serialDevice) (baudRate) (TransmissionRate) (flowControl)

To connect to my MikroTik RB4011 router my screen command is:

sudo screen /dev/ttyUSB0 115200 cs8 ixoff

"cs8" being the bit rate of router and "ixoff" specifying "No Flow Control". "115200" is the baud rate of router. Alternate settings would be "cs7" for 7 instead of 8 bit and "ixon" if flow control supported by your serial device. man screen

All the "HowTo's" for using screen to make a serial connection on the 'net I've found Googling omit these required parameters, so that's why you'll find screen has not worked if you've tried it just passing only the baud rate.

BTW, minicom -s (which would also need to be installed via macports or homebrew) also works great, but I prefer screen as I don't have to go through setup menus- I can just pass the serial connection parameters directly to the screen command.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .