Skip to main content

Serial Console & Communication

Notes on using serial consoles, managing USB-serial devices, and troubleshooting connectivity issues.

Documentation & Guides

Common Tools

  • minicom: Classic serial communication program. Man page.
  • screen: Terminal multiplexer often used as a simple serial client.
  • stty: Set or display terminal line characteristics. Man page.
  • setserial: Configuration tool for serial ports. Man page.

Usage Examples

# Initialize minicom setup
# If characters display incorrectly, try: LANG="en_US.UTF-8"
minicom -s

# Connect using screen
screen /dev/ttyS0 115200
# To exit: press Ctrl-A then Ctrl-\

# View serial port status
setserial -g /dev/ttyUSB0

Troubleshooting (FAQ)

USB Serial Device Not Showing /dev/tty*

If the kernel recognizes the USB device but doesn't attach it to a serial driver, you can try manual intervention.

  1. Check Logs:
    dmesg | tail
  2. Force Driver Attachment: If you identify the VID and PID (e.g., 067b:2303), you can tell the generic driver to handle it:
    modprobe usbserial
    echo '067b 2303' > /sys/bus/usb-serial/drivers/generic/new_id
  3. Automate with Udev: Create /etc/udev/rules.d/99-ftdi.rules:
    ACTION=="add", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", RUN+="/sbin/modprobe ftdi_sio", RUN+="/bin/sh -c 'echo 067b 2303 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'"
    Reload udev:
    udevadm control --reload

cu._ vs tty._ on macOS/Unix

  • /dev/tty.*: The "call-in" device. It blocks on open() until DCD (Data Carrier Detect) is asserted by hardware (e.g., a modem establishes a connection).

  • /dev/cu.*: The "call-out" device (Call-Unit). It opens immediately regardless of DCD state.

  • Usage: Use cu.* for outgoing serial communication (like connecting to an MCU) to avoid hanging on DCD.

  • StackOverflow - Difference between tty and cu devices

Resetting a USB Port

If a device becomes unresponsive, you may need to reset the USB bus or port from the command line.