diff --git a/Makefile b/Makefile index 6309e79..d5253a6 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ doc : picocom.1.html picocom.1 picocom.1.pdf picocom.1 : picocom.1.md sed 's/\*\*\[/\*\*/g;s/\]\*\*/\*\*/g' $? \ | pandoc -s -t man \ - -Vfooter="Picocom $(VERSION)" -Vdate="`date -I`" \ + -Vfooter="Picocom $(VERSION)" -Vdate="`date -I`" \ -Vadjusting='l' \ -Vhyphenate='' \ -o $@ @@ -74,9 +74,9 @@ picocom.1.html : picocom.1.md pandoc -s -t html \ --template ~/.pandoc/tmpl/manpage.html \ -c ~/.pandoc/css/normalize-noforms.css \ - -c ~/.pandoc/css/manpage.css \ - --self-contained \ - -Vversion="v$(VERSION)" -Vdate="`date -I`" \ + -c ~/.pandoc/css/manpage.css \ + --self-contained \ + -Vversion="v$(VERSION)" -Vdate="`date -I`" \ -o $@ $? picocom.1.pdf : picocom.1 diff --git a/picocom.1 b/picocom.1 index ac497d2..60f5d62 100644 --- a/picocom.1 +++ b/picocom.1 @@ -1,7 +1,8 @@ .\" Automatically generated by Pandoc 1.16.0.2 .\" -.TH "PICOCOM" "1" "2017-12-20" "Picocom 2.3a" "User Commands" -.hy +.ad l +.TH "PICOCOM" "1" "2017-12-21" "Picocom 3.0a" "User Commands" +.nh \" Turn off hyphenation by default. .SH NAME .PP picocom \- minimal dumb\-terminal emulation program @@ -62,15 +63,24 @@ Exit the program. If the \f[B]\-\-noreset\f[] option is \f[I]not\f[] given, then the serial port is reset to its original settings before exiting, and the modem control lines (typically DTR and RTS) are cleared (lowered) -signaling a modem hangup; if \f[B]\-\-noreset\f[] is given, then the -serial port settings are not reset, and the modem control lines remain -unaffected. +signaling a modem hangup. +If \f[B]\-\-noreset\f[] is given (and \f[B]\-\-hangup\f[] is not), then +the serial port settings are not reset, and the modem control lines +remain unaffected. +If both \f[B]\-\-noreset\f[] and \f[B]\-\-hangup\f[] are given, then the +serial port settings are not reset, but the modem\-control lines +\f[I]are\f[] cleared. .RS .RE .TP .B \f[B]C\-q\f[] -Quit the program \f[I]without\f[] resetting the serial port, exactly as +Quit the program \f[I]without\f[] resetting the serial port to its +original settings. +Terminating with the Quit command, picocom behaves \f[I]exactly\f[] as if the \f[B]\-\-noreset\f[] option was given. +The serial port is \f[I]not\f[] reset to its original settings, and the +modem control lines remain unaffected or are cleared, subject to the +\f[B]\-\-hangup\f[] option. .RS .RE .TP @@ -246,9 +256,9 @@ See also the \f[B]\-\-no\-escape\f[] option. .TP .B \f[B]\-\-no\-escape\f[] | \f[B]\-n\f[] Disables the escape character. -Picocom will never enter command\-mode if this option is enabled. -To exit picocom, you must either close its standard input, or send it -the TERM or INT signal. +Picocom will never enter command\-mode if this option is given. +To exit picocom, in this case, you must either close its standard input, +or send it the TERM or INT signal. (Default: Disabled). .RS .RE @@ -263,15 +273,15 @@ configuration (see \f[B]\-\-emap\f[] option). .RE .TP .B \f[B]\-\-noinit\f[] | \f[B]\-i\f[] -If given, picocom will not initialize, configure, or otherwise meddle -with the serial port at start\-up. +If given, picocom will not initialize, configure, or otherwise mess 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 their settings. If required, serial port parameters can then be adjusted at run\-time by commands. -See also the \f[B]\-\-noreset\f[] option. +See also the \f[B]\-\-noreset\f[] and \f[B]\-\-hangup\f[] options. (Default: Disabled) .RS .RE @@ -280,29 +290,43 @@ See also the \f[B]\-\-noreset\f[] option. If given, picocom will not reset the serial port when exiting. It will just close the respective file descriptor and do nothing more. The serial port settings will \f[I]not\f[] be restored to their original -values and the modem\-control lines will \f[I]not\f[] be affected. +values and, unless the \f[B]\-\-hangup\f[] option is also given, the +modem\-control lines will \f[I]not\f[] be affected. This is useful, for example, for leaving modems connected when exiting picocom. Regardless whether the \f[B]\-\-noreset\f[] option is given, the user can exit picocom using the "Quit" command (instead of "Exit"), which -never resets the serial port (i.e makes picocom behave exactly as if -\f[B]\-\-noreset\f[] was given). -If \f[B]\-\-noreset\f[] is given then "Quit" and "Exit" behave -essentially the same. +makes picocom behave \f[I]exactly\f[] as if \f[B]\-\-noreset\f[] was +given. +See also the \f[B]\-\-hangup\f[] option. (Default: Disabled) .RS .PP NOTICE: Picocom will always set the HUPCL control bit of the serial -port, according to the \f[B]\-\-noreset\f[] option. -If \f[B]\-\-noreset\f[] is given, then HUPCL for the port is cleared, -and will remain so after exiting picocom. -If \f[B]\-\-noreset\f[] is \f[I]not\f[] given, then HUPCL is set for the -port, and will remain so after exiting picocom. +port, according to the \f[B]\-\-noreset\f[] and \f[B]\-\-hangup\f[] +options. +If \f[B]\-\-noreset\f[] is given and \f[B]\-\-hangup\f[] is not, then +HUPCL for the port is cleared and will remain so after exiting picocom. +If \f[B]\-\-noreset\f[] is \f[I]not\f[] given, or if both +\f[B]\-\-noreset\f[] and \f[B]\-\-hangup\f[] are given, then HUPCL is +set for the port, and will remain so after exiting picocom. This is true, regardless of the way picocom terminates (command, read zero\-bytes from standard input, killed by signal, fatal error, etc), and regardless of the \f[B]\-\-noinit\f[] option. .RE .TP +.B \f[B]\-\-hangup\f[] | \f[B]\-u\f[] +If given together with \f[B]\-\-noreset\f[], picocom will not reset the +serial port to it\[aq]s original settings on exit, but it \f[I]will\f[] +clear the modem control lines (typically DTR and RTS) to signal a modem +hangup. +Without the \f[B]\-\-noreset\f[] option (explicitly given, or implied by +extiting with the "Quit" command) \f[B]\-\-hangup\f[] has no effect +(without \f[B]\-\-noreset\f[] picocom always clears the modem control +lines on exit, anyway). +.RS +.RE +.TP .B \f[B]\-\-nolock\f[] | \f[B]\-l\f[] If given, picocom will \f[I]not\f[] attempt to lock the serial port before opening it. @@ -393,11 +417,11 @@ Example: .IP .nf \f[C] -picocom\ \-t\ "$(echo\ \-e\ \[aq]AAATZ\\r\\n\[aq])"\ /dev/ttyS0 +picocom\ \-t\ "$(echo\ \-ne\ \[aq]AAATZ\\r\\n\[aq])"\ /dev/ttyS0 \f[] .fi .PP -Note, that the init string is not sent if \f[B]\-\-noinit\f[] is set. +Note, that the init string is not sent if \f[B]\-\-noinit\f[] is given. (Default: empty). .RE .TP @@ -425,12 +449,13 @@ serial port, AND there is nothing to write (send) to the serial port, AND nothing is read from the standard input (terminal). If \f[B]\-\-exit\-after\f[] is set to zero, then picocom exits after opening and configuring the serial port, after sending the init string -(if any, see option \f[B]\-\-initstring\f[]), and imediatelly when it +(if any, see option \f[B]\-\-initstring\f[]) and imediatelly when it becomes idle. When exiting after being idle, picocom drains the O/S serial port ouput buffer (i.e. waits for data already written to the port to be transmitted) and -observes the \f[B]\-\-noreset\f[] setting as usual. +observes the \f[B]\-\-noreset\f[] and \f[B]\-\-hangup\f[] options as +usual. (Default: not set). .RS .PP @@ -449,15 +474,15 @@ its output queue have been transmitted. Exit picocom immediatelly after opening and configuring the serial port. Do \f[I]not\f[] read \f[I]anything\f[] from the standard input or from the serial port. -When exiting the \f[B]\-\-noreset\f[] option is observed as usual. -With \f[B]\-\-exit\f[] and \f[B]\-\-noreset\f[] picocom can be used as a -very crude replacement of \f[B]stty(1)\f[]. +When exiting the \f[B]\-\-noreset\f[] and \f[B]\-\-hangup\f[] options +are observed as usual. +With \f[B]\-\-exit\f[] and \f[B]\-\-noreset\f[] (and possibly +\f[B]\-\-hangup\f[]) picocom can be used as a very crude replacement of +\f[B]stty(1)\f[]. If an init string is also given (see \f[B]\-\-initstring\f[] option), picocom exits imediatelly after sending (writing) the init string to the -serial port. -In this case, before exiting, picocom drains the O/S serial port output -buffer (i.e. -waits for data written to the port to be transmitted). +serial port and draining the O/S serial port output buffer (i.e. +waiting for data written to the port to be transmitted). Again, nothing is read from the standard input, or from the serial port. The \f[B]\-\-exit\f[] option, overrides the \f[B]\-\-exit\-after\f[] option. @@ -644,8 +669,8 @@ Replace every CR character with CR and LF when echoing to the terminal (if local\-echo is enabled). .SH EXITING PICOCOM .PP -This section summarizes the conditions under which picocom terminates -its operation and what happens on each such condition: +This section summarizes the conditions in which picocom terminates its +operation and what happens in each such condition: .IP \[bu] 2 The exit command is seen in the standard input. That is, the escape character is seen (default \f[B]C\-a\f[]), followed @@ -654,13 +679,10 @@ In this case: The contents of the output queue (data read from the standard input, but not yet written to the port) as well as the contents of the O/S serial port output buffer (data already written to the port, but not yet transmitted) are discarded (flushed). -Then, if the \f[B]\-\-noreset\f[] option is \f[I]not\f[] given, the -serial port is reset to the settings it had when picocom started, and -the modem control lines (typically DTR and RTS) are cleared (lowered), -signaling a modem hangup. -Picocom then exits. -If \f[B]\-\-noreset\f[] is given, then picocom exits without reseting -the serial port and without affecting the modem control lines. +Then the serial port is reset to it\[aq]s original settings, and the +modem\-control lines are cleared signaling a modem reset, subject to the +\f[B]\-\-noreset\f[] and the \f[B]\-\-hangup\f[] options. +After that picocom exits with a success status. .IP \[bu] 2 The quit command is seen in the standard input. That is, the escape character is seen (default \f[B]C\-a\f[]), followed @@ -672,40 +694,40 @@ given (regardless if it actualy is, or not). The \f[B]\-\-exit\f[] option is given. See the documentation of this option for a description of what exactly happens in this case. +Picocom exits with a success exit status. .IP \[bu] 2 The \f[B]\-\-exit\-after\f[] option is given. See the documentation of this option for a description of what exactly happens in this case. +Picocom exits with a success exit status. .IP \[bu] 2 Zero bytes are read from the standard input. This usually means that whatever was connected to picocom\[aq]s standard -input has been closed or, if a file was connected, that picocom has read +input has been closed or, if a file was connected, then picocom has read up to the end of the file. In this case, if the \f[B]\-\-exit\-after\f[] option is \f[I]not\f[] given, picocom stops reading from the standard input, and keeps operating normally (i.e. -writing to, and reading from, the serial port) until its output queue is -emptied. +writing to, and reading from, the serial port) until its output queue +empties. When this happens, picocom waits for the O/S serial port output buffer -to drain and then (subject to the \f[B]\-\-noreset\f[] option) resets -the serial port to it\[aq]s initial settings, clears the modem\-control -lines, and exits. +to drain and then (subject to the \f[B]\-\-noreset\f[] and +\f[B]\-\-hangup\f[] options) resets the serial port to it\[aq]s initial +settings, clears the modem\-control lines, and exits. If the \f[B]\-\-exit\-after\f[] option is given then, again, picocom stops reading from the standard input and continues operating normally but, in this case, it does so until it becomes idle for the specified -amount of time. -It then waits for the O/S serial port output buffer to drain and exits, -observing the \f[B]\-\-noreset\f[] option as usual. +amount of time, before exiting. +Picocom exits with a success exit status. .IP \[bu] 2 -Picocom is killed by the TERM or INT signal. +Picocom is killed by the TERM or INT signal, or an unrecoverable error +occurs. In this case picocom behaves as if it had received the exit command, that is: The contents of the output queue and the contents of the O/S serial port output buffer are discarded (flushed). -Then, if the \f[B]\-\-noreset\f[] option is \f[I]not\f[] given, the -serial port is reset to the settings it had when picocom started, the -modem control lines are cleared, and picocom exits. -If \f[B]\-\-noreset\f[] is given, then picocom exits without reseting -the serial port or affecting the modem control lines. +Then, subject to the \f[B]\-\-noreset\f[] and \f[B]\-\-hangup\f[] +options, the serial port is reset to its original settings, the modem +control lines are cleared, and picocom exits with a failure status. .SH AUTHOR .PP Written by Nick Patavalis diff --git a/picocom.1.html b/picocom.1.html index 15d76ff..8075129 100644 --- a/picocom.1.html +++ b/picocom.1.html @@ -7,11 +7,11 @@ PICOCOM(1) - +

