Getting an AppleTalk based HP DeskWriter working the lpr

andrew.schnable schnable at cbnewsc.att.com
Fri Nov 16 03:01:50 AEST 1990



This posting contains step by step instructions for getting an Appletalk based
HP DeskWriter printer working with lpr under AUX 2.0. 

1) connect your hp deskwriter via appletalk to your macintosh.

   [ steps 2 - 5 are performed while running the "finder" ]

2) drag the appletalk driver "DeskWriter(AppleTalk)" from your 
   install disk (or mac os system folder) into the "/mac/sys/System Folder"
   directory. Click once on the driver to highlight it, and do a 
   Get Info (cmd-I). Check to see if you are running with version
   A2.00. This is the only version of the driver I have tried.

   Note: if you have a private system folder for your AUX login, drag the
   driver there instead.

3) run the "chooser" and select your Deskwriter.

  [ while you can run the "Namer" and change the name of the DeskWriter - 
    this seems flakey - the name change doesn't always take, and it seems to
    break the lpr ofilter scripts I have set up. ]

4) run "page setup..." from the File menu, and set up your default selections. 

5) do a test print - open a folder and run "print directory..." from the File
   menu.

   [ from the netnews articles on the printer I have read to date, it doesn't
     sound like people are even getting this far. I don't know what to say. 
     I am running with a Mac IIci - it works for me...]

   [ at this point - most applications that can use a printer will work -
     like textedit/macwrite/macdraw...  the rest of this writeup talks about
     getting lpr to work. ]

   [ steps 6 - 16 are run from a command shell window ]

6) login as root - edit your /etc/printcap entry and apply these diffs:

7,12d6
< lp|dw|DeskWriter:\
< 	:lp=/dev/null:\
< 	:if=/usr/spool/lpd/DeskWriter/ifilter:\
< 	:of=/usr/spool/lpd/DeskWriter/ofilter:\
< 	:nf=/usr/spool/lpd/DeskWriter/nfilter:\
< 	:sd=/usr/spool/lpd/DeskWriter:
15c9
< at|AppleTalk:\
---
> lp|at|AppleTalk|postscript|PostScript:\


7) Make a /usr/spool/lpd/DeskWriter directory. Make the ownerships/permissions
   match this:

	drwxrwxr-x   2 daemon   daemon       512 Nov 10 01:17 DeskWriter 

8) cd to the /usr/spool/lpd/AppleTalk directory. Copy the ofilter to
   ../DeskWriter. Make ownerships/permissions match this:

	-rwxr-xr-x   3 daemon   daemon      2239 Apr 10  1990 ofilter

9) cd to the DeskWriter directory. link ofilter to ifilter and nfilter.

	ln ifilter ofilter
	ln ifilter nfilter

10) Apply these diffs to the filter:

16c16
< DEFAULTPR="AppleTalk"
---
> DEFAULTPR="DeskWriter"
63c63
< 			atprint < pipe 2> /dev/null &
---
> 			/usr/local/bin/deskwriter < pipe 2> /dev/null &
65c65
< 			atprint "$Printer" < pipe 2> /dev/null &
---
> 			/usr/local/bin/deskwriter "$Printer" < pipe 2> /dev/null &
78c78
< 			filter="cat"
---
> 			filter="/usr/local/bin/addff"
86c86
< 			filter="cat"
---
> 			filter="/usr/local/bin/addff"

11) cd to /usr/local/bin and create "/usr/local/bin/deskwriter" as follows:

	#
	# expand newlines and tabs
	#
	/usr/local/bin/crnl | /usr/ucb/expand | atprint $*

12) create addff in /usr/local/bin too:

	#
	# add ff to end - a
dd indentation
	#
	cat $* | awk '{ print "       " $0 }
	END {printf "^L"}'

    [ I typed control-L in the script - I show it here as ^ and L. ]

13) create /usr/local/bin/crnl by compiling the following C program,
    and installing the resulting object:

/* crnl.c : this program filters its stdin converting nl to crnl */

#include <stdio.h>
main()
{
        int c;

        while ((c = getchar()) != EOF) {
                if ( c == '\n' )
                        putchar('\r');
                putchar(c);
        }
}

    [ compile with "cc -o crnl crnl.c" ]

14) Check you /etc/inittab entry for lpd and make sure the lpd deamon is
    being spawned "once".

15) run lpc. check the status of lp (type "status lp"). start lp.
    enable lp. read the lpc man page and dink around.

16) print. try something simple like "lpr .profile"

Did it work? no? Run lpc again and dink around some more. try restarting lp.
try rebooting. Break down and buy the AUX administrators guide and
read up on administrating lpr.

KNOWN PROBLEMS:

	1) I have had lpr refuse to print and console messages about
	   "can't find connect", or something like that, print out.
	   Don't know why. It's happened occasionally - a reboot clears
	   it up.

	2) No font control. Any ideas anyone on how to change point sizes/
           and or fonts?

        3) ATM is not supported - let's all call Adobe this afternoon and
           ask why and when... (The HP deskwriter fonts that came with the
           printer do seem to work when you run applications like MacWrite)

        4) HP refuses to support the DeskWriter as an AUX printer. Let's
           all call them up this afternoon and ask why and when....

        5) wide lines fold - this will throw off pr pagenation. (you could
           add in a line to the addff awk script to truncate wide lines...)

Enjoy.

attmail!bamkoo!schnable (my home AUX system account)
a.schnable at att.com      (my work account)



More information about the Comp.unix.aux mailing list