In my industry I often use a USB to serial cable for my work. On a Windows PC, I would resort to tools such as PuTTY or HyperTerminal. But on a Mac the options aren't so clear.
One option is a to use a tool called Screen which is built into the Mac terminal. Learning to use Screen, like any other product, has a learning curve.
Here are a few commands to help with using Screen:
Once you have opened terminal, in order to access your tty's, go to your dev directory which is right under the home directory.
And in the dev directory, if you have a usb-serial-cable plugged in, you'll see it here. Mine was called tty.usbserial. Now type in "screen <your-serial-usb-name>"
And you'll be connected via serial to the device you're working with. The tricky part here is getting out of the screen session, which is known as detaching from a session.
Here is a my screenshot me of in a session, of course with most of the text fuzzed out:
If you just pull the usb cable out, you'll have to quit and restart terminal, and most likely use another usb port before you can use Screen again.
A better way to handle closing a session is to first detach from the session, then display the session information, and finally close the session. Here's how it is done:
First, you need to detach from the session, to do this, hold control, and then hit 'a', then d (without the control)
You just detached from your session:
Now you'll want to display the information of screens sessions. To do this, type "screen -ls" into the terminal prompt:
Next, you'll want to stop the session, to do this, you'll need to know the screen number of the session you want to stop. In my case its 4702. Now type the following command into the prompt:
screen -X -S <screen number> quit
Finally, you can do another screen -ls to check and make sure that the screen session was stopped:
These are some basic commands you should know if you are planning on using Screen. If you have any questions, please write to me at rpartlan.tumblr.com/ask