Minicom is a simple serial communication program. It is useful in case you need to initially setup devices such as routers, switches and access points.
In past laptops shipped with at least one physical serial port. These days this is quite rare and you usually need to use an USB port with convertor.
In this short article I outline how to merry Minicom with an FTDI USB to RJ45 Cable.
Some of the above parts are affiliate links. By purchasing products through the above links you’ll be supporting this content, at no additional cost to you.
First you need to find and confirm the USB-to-Serial device location.
ls -lR /dev/serial
/dev/serial:
total 0
drwxr-xr-x 2 root root 60 máj 16 08:28 by-id
drwxr-xr-x 2 root root 60 máj 16 08:28 by-path
/dev/serial/by-id:
total 0
lrwxrwxrwx 1 root root 13 máj 16 08:28 usb-FTDI_FT231X_USB_UART_DN03VU63-if00-port0 -> ../../ttyUSB0
/dev/serial/by-path:
total 0
lrwxrwxrwx 1 root root 13 máj 16 08:28 pci-0000:00:14.0-usb-0:3:1.0-port0 -> ../../ttyUSB0
As you can see we have UART device located at ttyUSB0
. You can also retrieve further information by quering the device itself.
udevadm info /dev/ttyUSB0
P: /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/ttyUSB0/tty/ttyUSB0
N: ttyUSB0
L: 0
S: serial/by-path/pci-0000:00:14.0-usb-0:3:1.0-port0
S: serial/by-id/usb-FTDI_FT231X_USB_UART_DN03VU63-if00-port0
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/ttyUSB0/tty/ttyUSB0
E: DEVNAME=/dev/ttyUSB0
E: MAJOR=188
E: MINOR=0
E: SUBSYSTEM=tty
E: USEC_INITIALIZED=5106477815
E: ID_BUS=usb
E: ID_VENDOR_ID=0403
E: ID_MODEL_ID=6015
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_MODEL_FROM_DATABASE=Bridge(I2C/SPI/UART/FIFO)
E: ID_VENDOR=FTDI
E: ID_VENDOR_ENC=FTDI
E: ID_MODEL=FT231X_USB_UART
E: ID_MODEL_ENC=FT231X\x20USB\x20UART
E: ID_REVISION=1000
E: ID_SERIAL=FTDI_FT231X_USB_UART_DN03VU63
E: ID_SERIAL_SHORT=DN03VU63
E: ID_TYPE=generic
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=ftdi_sio
E: ID_PATH=pci-0000:00:14.0-usb-0:3:1.0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3_1_0
E: ID_MM_CANDIDATE=1
E: DEVLINKS=/dev/serial/by-path/pci-0000:00:14.0-usb-0:3:1.0-port0 /dev/serial/by-id/usb-FTDI_FT231X_USB_UART_DN03VU63-if00-port0
E: TAGS=:systemd:
Great, now that we can confirm that the hardware is recognized. We will proceed with software installation.
In case of Ubuntu Linux distribution, the minicom package is available in software repositories. Therefore the installation is as simple as:
sudo apt install minicom
Before you can connect to managed device’s serial port, you need to adjust the current console settings. This is done invoking program with -s
argument.
sudo minocom -s
An Interactive wizard will be displayed. Navigate to Serial port setup
. For example, a Cisco Access Point works with following settings:
+-----------------------------------------------------------------------+
| A - Serial Device : /dev/ttyUSB0 |
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
| E - Bps/Par/Bits : 9600 8N1 |
| F - Hardware Flow Control : No |
| G - Software Flow Control : No |
| |
| Change which setting? |
+-----------------------------------------------------------------------+
Press Esc
and Save setup as dfl
. Finally select Exit
from menu.
If everything worked correctly you should be presented by device’s default prompt.
ap>show inventory
NAME: "AP2700", DESCR: "Cisco Aironet 2700 Series (IEEE 802.11n) Access Point"
PID: AIR-CAP2702E-E-K9 , VID: V02, SN: FCZ1952Y0T6
If you see weird unreadable characters or your keyboard input does not work, revisit the device documentation and verify minicom console settings. Common issues include mismatched Speed, Parity or Flow control.
Finally, in order to exit the current console session press CTRL+A
then X
and confirm the dialog.
I hope this short tutorial will aid you in managing your devices via console in using Linux client environment.