LinuxCommandLibrary

minicom

Communicate with serial devices

TLDR

Open a given serial port

$ sudo minicom [[-D|--device]] [/dev/ttyXYZ]
copy

Open a given serial port with a given baud rate
$ sudo minicom [[-D|--device]] [/dev/ttyXYZ] [[-b|--baudrate]] [115200]
copy

Enter the configuration menu before communicating with a given serial port
$ sudo minicom [[-D|--device]] [/dev/ttyXYZ] [[-s|--setup]]
copy

Capture the output of a serial port to a file
$ sudo minicom [[-D|--device]] [/dev/ttyXYZ] [[-C|--capturefile]] [path/to/file]
copy

Exit minicom
$ <Ctrl a><x><Enter>
copy

Display help
$ minicom [[-h|--help]]
copy

SYNOPSIS

minicom [options] [profile_name]

PARAMETERS

-s
    Starts `minicom` in setup mode, allowing configuration of serial port settings, file transfer protocols, and more.

-o
    Instructs `minicom` not to reset the modem initialization strings upon startup.

-m
    Prevents `minicom` from initializing the modem, useful when connecting to non-modem serial devices.

-t
    Disables the use of lock files, which are normally used to prevent multiple programs from accessing the same serial port simultaneously. Use with caution.

-d
    Enables debug messages, providing more verbose output for troubleshooting.

-c <directory>
    Specifies an alternative configuration directory for `minicom` profiles and settings.

<profile_name>
    Loads a specific named configuration profile, typically found in ~/.minicom.d/.

DESCRIPTION

`minicom` is a text-based terminal program for Linux and other Unix-like systems, primarily used for serial port communication. It provides an interface to interact with devices connected via a serial port, such as modems, embedded systems, routers, and switches. Its design is reminiscent of popular DOS communication programs like ProComm, featuring a menu-driven interface accessible via Ctrl-A followed by a letter (e.g., Ctrl-A Z for help).

Users can configure baud rates, data bits, stop bits, parity, and flow control. It supports various file transfer protocols, including Zmodem, Ymodem, and Xmodem, making it useful for flashing firmware or transferring files to connected devices. `minicom` is widely adopted by system administrators, developers, and hobbyists for debugging and managing serial devices due to its simplicity and effectiveness. It typically requires proper permissions to access serial devices (e.g., being part of the 'dialout' group).

CAVEATS

Requires appropriate user permissions (e.g., being a member of the dialout group) to access serial devices. Without proper permissions, you may encounter "Permission denied" errors.

Using the `-t` (no lock) option can lead to conflicts if other applications or `minicom` instances attempt to access the same serial port simultaneously.

Initial setup via `minicom -s` is often necessary to configure the correct serial port, baud rate, and other communication parameters for your specific device.

KEY BINDINGS

`minicom` is heavily reliant on key combinations prefixed by Ctrl-A. For instance, Ctrl-A Z brings up the help menu, Ctrl-A X exits the program, and Ctrl-A S initiates sending a file. Understanding these key bindings is crucial for effective interaction with the program.

CONFIGURATION AND PROFILES

The default configuration is stored in ~/.minirc.dfl. Users can create multiple profiles for different devices or settings, which are typically saved in the ~/.minicom.d/ directory. These profiles can then be loaded using the command-line argument `<profile_name>`.

HISTORY

`minicom` originated in the early 1990s as a free software alternative to commercial DOS-based communication programs like ProComm. It was designed to provide similar functionality for Linux and Unix-like operating systems, leveraging their capabilities for serial port interaction. Its enduring popularity stems from its stability, simplicity, and effectiveness in a wide range of serial communication tasks, particularly in embedded systems development and network device management.

SEE ALSO

cu(1), screen(1), picocom(1), stty(1)

Copied to clipboard