Skip to main content

Serial Command Line

Now, we'll dicscuss how to connect to the Omega's command line over USB.

Context

The Serial Command Line terminal interface is ideal for configuration and debugging during early development. The serial command line is always accessible if the device is on. There is no need to rely on a network connection, like there is with SSH connections. For Omega devices in production environments or with stable network connections, SSH is a valid alternative to securely access the command line through the local network.

The Omega’s Serial Command Line interface is accessible on UART0. On hardware with an on-board USB-to-Serial chip - like the Omega2 Eval Boards - the serial command line can be accessed over USB. The USB-to-Serial chip translates the UART serial terminal signals into USB signals that your computer can understand and vice versa.

caution

Keep in mind the serial command line can only be accessed on hardware with a USB-to-Serial chip. This includes the Omega2 Eval Boards, Omega2 Pro, Omega2 LTE, Omega2 Dash, Omega2S Development Kit, Expansion Dock, and Mini Dock

Step 1: Install USB-to-Serial driver on your computer

You'll need to download and install the Serial-to-USB driver on your computer for your specific operating system.

Download and install the Silicon Labs CP210x driver for Mac OS.

Step 2: Connect to the Omega's Command Line

Before connecting to your Omega2 you'll need to check that the serial device exists.

In this example, we will use the screen utility to connect to the Omega's serial command line. There are other tools available but screen is simple and comes already installed on most Macs.

Open a terminal on your Mac, and then follow these steps.

Step 1: Check for the serial device

Plug in your Omega2 Eval Board, then run ls /dev/tty.* to see if the USB-to-Serial device is detected. If the driver is installed, you should see a device with a name like /dev/tty.usbserial-02B4E355. Note the device name, keep in mind the last 7 digits of the device name are unique!

mac check serial device

info

The Omega2 Eval Boards use the newer CP2104 USB-to-Serial chip so the serial device name is unique. Previous boards with the CP2102 chip will still use the /dev/tty.usbserial-0001 device name. Make sure to use the device name that corresponds to your device.

Step 2: Connect to Omega2

To connect to the Omega's serial terminal using the screen utility, run the following command using the device name from the previous step:

screen /dev/tty.usbserial-<UNIQUE DIGITS FROM STEP 1> 115200

In this example, the command would be:

screen /dev/tty.usbserial-02B4E355 115200

Step 3: Confirm connection is successful

Press Enter again and, if the connection is successful, you should see the following:

mac connection

Step 4: Closing screen

tip

Of course, you don't need to do this right away. We wanted to let you know how to close the screen session. For best results, close the screen session before disconnecting the device.

After you've finished with the command line you can close the session by pressing the action key (Ctrl-a) then k.

For information on how to use the screen utility, please see this tutorial.

info

Another useful serial port communication program is Minicom.