Saturday, June 2, 2012

Prolific PL2303 USB to Serial Adapter and Mac OS X

This is a quick note on getting a USB-to-serial adapter working on my MacBook Pro so that I can console into Cisco routers, switches, etc. You may say this is a boring topic, that's because it is. Very perceptive of you! Nonetheless, it was an annoying journey to get my specific configuration working and I'd like to save someone some time if at all possible.

The gear: an old IOGear GUC232A USB to serial host adapter and Zoc Pro terminal program for Mac.

Background

I switched to a MacBook Pro (MBP) over a year ago. It just so happens I have not had the need to console into any device using the MBP for that entire time. I usually had a windows machine at the workplace, a terminal server, or some other excuse readily available. 


Next week, I will need an out of band console solution to provision a new system. Therefore, I have no more excuses and had to figure out a solution to get my MBP "serial-ready".

The Gear (Details)

USB/Serial dongle: IOGear GUC232A (which is basically using the Prolific PL-2303 chipset)
MBP: OS X 10.6.8 (I am holding off on Lion because upgrades suck time)
Terminal App: Zoc Pro 6.28

The Dongle

Fortunately, I had an IOGear GUC232A USB to serial host adapter in my kit. This thing is old. I originally got it for an IBM thinkpad I had back in 2003 or 2004. So, I wasn't holding out much hope on it working. In fact, I didn't know what type of device it was at first. Thankfully, the manufacturer affixed a label with a part number on the dongle. With a little Google magic, I was in business. Or so I thought.

There were several problems finding the right driver. To avoid boring readers to tears, here is a summary of what did not work:
  • The IOGear driver did not work. Downloaded, installed, did some goofy editing and "kext" loading (whatever the hell that is). No dice.
  • Most forum threads pointed to Prolific's website (http://www.prolific.com.tw/eng/downloads.asp?ID=31) That link does not work today (404 error)
  •  There are a few forum threads that point to the download area on Apple. Obviously, those threads are dated because that link didn't work either.
Now, at this point I have spent an hour or two digging around and I am thinking I have old stuff that may need to be recycled. I did a few more searches, focusing on software download sites and I found a link that worked:

The install steps were simple:
  • Download the zip archive and unzip
  • Double-click on the pkg file to launch the installer
  • Install the driver
The Driver

To be honest, I am not positive the following steps are required but all of the various resources I looked at, had the following procedures in common:
  • (optional?) Reload the machine. Most of the install docs I saw said reload the machine. The driver I used did not prompt me to do that so I didn't. All worked fine. So, up to you.
  • Load a terminal shell (Applications>Utilities>Terminal)
  • Execute the following: sudo kextload /System/Library/Extensions/osx-pl2303.kext
After completing the above steps, connect the dongle to an available USB port. When I connected the dongle, I received a prompt from OS X, which stated that a new Network Interface was detected. If you see this, click on "Network Preferences".
NOTE: The Prolific install guide (I found it online) said that you should be able to see the USB serial interface using System Profile or from the terminal using: ls /dev/tty.usbserial*. Neither of these methods worked for me, just an FYI.
In Network Preferences, you should see the new network connection. In my case I saw a modem driver named "PL2303-".

I didn't bother modifying the configuration, just click on Apply.

Terminal Application Configuration

I use Zoc Pro as a terminal application on my MBP and iMac. It is a great app, but that is a blog entry for another day. If you use Zoc, then here is the procedure for using the IOGear (or I suppose any device that uses the PL-2303 driver). 

In my case, I am connecting to a Cisco Video Communications Server (VCS) so, some of the configuration parameters I show in the following screenshots are specific to the VCS. 

Step 1: Create a New Connection

Go to Host Directory in Zoc and click on New

Step 2: Configure New Connection

Give the connection a title, keep the "Connect to" option blank, set the reconnect option to "Plain connection (no retry if failed)", set the emulation to VT100, and set the Device to "Serial/Modem".  This last option is what threw me for a little. I was trying "Serial/Direct" but that never worked. I decided to RTFM (go figure) and the FM pointed to using "Serial/Modem" as the correct setting. It was right.


Step 3: Configure Serial/Modem
In the "Edit Host Directory Entry" page, click on Configure... next to the Device setting. This is where you can configure the COM port parameters that are specific to your device. The first thing to do is to select "Override session profile defaults". This will expand the dialog and then you can modify the "Com-Port". On my system, it defaulted to a blue tooth device. This is not the correct device. Click on the Scan... button and choose the PL2303 device. In my case: /dev/cu.PL2303-000013FD

From there, configure the rest of the parameters to the specs supported by the equipment you are connecting to.



That's it...
After configuring the COM interface in Zoc, I was able to console into the VCS and several Cisco routers/switches without any issues. Hopefully, this will help the .005% of the population that still has an old IOGear USB-to-Serial dongle (or similar device using the PL-2303 driver/chipset).


Thanks for reading. If you have time, post a comment!