NAME

picocom - minimal dumb-terminal emulation program

@@ -27,10 +27,10 @@

Send the escape character to the serial port and return to "transparent" mode. This means that if the escape character (C-a, by default) is typed twice, the program sends the escape character to the serial port, and remains in transparent mode.

C-x
-

Exit the program. If the --noreset option is not given, then the serial port is reset to its original settings before exiting, and the modem control lines (typically DTR and RTS) are cleared (lowered) signaling a modem hangup; if --noreset is given, then the serial port settings are not reset, and the modem control lines remain unaffected.

+

Exit the program. If the --noreset option is not given, then the serial port is reset to its original settings before exiting, and the modem control lines (typically DTR and RTS) are cleared (lowered) signaling a modem hangup. If --noreset is given (and --hangup is not), then the serial port settings are not reset, and the modem control lines remain unaffected. If both --noreset and --hangup are given, then the serial port settings are not reset, but the modem-control lines are cleared.

C-q
-

Quit the program without resetting the serial port, exactly as if the --noreset option was given.

+

Quit the program without resetting the serial port to its original settings. Terminating with the Quit command, picocom behaves exactly as if the --noreset option was given. The serial port is not reset to its original settings, and the modem control lines remain unaffected or are cleared, subject to the --hangup option.

C-p

