picocom(8) | picocom(8) |
picocom -- minimal dumb-terminal emulation program |
|
As its name suggests, picocom is a minimal dumb-terminal emulation program. It is, in principle, very much like minicom(1), only it's "pico" instead of "mini"! It was designed to serve as a simple, manual, modem configuration, testing, and debugging tool. It has also served (quite well) as a low-tech "terminal-window" to allow operator intervention in PPP connection scripts (something like the ms-windows "open terminal window before / after dialing" feature). It could also prove useful in many other similar tasks. When picocom starts it opens the terminal (serial device) given as its non-option argument. Unless the --noinit option is given, it configures the device to the settings specified by the option-arguments (or to some default settings), and sets it to "raw" mode. If --noinit is given, the initialization and configuration is skipped; the device is just opened. Following this, picocom sets the standard-input and standard-output to raw mode. Having done so, it goes in a loop where it listens for input from stdin, or from the serial port. Input from the serial port is copied to the standard output while input from the standard input is copied to the serial port. picocom also scans its input stream for a user-specified control character, called the "escape character" (being by default "C-a"). If the escape character is seen, then instead of sending it to the serial-device, the program enters "command mode" and waits for the next character (which is called the "function character"). Depending on the value of the function character, picocom performs one of the operations described in the "Commands" section below. |
Commands are given to picocom by first keying the "espace character" which by default is "C-a" (see "Options" below on how to change it), and then keying one for the function (command) characters shown here.
After performing one of the above operations the program leaves the command mode and enters transparent mode. Example: To increase the baud-rate by two steps, you have to type: C-a, C-u, C-a, C-u assuming of-course that "C-a" is the escape character. |
picocom can send and receive files over the serial port using external programs that implement the respective protocols. In Linux typical programs for this purpose are:
The name of, and the command-line options to, the program to be used for transmitting files are given by the "--send-cmd" option. Similarly the program to receive files, and its argumets, are given by the "--receive-cmd" option. For example, in order to start a picocom session that uses "sz" to transmit files, and "rz" to receive, you have to say something like this: picocom --send-cmd "sz -vv" --receive-cmd "rz -vv" During the picocom session, if you key the "send" or "receive" commands (e.g. by pressing C-a, C-s, or C-a, C-r) you will be prompted for a filename. At this prompt you can enter one or more file-names, and any additional arguments to the transmission or reception program. After that, picocom will start the the external program as specified by the "--send-cmd", or "--receive-cmd" option, and with any filenames and additional arguments you may have supplied. The standard input and output of the external program will be connected to the serial port. The standard error of the external program will be connected to the terminal which---while the program is running---will revert to canonical mode. Pressing 'C-c' while the external program is running will prematurely terminate it, and return control to picocom. Pressing 'C-c' at any other time, has no special effect; the character is normally passed to the serial port. |
Using the "--imap", "--omap", and "--emap" options you can make picocom map (tranlate, replace) certain special characters after being read from the serial port (with --imap), before being written to the serial port (with --omap), and before being locally echoed to the terminal (standard output) if local echo is enabled (with --emap). These mapping options take, each, a single argument which is a comma-separated list of one or more of the following identifiers:
For example the command: picocom --omap crlf,delbs --imap inglf,bsdel --emap crcrlf ... will: Replace every CR (carriage return, 0x0d) caracter with LF (line feed, 0x0a) and every DEL (delete, 0x7f) character with BS (backspace, 0x08) before writing it to the serial port. Ignore (not write to the terminal) every LF character read from the serial port and replace every BS character read from the serial port with DEL. Replace every CR character with CR and LF when echoing to the terminal (if local-echo is enabled). |
picocom accepts the following command-line options
|
picocom was written by Nick Patavalis (npat@efault.net) |
The latest version of "picocom" can be downloaded from: http://code.google.com/p/picocom/ |
picocom(8) |