home *** CD-ROM | disk | FTP | other *** search
-
- picocom
-
- by Nick Patavalis (npat@efault.net)
-
- As its name suggests, [picocom] is a minimal dumb-terminal emulation
- program. It is, in principle, very much like minicom, 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. It is ideal for embedded systems
- since its memory footprint is minimal (less than 20K, when
- stripped). Apart from being a handy little tool, [picocom] source
- distribution includes a simple, easy to use, and thoroughly documented
- terminal-management library, which could serve other projects as
- well. This library hides the termios(3) calls, and provides a less
- complex and safer (though certainly less feature-rich)
- interface. [picocom] runs on Linux, and with minor modifications it
- could run on any Unix system with the termios(3) library.
-
- ** Description of operation
-
- 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
- following operations:
-
- [esc] : Do nothing, remain in command mode
-
- C-x : Exit the program: if the "--noreset" option was not
- given then the serial port is reset to its original settings
- before exiting; if it was given the serial port is not
- reset.
-
- C-q : Quit the program *without* reseting the serial port,
- regardless of the "--noreset" option.
-
- C-p : Pulse the DTR line. Lower it for 1 sec, and then raise it
- again.
-
- C-t : Toggle the DTR line. If DTR is up, then lower it. If it is
- down, then raise it.
-
- B-u : Baud up. Increase the baud-rate.
-
- B-d : Baud down. Decrease the baud-rate.
-
- C-f : Cycle through flow-control settings.
-
- C-y : Cycle through parity settings.
-
- C-b : Cycle through databits-number settings.
-
- C-v : Show program options (like baud rate, data bits, etc). Only
- the options that can be modified online (through commands)
- are shown, not those that can only be set at the
- command-line.
-
- C-s : Send (upload) a file (see "Sending and Receiving Files"
- below)
-
- C-r : Receive (download) a file (see "Sending and Receiving Files"
- below)
-
- After performing one of the above operations (except for the one
- binded to the [esc] function character) the program leaves the command
- 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.
-
- ** Sending and receiving files
-
- [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:
-
- rx(1) -- receive using the X-MODEM protocol
- rb(1) -- receive using the Y-MODEM protocol
- rz(1) -- receive using the Z-MODEM protocol
-
- sx(1) -- send using the X-MODEM protocol
- sb(1) -- send using the Y-MODEM protocol
- sz(1) -- send using the Z-MODEM protocol
-
- ascii-xfr(1) -- receive or transmit ASCII files
-
- The name of, and the command-line options to, the program to be used
- for transmitting files is 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"
-
- Durring 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.
-
- ** Invocation
-
- The following invocation produces a short help message with picocom's
- command-line syntax:
-
- # picocom --help
-
- picocom vX.Y
- Usage is: picocom [options] <tty device>
- Options are:
- --<b>aud <baudrate>
- --<f>low s (=soft) | h (=hard) | n (=none)
- --<p>arity o (=odd) | e (=even) | n (=none)
- --<d>atabits 5 | 6 | 7 | 8
- --<e>scape <char>
- --no<i>nit
- --no<r>eset
- --<s>end-cmd <command>
- --recei<v>e-cmd <command
- --<h>elp
- <?> indicates equivalent short option. Short options
- are prefixed by "-" instead of "--".
-
- Options are:
-
- '--baud' or '-b'
- Defines the baud-rate to set the serial-port (terminal) to.
-
- '--flow' or '-f'
- Defines the flow-control mode to set the serial-port to. Must be
- one of:
- 'x' for xon/xoff (software) mode
- 'h' for hardware flow control (RTS/CTS)
- 'n' for no flow control
- (Default: 'n')
-
- '--parity' or '-p'
- Defines the parity mode to set the serial-port to. Must be one of:
- 'o' for odd parity mode.
- 'e' for even parity mode.
- 'n' for no parity, mode.
- (Default: 'n')
-
- '--databits' or '-d'
- Defines the number of data bits in every character. Must be one of:
- 5, 6, 7, 8
- (Default: 8)
-
- '--escape' or '-e'
- Defines the character that will make picocom enter command-mode
- (see description above). If 'x' is given, then C-x will
- make picocom enter command mode.
- (Default: 'a')
-
- '--noinit' or '-i'
- If given, [picocom] will not initialize, reset, or otherwise
- meddle with the serial port at start-up. It will just open it. This
- is useful, for example, for connecting [picocom] to
- already-connected modems, or already configured ports without
- terminating the connection, or altering the settings. If required
- serial port parameters can then be adjusted at run-time by commands.
-
- '--noreset' or '-r'
- If given, [picocom] will not *reset* the serial port when
- exiting. It will just close the filedes and do nothing more. This is
- useful, for example, for leaving modems connected when exiting
- [picocom]. Regardless whether the "--noreset" option is given the
- user can exit [picocom] using the "Quit" command (instead of
- "Exit"), which never resets the serial port. If "--noreset" is given
- then "Quit" and "Exit" behave essentially the same.
-
- '--send-cmd' or '-s'
- Specifies the external program (and any arguments to it) that will
- be used for transmitting files.
- Default: "sz -vv"
-
- '--receive-cmd' or '-v'
- Specifies the external program (and any arguments to it) that will
- be used for receiving files.
- Default: "rz -vv"
-
- '--help' or '-h':
- Print a short help message describing the command-line options.
-
- ** Obtain [picocom]
-
- "picocom" can be downloaded from:
-
- http://efault.net/npat/hacks/picocom/
-
- ** Comments, request, and fixes:
-
- Please feel free to send comments, requests for new features (no
- promisses, though!), bug-fixes and rants, to the author's email
- address show at the top of this file.
-
-