16 comments:

  1. Thanks is just wonderful guidance, thanks ever. Helped me at right time!

    ReplyDelete
  2. I suppose i'm in the .005% thank you

    ReplyDelete
  3. Hi,
    I tried both the official prolific driver and the open source one. Only I can see are hex chars when I connect from Mac.
    From a ubuntu server, with the same usb to serial adapter, it works out of the box.

    any idea?
    thanks

    ReplyDelete
  4. Thanks so much for this very useful information.

    I've spend hours looking for the right mac driver for my old CA-42 cable (based on PL2303 chip) until I found your article.

    Now my CA-42 cable works great on Mac os X 10.7.

    ReplyDelete
  5. Yet another nice way to customize my Macbook. This is definitely more complicated than macbook pro sticker decals though.

    ReplyDelete
  6. I had to set this up last night and this worked great. Curious though about zoc pro. I've always used iterm cause I'm cheap like that. Wondering how zoc pro compares to securecrt other than $80 vs $100.

    ReplyDelete
  7. Will,

    When I switched to Mac VanDyke didn't have a Mac port for SecureCRT. I found Zoc by way of a thread on VanDyke's forums complaining about the lack of support on the Mac.

    So, I haven't used SecureCRT on my Mac. I liked SecureCRT and I like Zoc. I wouldnt' switch now unless there was a good reason to. I have been using SecureCRT on a Windows station quite a bit lately. I feel that the experience is basically the same.

    HTH.

    -Bill

    ReplyDelete
  8. I bought the prolific first. Got it running on a mac pro, partly.
    I could send text out using applescript, until I closed the port. I would reopen it, nothing happening. only fix was to unplug/replug the usb cable.

    switched to a macbook pro with current OS. same problem, except when I unplugged the usb cable, osx went into a panic kernel fault requiring a reboot. repeatable problem.

    Bought the iogear next. now I am realizing it is pretty much the same stuff. they have not updated the driver in 10 years and the docs are lame to non-existent.

    ReplyDelete
  9. Thank you so much for your post! I have been trying to get the IOGear adapter working and was going to give up on using my Macbook Air and stay with my Windows machine. Your link to the driver worked. BTW, I didn't have to run through "The Driver" portion of your post. Once the driver installed, I attached the IOGear, changed the serial connection in SecureCRT to the PL2303 and was able to console into the Cisco router. Love it! Thanks again!!

    ReplyDelete
  10. I am getting: Could not open port '/dev/cu.usbserial' when trying to connect on Mac. Any suggestion are most welcome.

    ReplyDelete
  11. I establish a connection to a Cisco Aironet 1242ag but then when the AP boots up you can only see garbage characters. Man I wish I could just use a web interface.

    ReplyDelete
  12. I too was getting garbage characters untill I changed the baud rate on the serial adapter to 9600. if you Google "getting garbage characters when using cisco console cable" you will get return searches from Cisco's website say that most of the console ports on there routers and the console cables only support up to 9600 baud data rate.some newer routers goto 36000+ but they say you should set the default to 9600 first and go from there. the cisco directions are as follows:

    Introduction

    This document explains the correct settings to apply when you connect a PC to a router's console port. This document also details how to use the PC's Hyper Terminal to configure and monitor a router.
    Prerequisites
    Requirements

    There are no specific requirements for this document.
    Components Used

    This document is not restricted to specific software and hardware versions.

    The information presented in this document was created from devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command before you use it.
    Conventions

    For more information on document conventions, refer to the Cisco Technical Tips Conventions.
    Background

    When a console cable is connected from a PC's COM serial port to the router, a router prompt does not appear on the Hyper Terminal. Garbage characters appear on the Hyper Terminal, and the router no longer accepts keystrokes. It appears as if the router is hanging and is not responsive.
    Solution

    The settings in the Hyper Terminal need to be set correctly; otherwise, "strange-looking" or garbage characters may show up on the screen. When you set up the connection, use these settings:

    Bits per sec : 9600
    Data bits : 8
    Parity : none
    Stop bits : 1
    Flow control : none

    Here is a screenshot of how to configure these settings on a Windows-based PC running Hyper Terminal:
    '

    ReplyDelete
  13. Thanks for the help, but the fix is not working with the 1.5.1 version of the drivers. I can't find the osx-pl2303.kext in the /System/Library/Extensions/ directory, I did find a ProlificUsbSerial.kext, so I modified your kextload to:

    sudo kextload /System/Library/Extensions/ProlificUsbSerial.kext/

    But that didn't help. I still can't find or identify where to point at. BTW, this is running OSX 10.8.5.

    Thanks,

    padapa

    ReplyDelete
  14. Thanks. I had called it a lost cause until I found this post. Working now.

    lc

    ReplyDelete
  15. Thank you for your notes. This was exactly what I needed. I got the Prolific driver working (took a while) then my other termincal program was not emulating right. ZOC does it right but I really needed your instructions to get it configured for the local USBSerial port on my Mac. THANKS!

    ReplyDelete