Back to mySolvr Home >
Bookmark

Using a Serial Console with a MacBook Unvalidated

As networking professionals we still use RS-232 serial communications often while the rest of the world considers the technology to be obsolete.  While your MacBook may not ship with a physical RS-232 port getting a serial connection working is quick and easy if you follow these steps.

First you'll need an RS-232 serial to USB adaptor.  The good news is these are generally cheap and not too hard to find.  The bad news is that they are never properly documented so your mileage may vary.  You will need an adapter built with the PL-2303 chipset manufactured by Prolific Technology Inc..  You may identify the device easily using the System Profiler application which you will find by opening the Applications folder and then the Utilities folder within.

In the Contents pane on the left select Hardware and USB.  In the USB Device Tree pane you may find a device named USB-Serial Controller D.  If you plugged the device in after starting the application you may need to select View and then Refresh from the menu bar.  Select the device and in the bottom pane note the Product ID, it should be 0x2303 and the Vendor ID should identify Prolific.  If you have any other value for Product ID you need another adapter.

Now that you have a good PL-2303 based adapter you will need the device driver.  You may download an OS X device driver for PL-2303 based devices directly from the manufacturer here:

   http://www.prolific.com.tw/eng/downloads.asp?id=31

Now let's determine the device name used by the serial port.  The device will be created and destroyed when plugged in and out.  Plug the adapter in and use the following command to see the devices listed by modification date in reverse order:

ls -ltr /dev

Near the bottom you shoud see something like:

 

crw-rw-rw-  1 root    wheel      11, 0x00000114  4 Dec 20:26 tty.usbserial
crw-rw-rw-  1 root    wheel      11, 0x00000115  4 Dec 20:26 cu.usbserial

crw-rw-rw-  1 root    wheel      11, 0x00000114  4 Dec 20:26 tty.usbserial

crw-rw-rw-  1 root    wheel      11, 0x00000115  4 Dec 20:26 cu.usbserial

These are the serial port devices.  The cu device is for modem control and not likely what you want, you use the device named tty.

 

Once the driver is installed you just need an application to use to work with the serial port.  In an old school Unix based environment we would use tip or cu however these utilities are not available with OS X.  Luckily though there is a native application which will work for us; screen.  Open the Terminal application from the same folder you found System Profiler in.  At the command prompt type the following command, substituting the actual device name if required:

screen /dev/tty.usbserial

You are now connected to the serial port.  To exit press control and a followed by control and \.  To get help on screen press control and a followed by control and ?.

The default speed is 9600 baud, no parity and 8 data bits.  To connect at another setting you may include them as options after the device name:

screen /dev/tty.usbserial 115200

 

Type: How-To - Archive ID: 2.63 - 416 Views - Last Updated: December 05, 2010 01:42:49
Tags: Apple Other General