Date: Sun, 23 Jun 1996 12:31:00 -0600 From: Sean Kelly <kelly@fsl.noaa.gov> To: doc@freebsd.org Subject: Updates to printing.sgml Message-ID: <199606231830.SAA02226@gatekeeper.fsl.noaa.gov>
next in thread | raw e-mail | index | archive | help
Here are some diffs for printing.sgml that correct a spelling error, describe the new bps rates suported by LPD, and (much more importantly) document the new termios/stty-like tty modes for LPD added by Sean Eric Fagan. I diff'ed my version with that from the latest version in CVS from this morning. Of course I'd like to hear your comments on these changes! --- /tmp/printing.sgml Sun Jun 23 11:55:54 1996 +++ printing.sgml Sun Jun 23 11:56:21 1996 @@ -26,7 +26,7 @@ In order to use printers with FreeBSD, you will need to set them up to work with the Berkeley line printer spooling - system, also known as the LPD spooling system. It iss the + system, also known as the LPD spooling system. It is the standard printer control system in FreeBSD. This section introduces the LPD spooling system, often simply called LPD. @@ -851,10 +851,18 @@ <tt>/etc/printcap</tt> file using the <tt/lp/ capability. - In our running example, let us assume that <tt/rattan/ is - on the first parallel port, and <tt/bamboo/ is on a - sixth serial port; here are the additions to - <tt>/etc/printcap</tt>: + LPD opens the device in the <tt/lp/ capability in + write-only mode. To enable the spooling system to also + read data from the printer, specify the <tt/rw/ + capability. + + In our running example, let us assume that <tt/rattan/ + is on the first parallel port, and <tt/bamboo/ is on a + sixth serial port. Also, because <tt/rattan/ is a + PostScript printer and is capable of producing status + messages, we want to open the port in both <em/read and + write/ mode by using the <tt/rw/ capability. Here are + the additions to <tt>/etc/printcap</tt>: <code> # # /etc/printcap for host rose - identified what devices to use @@ -865,7 +873,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:\ - :lp=/dev/ttyd5: + :lp=/dev/ttyd5:rw: </code> If you do not specify the <tt/lp/ capability for a @@ -905,50 +913,40 @@ Sets the communications speed of the device to <it/bps-rate/, where <it/bps-rate/ can be 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, - 4800, 9600, 19200, or 38400 bits-per-second. - - <tag/<tt>fc#<it/clear-bits/</tt>/ - - Clears the flag bits <it/clear-bits/ in the - <tt/sgttyb/ structure after opening the device. - - <tag/<tt>fs#<it/set-bits/</tt>/ + 4800, 9600, 19200, 38400, 57600, or 115200 + bits-per-second. - Sets the flag bits <it/set-bits/ in the <tt/sgttyb/ - structure. + <tag/<tt>ms=<it/stty-modes/</tt>/ - <tag/<tt>xc#<it/clear-bits/</tt>/ + Sets termios communications parameters using a + comma-separated list of identifiers compatible with + the stty command. See the termios(4) and the + stty(1) manual pages for more information. - Clears local mode bits <it/clear-bits/ after opening - the device. - - <tag/<tt>xs#<it/set-bits/</tt>/ - - Sets local mode bits <it/set-bits/. </descrip> - For more information on the bits for the <tt/fc/, - <tt/fs/, <tt/xc/, and <tt/xs/ capabilities, see the file - <tt>/usr/include/sys/ioctl_compat.h</tt>. - - When LPD opens the device specified by the <tt/lp/ - capability, it reads the flag bits in the <tt/sgttyb/ - structure; it clears any bits in the <tt/fc/ capability, - then sets bits in the <tt/fs/ capability, then applies - the resultant setting. It does the same for the local - mode bits as well. + You use these two capabilities to set up all of a serial + device's communications parameters. First, LPD sets the + bps rate with the number you specify in the <tt/br/ + capability. Then, starting with the device's current + parameters as a default, it sets the options you specify + in the <tt/ms/ capability. Let us add to our example printer on the sixth serial - port. We will set the bps rate to 38400. For the flag - bits, we will set the TANDEM, ANYP, LITOUT, FLUSHO, and - PASS8 flags. For the local mode bits, we will set the - LITOUT and PASS8 flags: + port. We will set the bps rate to 38400. We will set the + communications parameters to 8 bits, 1 stop bit, and no + parity. We will use XON/XOFF (software) flow control on a + local line without modem control and enable the + receiver. We will not post-process the output. We will not + echo any character received from the printer as that will + definitely corrupt the printouts. + <tscreen><verb> bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:\ - :lp=/dev/ttyd5:fs#0x82000c1:xs#0x820: + :lp=/dev/ttyd5:rw:\ + :ms=cs8,-cstopb,-parenb,ixon,ixoff,cread,clocal,-opost,-echo,-echonl: </verb></tscreen> - <sect3><heading>Installing the Text Filter<label id="printing:textfilter"></heading> @@ -1011,7 +1009,8 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:\ - :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:\ + :lp=/dev/ttyd5:rw:\ + :ms=cs8,-cstopb,-parenb,ixon,ixoff,cread,clocal,-opost,-echo,-echonl:\ :if=/usr/local/libexec/if-simple: </code> @@ -1158,9 +1157,10 @@ <item>Have FreeBSD's serial line driver automatically convert LF to CR+LF. Of course, this works with printers on serial ports - <em/only/. To enable this feature, set the - CRMOD bit in <tt/fs/ capability in the - <tt>/etc/printcap</tt> file for the printer. + <em/only/. To enable this feature, add the + <tt/opost/ and <tt/onlcr/ options to the <tt/ms/ + capability in in the entry for the printer in + the <tt>/etc/printcap</tt> file. <item>Send an <em/escape code/ to the printer to have it temporarily treat LF characters @@ -1238,25 +1238,35 @@ The problem is that the printer cannot keep up with the speed at which the computer sends data over a serial line. (This problem should not occur with - printers on parallel ports.) There are two ways to - overcome the problem: + printers on parallel ports.) If the printer + supports some kind of data <em/flow control/, have + FreeBSD use it: <itemize> - <item>If the printer supports XON/XOFF flow - control, have FreeBSD use it by specifying the - TANDEM bit in the <tt/fs/ capability. + <item>If the printer supports XON/XOFF (software) + flow control, specify the <tt/ixon/ and + <tt/ixoff/ options in the <tt/ms/ capability in + the entry for the printer in the + <tt>/etc/printcap</tt> file. + + <item>If the printer supports RTS/CTS flow + control, specify the <tt/crtscts/ option in the + <tt/ms/ capability. + + <item>If the printer supports DSR flow control, + specify the <tt/dsrflow/ option in the <tt/ms/ + capability. <item>If the printer supports carrier flow - control, specify the MDMBUF bit in the <tt/fs/ - capability. Make sure the cable connecting the - printer to the computer is correctly wired for - carrier flow control. - - <item>If the printer does not support any flow - control, use some combination of the NLDELAY, - TBDELAY, CRDELAY, VTDELAY, and BSDELAY bits in - the <tt/fs/ capability to add appropriate delays - to the stream of data sent to the printer. + control, specify the <tt/mdmbuf/ option in the + <tt/ms/ capability. </itemize> + + For the last three flow control options, make sure + the cable connecting the printer to the computer is + correctly wired. + + If the printer has no flow control feature, try + using a lower bps rate. <tag/It printed garbage./ @@ -1266,10 +1276,9 @@ This is usually another symptom of incorrect communications parameters with a serial printer. Double-check the bps rate in the <tt/br/ capability, - and the parity bits in the <tt/fs/ and <tt/fc/ - capabilities; make sure the printer is using the - same settings as specified in the - <tt>/etc/printcap</tt> file. + and the parity options in the <tt/ms/ capability; + make sure the printer is using the same settings as + specified in the <tt>/etc/printcap</tt> file. <tag/Nothing happened./ @@ -2323,7 +2332,8 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:\ - :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\ + :lp=/dev/ttyd5:rw:\ + :ms=cs8,-cstopb,-parenb,ixon,ixoff,cread,clocal,-opost,-echo,-echonl:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: </code> @@ -3321,7 +3331,8 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:sc:\ - :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\ + :lp=/dev/ttyd5:rw:\ + :ms=cs8,-cstopb,-parenb,ixon,ixoff,cread,clocal,-opost,-echo,-echonl:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: </code> @@ -3393,7 +3404,8 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:sc:rg=artists:\ - :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\ + :lp=/dev/ttyd5:rw:\ + :ms=cs8,-cstopb,-parenb,ixon,ixoff,cread,clocal,-opost,-echo,-echonl:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: </code> @@ -3451,7 +3463,8 @@ # bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:sc:rg=artists:mx#5000:\ - :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\ + :lp=/dev/ttyd5:rw:\ + :ms=cs8,-cstopb,-parenb,ixon,ixoff,cread,clocal,-opost,-echo,-echonl:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: </code> @@ -3524,7 +3537,8 @@ <tscreen><verb> bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:sc:rg=artists:mx#5000:\ - :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:mx#5000:\ + :lp=/dev/ttyd5:rw:\ + :ms=cs8,-cstopb,-parenb,ixon,ixoff,cread,clocal,-opost,-echo,-echonl:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: </verb></tscreen> -- Sean Kelly NOAA Forecast Systems Laboratory kelly@fsl.noaa.gov Boulder Colorado USA http://www-sdd.fsl.noaa.gov/~kelly/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606231830.SAA02226>