1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 3<html> 4 <head> 5 <meta name="generator" content="HTML Tidy, see www.w3.org"> 6 <title>Serial Printers</title> 7 <meta name="GENERATOR" content= 8 "Modular DocBook HTML Stylesheet Version 1.7"> 9 <link rel="HOME" title=" LPRng Reference Manual" href= 10 "index.htm"> 11 <link rel="UP" title="Printer Communication and Protocols " 12 href="printercomm.htm"> 13 <link rel="PREVIOUS" title="Parallel Port Printers" href= 14 "x5262.htm"> 15 <link rel="NEXT" title="Printcap Database " href= 16 "printcapref.htm"> 17 </head> 18 19 <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link= 20 "#0000FF" vlink="#840084" alink="#0000FF"> 21 <div class="NAVHEADER"> 22 <table summary="Header navigation table" width="100%" border= 23 "0" cellpadding="0" cellspacing="0"> 24 <tr> 25 <th colspan="3" align="center">LPRng Reference Manual: 5 26 Sep 2003 (For LPRng-3.8.22)</th> 27 </tr> 28 29 <tr> 30 <td width="10%" align="left" valign="bottom"><a href= 31 "x5262.htm" accesskey="P">Prev</a></td> 32 33 <td width="80%" align="center" valign="bottom">Chapter 34 11. Printer Communication and Protocols</td> 35 36 <td width="10%" align="right" valign="bottom"><a href= 37 "printcapref.htm" accesskey="N">Next</a></td> 38 </tr> 39 </table> 40 <hr align="LEFT" width="100%"> 41 </div> 42 43 <div class="SECT1"> 44 <h1 class="SECT1"><a name="SECSERIAL">11.12. Serial 45 Printers</a></h1> 46 47 <p>If your printer is attached by a serial line, then you may 48 need to set the serial line characteristics before sending 49 the job to the printer. Here are a set of guidelines to 50 following when attaching a serial port printer to a serial 51 line.</p> 52 53 <p>1. Check to make sure that the line is not enabled for 54 login. Logins are usually managed by the <b class= 55 "APPLICATION">getty</b> (BSD) or <b class= 56 "APPLICATION">ttymon</b> (Solaris, SystemV). Check your 57 system documentation and make sure that these daemons are not 58 managing the serial line.</p> 59 60 <p>2. Check the permissions and ownership of the serial line. 61 For the most easy testing, set the permissions to 0666 62 (everybody can open for reading and writing). After you have 63 made sure that you can send jobs to the printer, you might 64 want to change the ownership of the serial line to the <b 65 class="APPLICATION">lpd</b> server and change the permissions 66 to 0600.</p> 67 68 <p>3. Make sure that you can print a test file on the printer 69 via the serial port. This may require setting the line 70 characteristics and then sending a file to the printer. You 71 should try to use 8 bit, no parity, with hardware flow 72 control and no special character interpretation, and 73 definitely no LF to CR/LF translation. The problem is that 74 different versions of UNIX systems have different sets of 75 stty(1) commands to do this. The following simple test script 76 can help in this.</p> 77 78 <div class="INFORMALEXAMPLE"> 79 <a name="AEN5320"></a> 80<pre class="SCREEN"> 81 #!/bin/sh 82 # 9600, no echo, no CR 83 FLAGS= 9600 -raw -parenb cs8 crtscts 84 DEV= /dev/tty01 85 (stty $FLAGS; stty 1>&2; cat $1 ) <$DEV >$DEV 86</pre> 87 </div> 88 <br> 89 <br> 90 91 <p>This shows using stty to set the flags, then to print the 92 current settings, and then using cat a file to the output. If 93 you attach a dumb terminal to the serial port, you can even 94 use this script to ensure that input from the device is 95 echoed to the output with the correct speed, parity, etc.</p> 96 97 <p>Experience has shown that serially connected printers are 98 the least reliable and lowest speed. Where possible, it is 99 strongly recommended that they be attached to a <span class= 100 "emphasis"><i class="EMPHASIS">network print box</i></span> 101 which will provide a Socket API interface and handle the low 102 level network to serial port protocol conversions.</p> 103 </div> 104 105 <div class="NAVFOOTER"> 106 <hr align="LEFT" width="100%"> 107 108 <table summary="Footer navigation table" width="100%" border= 109 "0" cellpadding="0" cellspacing="0"> 110 <tr> 111 <td width="33%" align="left" valign="top"><a href= 112 "x5262.htm" accesskey="P">Prev</a></td> 113 114 <td width="34%" align="center" valign="top"><a href= 115 "index.htm" accesskey="H">Home</a></td> 116 117 <td width="33%" align="right" valign="top"><a href= 118 "printcapref.htm" accesskey="N">Next</a></td> 119 </tr> 120 121 <tr> 122 <td width="33%" align="left" valign="top">Parallel Port 123 Printers</td> 124 125 <td width="34%" align="center" valign="top"><a href= 126 "printercomm.htm" accesskey="U">Up</a></td> 127 128 <td width="33%" align="right" valign="top">Printcap 129 Database</td> 130 </tr> 131 </table> 132 </div> 133 </body> 134</html> 135 136