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/ttyUSB0Troubleshooting (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.
- Check Logs:
bash dmesg | tail - Force Driver Attachment:
If you identify the VID and PID (e.g.,
067b:2303), you can tell the generic driver to handle it:bash modprobe usbserial echo '067b 2303' > /sys/bus/usb-serial/drivers/generic/new_id - Automate with Udev:
Create
/etc/udev/rules.d/99-ftdi.rules: Reload udev:text 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'"bash 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.
Resetting a USB Port
If a device becomes unresponsive, you may need to reset the USB bus or port from the command line.
关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
其他外链9 条
- askubuntu.com/questions/645askubuntu.com/questions/645
- linux.die.net/man/1/minicomlinux.die.net/man/1/minicom
- linux.die.net/man/1/statseriallinux.die.net/man/1/statserial
- linux.die.net/man/1/sttylinux.die.net/man/1/stty
- stackoverflow.com/questions/8632586stackoverflow.com/questions/8632586
- tldp.org/HOWTO/Remote-Serial-Console-HOWTOtldp.org/HOWTO/Remote-Serial-Console-HOWTO
- tldp.org/HOWTO/Serial-Programming-HOWTOtldp.org/HOWTO/Serial-Programming-HOWTO
- www.linux-usb.org/tools.htmlwww.linux-usb.org/tools.html
- www.tldp.org/HOWTO/Modem-HOWTO-18.htmlwww.tldp.org/HOWTO/Modem-HOWTO-18.html