Using Minicom on your Mac for serial communications

Mac OS X Add comments

These instructions are valid for Panther only. They do not work with Tiger.

UPDATE: July 25, 2005… Helpful reader Harald Wagener contributes this information for Tiger users:

today I faced a situation like You described in Your post from September, 2004: Using my trusty ibook and a keyspan USB/Serial adapter, I had to reconfigure a 3com switch.

In the first line of Your post, You state that the described procedure would not work with Tiger.

What works, though, is installing minicom using darwinports, and using the Keyspan serial adapter with a nullmodem cable. Since Your post comes up quite high when people search via google, You might add this bit of information to Your blog.

* * * * *

One of my duties as both a network admin and a consultant is to manage switches, routers and firewalls. Depending on the circumstances, establishing a telnet or SSH session to the device isn’t always possible and a console connection has to be used.

For such serial communications, Windows comes with an app named Hyperterminal. Mac OS X doesn’t come with an equivalent. A Shareware app named ZTerm ($20) is available and it certainly does the job, but an alternative named Minicom can do it for free.

Minicom will work with any Mac serial interface, whether it’s the built-in modem or an add-on device. The situations where I need a console connection usually involve Cisco equipment, and typically an 8-pin connection with a rollover cable is used. Connecting from the port in the back of the Cisco device to the Mac requires two additional pieces of equipment beyond the rollover cable.

First, an RJ45 to DB9 female serial adapter is needed. This adapter is attached to the end of the rollover cable and can be found at a good local electronics supply store for less than $2. The next piece of equipment that is necessary is a USB to DB9 male adapter, such as the one made by Keyspan. The USB end of the adapter plugs into the Mac, and the DB9 male end plugs into the DB9 female end of the adapter mentioned previously.

Once the cable is ready, it’s time to build Minicom from source. I realize that building applications from source may not seem very Mac-like, but let’s consider it the price of free software. Please make sure Apple’s XCode is installed. This tutorial has been tested with XCode 1.5 and the author cannot vouch for any other XCode version.

Go to the Minicom homepage and download the source package. Stuffit expander should decompress the .tar.gz file that’s downloaded. If not, open the Terminal and type the following command:

tar zxvf minicom-2.1.tar.gz

A folder named minicom-2.1 will be created. Change to that folder.

cd minicom-2.1/

Once inside the minicom-2.1 folder, compiling is straightforward. Use these three commands to configure, make, and install minicom:

./configure

make

sudo make install

Minicom should be installed in /usr/local/bin. To make sure, type this at the command line:

which minicom

A response like this should be returned:

/usr/local/bin/minicom

Now Minicom needs to be setup initially. The following command will start setup:

sudo minicom -s

A menu will appear and settings can be adjusted. Personally, Minicom reminds me very much of text-based communications programs from the old days when I used DOS, such as Telix and QModem (Anyone remember those?). And they should - all three are the same thing - simple serial communications via a text-based terminal.

Once Minicom is up and running, pressing Control-A and then Z will show a help screen.

Since I mentioned Cisco equipment earlier, perhaps I should provide some instructions and settings for establishing console connections. Minicom is going to need to know what serial port to use for its communications. To find out, change to the /dev directory and look at the devices listed with these commands:

cd /dev

ls -la|more

For my Keyspan USB to DB9 male adapter, an entry like this is listed:

cu.USA19H1b1P1.1

Remember that and then start Minicom setup as mentioned above. Select “Serial port setup” in the menu and press ENTER. Change setting A, “Serial Device”, and type:

/dev/cu.USA19H1b1P1.1

… and press ENTER. Change setting E, “Bps/Par/Bits” to 9600 8N1, and change setting F, “Hardware Flow Control”, to “No”. Press ENTER and then select “Save setup as dfl”. Choose Exit from the menu and there will be a brief pause for “Initializing modem”, and then the Minicom terminal will appear. Hit ENTER a couple of times and the prompt for the Cisco device will appear.

5 Responses to “Using Minicom on your Mac for serial communications”

  1. Patrick Okui Says:

    You are aware of course that you can use screen (which does ship with OS X)… i.e

    screen /dev/tty.usbserial 9600

    or similar… (i beleive the /dev/cu.* also works)…

  2. CaptTofu Says:

    I have a Belkin serial adapter, and I don’t see any /dev device for this and wondering how I could, how to determine what the device name is. I do see it in the ‘more info’ app on my mac, it shows up as a rs232 adapter, belkin, etc. How to see it in terms of UNIX? I used to use /dev/ttyS0, S1, etc, under linux back in the day.

  3. CaptTofu Says:

    Also, Parallels is able to use it under windows with windows terminal program.

  4. Aaron Adams Says:

    The best I can recommend is to use ls -la /dev|more and look for a device listed that seems like it would be your Belkin adapter. I don’t have that specific adapter, so I don’t know how it identifies itself.

  5. ciscosteps Says:

    Hi can you help me out, I have a ibook G4 . I did try to follow the instructions for Zterm but when I look for serial0 under modem prefrences there is only modem. pls help I need to access my cisco router and the only way is by console Thanks ,

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in