After recently reading François Vergès (@VergesFrancois) blog post, Easily use AirConsole on MAC OS X, about setting up and scripting AirConsole, I thought I would share a script that I use to simplify console connections using Mac’s Terminal utility and a USB to Serial adapter. I will start by showing how to make a console connection, then show the script I use. Finally, I will give a link to the packaged script for you to download and use.
First, you will need a Mac, of course. Currently, I am running El Capitan, OS X version 10.11.3. You will then need a USB to Serial adapter. My preferred adapter is made by Aluratek. I have found them to be very reliable and relatively inexpensive. With any USB to Serial adapter, you will need to install drivers. If you are using an Aluratek adapter, here is a link to their driver page.
The drivers for the Mac are towards the bottom of the page.
The driver installation can be verified using the System Information utility. Be sure to have your adapter plugged in or it will not show up in the System Information utility.
Once the driver installation has been verified, we can start the process of opening a console connection.
- Open the Terminal utility (Launchpad > Other > Terminal).
- Use the following command to get the USB port name.
ls -ltr /dev/*usb*
Now that we have the USB port name we can use the screen command to open a console connection. The number at the end of the command need to match the baud rate for the device you are consoling too. For me, I primarily work with Cisco so the baud rate should be set to 9600.
screen /dev/tty.usbserial 9600
Congratulations! You have just consoled into a device using the Mac’s Terminal utility
Remember, to exit press CTRL+A followed by CTRL+\
If you do not exit properly you have to go in kill the process before opening another console. The easiest command to do so is
So, let us simplify the process using Apple’s Script Editor. The script will end all previous console connection processes before opening a new connection. This allows you to open and close your console connection any way you like.
Finally, what you all have waiting for the packaged script. Please remember to remove the _.zip before running.
Thank you for read and I hope this post was helpful. As always please leave you comments and feedback below.