Pulse the DTR line. Lower it for 1 sec, and then raise it again.

@@ -108,17 +108,20 @@

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. See also the --no-escape option. (Default: a)

--no-escape | -n
-

Disables the escape character. Picocom will never enter command-mode if this option is enabled. To exit picocom, you must either close its standard input, or send it the TERM or INT signal. (Default: Disabled).

+

Disables the escape character. Picocom will never enter command-mode if this option is given. To exit picocom, in this case, you must either close its standard input, or send it the TERM or INT signal. (Default: Disabled).

--echo | -c

Enable local echo. Every character being read from the terminal (standard input) is echoed to the terminal (standard output) subject to the echo-mapping configuration (see --emap option). (Default: Disabled)

--noinit | -i
-

If given, picocom will not initialize, configure, 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 their settings. If required, serial port parameters can then be adjusted at run-time by commands. See also the --noreset option. (Default: Disabled)

+

If given, picocom will not initialize, configure, or otherwise mess 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 their settings. If required, serial port parameters can then be adjusted at run-time by commands. See also the --noreset and --hangup options. (Default: Disabled)

--noreset | -r
-

If given, picocom will not reset the serial port when exiting. It will just close the respective file descriptor and do nothing more. The serial port settings will not be restored to their original values and the modem-control lines will not be affected. 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 (i.e makes picocom behave exactly as if --noreset was given). If --noreset is given then "Quit" and "Exit" behave essentially the same. (Default: Disabled)

