1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Updated manual and regenerated docs

This commit is contained in:
Nick Patavalis
2017-12-20 11:11:14 +02:00
parent 89be292023
commit 0ec7213956
4 changed files with 177 additions and 133 deletions

View File

@ -27,10 +27,10 @@
<dd><p>Send the escape character to the serial port and return to &quot;transparent&quot; mode. This means that if the escape character (<strong>C-a</strong>, by default) is typed twice, the program sends the escape character to the serial port, and remains in transparent mode.</p>
</dd>
<dt><strong>C-x</strong></dt>
<dd><p>Exit the program: if the <strong>--noreset</strong> 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.</p>
<dd><p>Exit the program. If the <strong>--noreset</strong> option is <em>not</em> 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 <strong>--noreset</strong> is given, then the serial port settings are not reset, and the modem control lines remain unaffected.</p>
</dd>
<dt><strong>C-q</strong></dt>
<dd><p>Quit the program <em>without</em> resetting the serial port, regardless of the <strong>--noreset</strong> option.</p>
<dd><p>Quit the program <em>without</em> resetting the serial port, exactly as if the <strong>--noreset</strong> option was given.</p>
</dd>
<dt><strong>C-p</strong></dt>
<dd><p>Pulse the DTR line. Lower it for 1 sec, and then raise it again.</p>
@ -105,19 +105,20 @@
<dd><p>Defines the number of stop bits in every character. Must be one of: <strong>1</strong>, or <strong>2</strong>. (Default: <strong>1</strong>)</p>
</dd>
<dt><strong>--escape</strong> | <strong>-e</strong></dt>
<dd><p>Defines the character that will make picocom enter command-mode (see description above). If <strong>x</strong> is given, then <strong>C-x</strong> will make picocom enter command mode. (Default: <strong>a</strong>)</p>
<dd><p>Defines the character that will make picocom enter command-mode (see description above). If <strong>x</strong> is given, then <strong>C-x</strong> will make picocom enter command mode. See also the <strong>--no-escape</strong> option. (Default: <strong>a</strong>)</p>
</dd>
<dt><strong>--no-escape</strong> | <strong>-n</strong></dt>
<dd><p>Disables the escape character. Picocom will never enter command-mode if this option is enabled. To exit picocom, either close its standard input, or send it the TERM or INT signal. (Default: Disabled).</p>
<dd><p>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).</p>
</dd>
<dt><strong>--echo</strong> | <strong>-c</strong></dt>
<dd><p>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 <strong>--emap</strong> option). (Default: Disabled)</p>
</dd>
<dt><strong>--noinit</strong> | <strong>-i</strong></dt>
<dd><p>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. (Default: Disabled)</p>
<dd><p>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 <strong>--noreset</strong> option. (Default: Disabled)</p>
</dd>
<dt><strong>--noreset</strong> | <strong>-r</strong></dt>
<dd><p>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 <strong>--noreset</strong> option is given, the user can exit picocom using the &quot;Quit&quot; command (instead of &quot;Exit&quot;), which never resets the serial port. If <strong>--noreset</strong> is given then &quot;Quit&quot; and &quot;Exit&quot; behave essentially the same. (Default: Disabled)</p>
<dd><p>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 <em>not</em> be restored to their original values and the modem-control lines will <em>not</em> be affected. This is useful, for example, for leaving modems connected when exiting picocom. Regardless whether the <strong>--noreset</strong> option is given, the user can exit picocom using the &quot;Quit&quot; command (instead of &quot;Exit&quot;), which never resets the serial port (i.e makes picocom behave exactly as if <strong>--noreset</strong> was given). If <strong>--noreset</strong> is given then &quot;Quit&quot; and &quot;Exit&quot; behave essentially the same. (Default: Disabled)</p>
<p>NOTICE: Picocom will always set the HUPCL control bit of the serial port, according to the <strong>--noreset</strong> option. If <strong>--noreset</strong> is given, then HUPCL for the port is cleared, and will remain so after exiting picocom. If <strong>--noreset</strong> is <em>not</em> 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 <strong>--noinit</strong> option.</p>
</dd>
<dt><strong>--nolock</strong> | <strong>-l</strong></dt>
<dd><p>If given, picocom will <em>not</em> 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 <strong>flock(2)</strong>. 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 <strong>--nolock</strong> option is accepted, but has no effect. (Default: Disabled)</p>
@ -141,8 +142,8 @@
<dd><p>Use specified file for logging (recording) serial input, and possibly serial output. If the file exists, it is appended to. Every character read from the serial port is written to the specified file (before input mapping is performed). If local-echo mode is is enabled (see <strong>--echo</strong> option and <strong>C-c</strong> command), then every character written to the serial port (after output mapping is performed) is also logged to the same file. (Default: no logging)</p>
</dd>
<dt><strong>--initstring</strong> | <strong>-t</strong></dt>
<dd><p>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 <strong>--omap</strong> output mapping, the <strong>--echo</strong> local-echo setting, and the <strong>-emap</strong> local-echo mapping. This feature is useful, for example, if the serial device needs some special magic strings to start responding. Use <strong>echo(1)</strong> or <strong>xxd(1)</strong> to generate special characters like a CR or binary data. Example:</p>
<pre><code>picocom -t &quot;$(echo -e '\r\nATZ\r\n')&quot; /dev/ttsyS0</code></pre>
<dd><p>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 <strong>--omap</strong> output mapping, the <strong>--echo</strong> local-echo setting, and the <strong>--emap</strong> local-echo mapping. This feature is useful, for example, if the serial device needs some special magic strings to start responding. Use <strong>echo(1)</strong> or <strong>xxd(1)</strong> to generate special characters like a CR or binary data. Example:</p>
<pre><code>picocom -t &quot;$(echo -e 'AAATZ\r\n')&quot; /dev/ttyS0</code></pre>
<p>Note, that the init string is not sent if <strong>--noinit</strong> is set. (Default: empty).</p>
</dd>
<dt><strong>--lower-rts</strong></dt>
@ -152,11 +153,11 @@
<dd><p>Lower the DTR control signal after opening the serial port (by default DTR is raised after open). Only supported in Linux and OSX.</p>
</dd>
<dt><strong>--exit-aftrer</strong> | <strong>-x</strong></dt>
<dd><p>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 terminal. If <strong>--exit-after</strong> is set to zero, then picocom exits after opening and configuring the serial port, after sending the init string (if any, see option <strong>--initstring</strong>), and imediatelly when it becomes idle. When exiting after being idle, picocom observes the <strong>--noreset</strong> setting as usual. (Default: not set).</p>
<p>NOTICE: If <strong>--exit-after</strong> is set, reading zero bytes from the standard input (which usually means that whatever was connected there has been closed), will <em>not</em> 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 <strong>--exit-after</strong> is <em>not</em> set, then reading zero bytes from the standard input causes picocom to exit, after the contents of its output queue have been transmitted.</p>
<dd><p>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 <strong>--exit-after</strong> is set to zero, then picocom exits after opening and configuring the serial port, after sending the init string (if any, see option <strong>--initstring</strong>), 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 <strong>--noreset</strong> setting as usual. (Default: not set).</p>
<p>NOTICE: If <strong>--exit-after</strong> is set, reading zero bytes from the standard input (which usually means that whatever was connected there has been closed), will <em>not</em> cause picocom to exit. Instead, picocom will keep running, <em>without</em> reading from stdin, and will exit only when it becomes idle for the specified time, or if it is killed by a signal. If <strong>--exit-after</strong> is <em>not</em> set, then reading zero bytes from the standard input causes picocom to exit, after the contents of its output queue have been transmitted.</p>
</dd>
<dt><strong>--exit</strong> | <strong>-X</strong></dt>
<dd><p>Exit picocom immediatelly after opening and configuring the serial port. Do <em>not</em> read <em>anything</em> from the standard input or from the serial port. When exiting the <strong>--noreset</strong> option is observed as usual. With <strong>--exit</strong> and <strong>--noreset</strong> picocom can be used as a crude replacement of <strong>stty(1)</strong>. If an init string is also given (see <strong>--initstring</strong> option), picocom exits imediatelly after sending (writing) the init string to the serial port. Again, nothing is read from the standard input, or from the serial port. The ouput map (see <strong>--omap</strong>), the local echo option (see <strong>--echo</strong>), and the local-echo map (see <strong>--emap</strong>) are observed when sending the init string. The <strong>--exit</strong> option, overrides the <strong>--exit-after</strong> option. (Default: Disabled)</p>
<dd><p>Exit picocom immediatelly after opening and configuring the serial port. Do <em>not</em> read <em>anything</em> from the standard input or from the serial port. When exiting the <strong>--noreset</strong> option is observed as usual. With <strong>--exit</strong> and <strong>--noreset</strong> picocom can be used as a very crude replacement of <strong>stty(1)</strong>. If an init string is also given (see <strong>--initstring</strong> 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 <strong>--exit</strong> option, overrides the <strong>--exit-after</strong> option. (Default: Disabled)</p>
</dd>
<dt><strong>--quiet</strong> | <strong>-q</strong></dt>
<dd><p>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.</p>
@ -211,12 +212,12 @@
<h1 id="exiting-picocom">EXITING PICOCOM</h1>
<p>This section summarizes the conditions under which picocom terminates its operation and what happens on each such condition:</p>
<ul>
<li><p>The exit command is seen in the standard input. That is, the escape character is seen (default <strong>[C-a]</strong>), followed by the exit command character (default: <strong>[C-x]</strong>). In this case: The contents of the output queue are discarded and the contents of the O/S serial port output buffer (data already written to the port) are drained (i.e. picocom waits for them to be transmitted). Then, if the <strong>--noreset</strong> option is <em>not</em> given, the serial port is reset to the settings it had when picocom started, and picocom exits. If <strong>--noreset</strong> is given, then picocom exits without reseting the serial port.</p></li>
<li><p>The quit command is seen in the standard input. That is, the escape character is seen (default <strong>[C-a]</strong>), followed by the quit command character (default: <strong>[C-q]</strong>). The behavior in this case is similar to that of the exit command, with one difference: The serial port is <em>not</em> reset to its original settings, regardless of the <strong>--noreset</strong> option.</p></li>
<li><p>The exit command is seen in the standard input. That is, the escape character is seen (default <strong>C-a</strong>), followed by the exit command character (default <strong>C-x</strong>). 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 <strong>--noreset</strong> option is <em>not</em> 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 <strong>--noreset</strong> is given, then picocom exits without reseting the serial port and without affecting the modem control lines.</p></li>
<li><p>The quit command is seen in the standard input. That is, the escape character is seen (default <strong>C-a</strong>), followed by the quit command character (default <strong>C-q</strong>). The behavior in this case is similar to that of the exit command, with one difference: Picocom behaves as if the <strong>--noreset</strong> option is given (regardless if it actualy is, or not).</p></li>
<li><p>The <strong>--exit</strong> option is given. See the documentation of this option for a description of what exactly happens in this case.</p></li>
<li><p>The <strong>--exit-after</strong> option is given. See the documentation of this option for a description of what exactly happens in this case.</p></li>
<li><p>Zero bytes are read from the standard input. This usually means that whatever was connected to picocom's standard input has been closed or, if a file was connected, that picocom has read up to the end of the file. In this case, if the <strong>--exit-after</strong> option is not 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. When this happens, picocom waits for the O/S serial port output buffer to drain and then (subject to the <strong>--noreset</strong> option) resets the serial port to it's initial settings and exits. If the <strong>--exit-after</strong> 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 <strong>--noreset</strong> option as usual.</p></li>
<li><p>Picocom is killed by the TERM or INT signal. In this case picocom behaves as if it had received the exit command, that is: The contents of the output queue are discarded and the contents of the O/S serial port output buffer (data already written to the port) are drained (i.e. picocom waits for them to be transmitted). Then, if the <strong>--noreset</strong> option is <em>not</em> given, the serial port is reset to the settings it had when picocom started, and picocom exits. If <strong>--noreset</strong> is given, then picocom exits without reseting the serial port.</p></li>
<li><p>Zero bytes are read from the standard input. This usually means that whatever was connected to picocom's standard input has been closed or, if a file was connected, that picocom has read up to the end of the file. In this case, if the <strong>--exit-after</strong> option is <em>not</em> 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. When this happens, picocom waits for the O/S serial port output buffer to drain and then (subject to the <strong>--noreset</strong> option) resets the serial port to it's initial settings, clears the modem-control lines, and exits. If the <strong>--exit-after</strong> 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 <strong>--noreset</strong> option as usual.</p></li>
<li><p>Picocom is killed by the TERM or INT signal. 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 <strong>--noreset</strong> option is <em>not</em> given, the serial port is reset to the settings it had when picocom started, the modem control lines are cleared, and picocom exits. If <strong>--noreset</strong> is given, then picocom exits without reseting the serial port or affecting the modem control lines.</p></li>
</ul>
<h1 id="author">AUTHOR</h1>
<p>Written by Nick Patavalis <script type="text/javascript">