-

NOTICE: Picocom will always set the HUPCL control bit of the serial port, according to the --noreset option. If --noreset is given, then HUPCL for the port is cleared, and will remain so after exiting picocom. If --noreset is not given, then HUPCL is set for the port, and will remain so after exiting picocom. This is true, regardless of the way picocom terminates (command, read zero-bytes from standard input, killed by signal, fatal error, etc), and regardless of the --noinit option.

+

If given, picocom will not reset the serial port when exiting. It will just close the respective file descriptor and do nothing more. The serial port settings will not be restored to their original values and, unless the --hangup option is also given, the modem-control lines will not be affected. 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 makes picocom behave exactly as if --noreset was given. See also the --hangup option. (Default: Disabled)

+

NOTICE: Picocom will always set the HUPCL control bit of the serial port, according to the --noreset and --hangup options. If --noreset is given and --hangup is not, then HUPCL for the port is cleared and will remain so after exiting picocom. If --noreset is not given, or if both --noreset and --hangup are given, then HUPCL is set for the port, and will remain so after exiting picocom. This is true, regardless of the way picocom terminates (command, read zero-bytes from standard input, killed by signal, fatal error, etc), and regardless of the --noinit option.

+
+
--hangup | -u
+

If given together with --noreset, picocom will not reset the serial port to it's original settings on exit, but it will clear the modem control lines (typically DTR and RTS) to signal a modem hangup. Without the --noreset option (explicitly given, or implied by extiting with the "Quit" command) --hangup has no effect (without --noreset picocom always clears the modem control lines on exit, anyway).

--nolock | -l

If given, picocom will not attempt to lock the serial port before opening it. Normally, depending on how it's compiled, picocom attempts to get a UUCP-style lock-file (e.g. '/var/lock/LCK..ttyS0') before opening the port, or attempts to lock the port device-node using flock(2). Failing to do so, results in the program exiting after emitting an error-message. It is possible that your picocom binary is compiled without support for locking. In this case the --nolock option is accepted, but has no effect. (Default: Disabled)

@@ -143,8 +146,8 @@
--initstring | -t

Send the provided string after opening and configuring the serial port. The init string is sent exactly as if it was input at the terminal. Sending the init string, picocom observes the --omap output mapping, the --echo local-echo setting, and the --emap local-echo mapping. This feature is useful, for example, if the serial device needs some special magic strings to start responding. Use echo(1) or xxd(1) to generate special characters like a CR or binary data. Example:

-
picocom -t "$(echo -e 'AAATZ\r\n')" /dev/ttyS0
-

Note, that the init string is not sent if --noinit is set. (Default: empty).

+
picocom -t "$(echo -ne 'AAATZ\r\n')" /dev/ttyS0
+

Note, that the init string is not sent if --noinit is given. (Default: empty).

--lower-rts

Lower the RTS control signal after opening the serial port (by default RTS is raised after open). Only supported when flow-control mode is not set to RTS/CTS, ignored otherwise. Only supported in Linux and OSX.

@@ -153,11 +156,11 @@

Lower the DTR control signal after opening the serial port (by default DTR is raised after open). Only supported in Linux and OSX.

--exit-aftrer | -x
-

Exit picocom if it remains idle for the specified time (in milliseconds). Picocom is considered idle if: Nothing is read (received) from the serial port, AND there is nothing to write (send) to the serial port, AND nothing is read from the standard input (terminal). If --exit-after is set to zero, then picocom exits after opening and configuring the serial port, after sending the init string (if any, see option --initstring), and imediatelly when it becomes idle. When exiting after being idle, picocom drains the O/S serial port ouput buffer (i.e. waits for data already written to the port to be transmitted) and observes the --noreset setting as usual. (Default: not set).

+

Exit picocom if it remains idle for the specified time (in milliseconds). Picocom is considered idle if: Nothing is read (received) from the serial port, AND there is nothing to write (send) to the serial port, AND nothing is read from the standard input (terminal). If --exit-after is set to zero, then picocom exits after opening and configuring the serial port, after sending the init string (if any, see option --initstring) and imediatelly when it becomes idle. When exiting after being idle, picocom drains the O/S serial port ouput buffer (i.e. waits for data already written to the port to be transmitted) and observes the --noreset and --hangup options as usual. (Default: not set).

NOTICE: If --exit-after is set, reading zero bytes from the standard input (which usually means that whatever was connected there has been closed), will not cause picocom to exit. Instead, picocom will keep running, without reading from stdin, and will exit only when it becomes idle for the specified time, or if it is killed by a signal. If --exit-after is not set, then reading zero bytes from the standard input causes picocom to exit, after the contents of its output queue have been transmitted.

--exit | -X
-

Exit picocom immediatelly after opening and configuring the serial port. Do not read anything from the standard input or from the serial port. When exiting the --noreset option is observed as usual. With --exit and --noreset picocom can be used as a very crude replacement of stty(1). If an init string is also given (see --initstring option), picocom exits imediatelly after sending (writing) the init string to the serial port. In this case, before exiting, picocom drains the O/S serial port output buffer (i.e. waits for data written to the port to be transmitted). Again, nothing is read from the standard input, or from the serial port. The --exit option, overrides the --exit-after option. (Default: Disabled)

+

Exit picocom immediatelly after opening and configuring the serial port. Do not read anything from the standard input or from the serial port. When exiting the --noreset and --hangup options are observed as usual. With --exit and --noreset (and possibly --hangup) picocom can be used as a very crude replacement of stty(1). If an init string is also given (see --initstring option), picocom exits imediatelly after sending (writing) the init string to the serial port and draining the O/S serial port output buffer (i.e. waiting for data written to the port to be transmitted). Again, nothing is read from the standard input, or from the serial port. The --exit option, overrides the --exit-after option. (Default: Disabled)

--quiet | -q

Forces picocom to be quiet. Suppresses the output of the initial status and options information, as well as any other information or messages not explicitly requested by the user. Responses to user commands and any error or warning messages are still printed.

@@ -210,14 +213,14 @@
  • Replace every CR character with CR and LF when echoing to the terminal (if local-echo is enabled).

  • EXITING PICOCOM

    -

    This section summarizes the conditions under which picocom terminates its operation and what happens on each such condition:

    +

    This section summarizes the conditions in which picocom terminates its operation and what happens in each such condition:

    AUTHOR

    Written by Nick Patavalis