NODOMAIN.NET Terms of Service

TLDR; By selecting this option I agree to the requirements that I share my information and waive my rights as explained below. Selecting this option will reveal the site's content and dismiss these Terms, which can be subsequently viewed and opted-out of at any time by visiting NODOMAIN.NET and selecting Terms from the navigation chevron.

NODOMAIN.NET (a not-for-profit and voluteer-run organization) Terms of Service are different than those of most websites. In order to access NODOMAIN.NET services, you must agree a) to our use of your Shared Information, b) to waive the below rights which may be available to you in your jurisdiction and c) to abide by and honor our Terms of Use by checking each of the 5 boxes below. If you can not or do not agree, then you may not use or access NODOMAIN.NET systems or services and must leave immediately.

Shared Information

Information that you choose to share with NODOMAIN.NET for processing and collection:

What NODOMAIN.NET uses your information for:

How NODOMAIN.NET shares your information and who gets to see it:

I consent to the collection and use of my Shared Information.

Notice and Waiver of Rights and Idemnification

In the event that your Shared Information is compromised, you agree to a) waive the right to be notified of the breach and b) to waive any claims of liability or damages that may result from the breach.

I waive my right to be informed of data breaches and agree to indemnify NODOMAIN.NET from liability and damages that may result.

NODOMAIN.NET will not make acessible to IP packet originators their archived packets. It is the responsibility of the originator to archive their packets at the time of origination and also to be aware of their contents.

I waive my right to access and review my Shared Information that is stored on NODOMAIN.NET systems.

NODOMAIN.NET reserves the right to delete your Shared Information from its systems at its sole discretion.

I waive my right to be forgotten or erased.

Other Terms

By accessing NODOMAIN.NET systems and services you also agree to abide by the following additional terms:

I agree to abide by and be subject to these Terms of Use.

Copyright 2019-2024, NODOMAIN.NET of Seattle (Salish lands), County of King, Washington State (with POPs in Oregon and California), United States of America, Planet Earth. All rights reserved. All trademarks and tradenames are the property of their respective holders. Revised January 2020. Contact us.

A Guide to Running Apple Dot Matrix Printers with Windows and UNIX Clients,
by Josh Moyer <JMoyer@NODOMAIN.NET>

Credits

All trademarks and names are the property of their owners, notably (and with gratitude): Apple, Inc.; Artifex Software; American Telephone and Telegraph Company; authors prior of gdevadmp.c; Brian; Connor Taffe; Carpentier Pierre-Francois; Microsoft Corporation; NetBSD Foundation, The; Oracle; Regents of the University of California, The(;) and University of Michigan Research Systems UNIX Group.

License

The following guide is copyrighted 2020-2024 by Josh Moyer <JMoyer@NODOMAIN.NET.> All rights reserved.

Synopsis

Herein lays an outline to creating an integration between an Apple dot matrix printer and any modern UNIX or Windows system. This guide covers the following printers:

After completing the steps outlined here, you should be able to print to any of the above printers from a Windows or UNIX based host. Please note that, at present, the shipping driver for the printers only supports single-color, unidirectional printing. The soon to be released and updated driver supports color and bidirectional printing and other features.

The integration covered in this guide uses NetBSD as the Raster Image Processor (RIP) and spooler node that the printer will be connected to or driven by, depending on whether you are using a direct connection or if you are connecting with the ImageWriter II/LQ LocalTalk Option card. Other host operating systems can likely be utilized, too. However, the author noted that AppleTalk support in the Linux kernel seems to have been broken for some time now, based on experience while initially targeting Linux as the RIP and spooler node.

Background

Apple, Inc. (née Apple Computer, Inc.) made the dot-matrix printers listed in the synopsis during the years in which that technology was viable in the market. They were all based originally on the C. Itoh (8510) mechanism and command set, both of which experienced proprietary evolutions at Apple. The Scribe, a thermal transfer printer also made by Apple, shares the same command set and some resolutions as the dot-matrix printers, but is only CMY in color mode. Eventually replaced by quieter, faster and higher quality laser and ink-jet based models, dot-matrix printers are known for their distinctive sound and also for their ability to handle multi-part forms and banners.

The author, having obtained an ImageWriter LQ from University of Washington Surplus and which was kept in storage for many years, was motivated to revive his LQ by way of his long-lived Epson Stylus Color RX500's death. Although ease was not expected, the author never anticipated the degree of difficulty encountered. Overall, it took 3-6 months of significant sustained effort to troubleshoot and integrate all of the disparate pieces -- and that was just for initial monochrome network support. Creating a color ghostscript driver from the existing sources proved very difficult and took about 3 years, due to combination of factors.

Audience

This guide is meant for users who are able to edit and manipulate files and directories and interpret diff output in a command-line environment.

Revision History

Todo

Getting Started

To get started you'll need to have the following items:

For AppleTalk based operation (which also delivers an enhanced 230.4 kilobaud line rate versus a maximum of 19.2 kilobaud, resulting in enhanced printing speed), the following additional pieces are needed:

The Printers

All of Apple's dot matrix printers are based on a common command set based on ecape sequences embedded in the output and are all backwards compatible, in theory. The non-LQ printers (at least) are all based on a family of C. Itoh print engines.

Apple Dot Matrix Printer

Introduced in 1982, The Apple Dot Matrix Printer featured a maximum resolution of 160x72 dpi. It also featured a parallel interface and tractor feed.

Manual

DIP Switches

|SW1-87654321|SW2-87654321|
|------------|------------|

Apple ImageWriter (15")

Introduced in late 1983, The ImageWriter featured a maximum resolution of 160x72dpi. It also featured a serial interface and tractor feed. A separate model with a 15" platen was also available.

Manual

DIP Switches


Apple ImageWriter II

Introduced in late 1985, The ImageWriter II featured a maximum resolution of 160x144dpi. It also featured a serial interface, tractor feed, 4 color CMYK printing, optional cut-sheet feeder and AppleTalk co-processor and interface and buffer memory cards. It won at least one award for its innovative and distinctive industrial design.

Manual

DIP Switches

|SW1-12345678|SW2-123456|
|------------|-------*--|

* - (LocalTalk) Option Card On/Off

Apple ImageWriter LQ

Introduced in mid-to-late 1987, The ImageWriter LQ featured a maximum resolution of 320x216dpi. It also featured a serial interface and tractor feed, 4 color CMYK printing, a 15" platen width, optional multi-bin cut-sheet feeder (with envelope attachment) and AppleTalk co-processor and interface and memory buffer cards. It was known for its high price ($1,399?.) Some have remarked on its (unwitnessed by the author) tendency to melt the print-head glue on large, strike-heavy jobs, as well as it's increased noise level -- as compared to the ImageWriter II.

DIP Switches

|SW1-12345678|SW2-12345678|
|----00000110|----000*0000|

* - (LocalTalk) Option Card On/Off

Power

Plug the printer in to a grounded outlet and make sure that you don't overload the electircal service circuit. Consult an electrician and the owner's manual for recommendations and power requirements, respectively.

Data

Either a direct connection or a LocalTalk connector box (requires the optional Apple ImageWriter II/LQ LocalTalk Option co-processor card, with appropriate jumper settings) are supported.

NetBSD

In this guide we use NetBSD 9.0 (i386.)

Installation

Excellent (per-architecture) instructions already exist at the NetBSD website and, so, will not be covered here -- except to say that you should ensure you have enough free-space for the upcoming installation activities and also to make sure to install the pkgsrcs and that the network interface is configured.

Kernel Modification

Most versions (1 & 2) of the 3 ROM revisions in the ImageWriter II/LQ LocalTalk Option card have a bug in their DDP checksum calculation logic, so we gently and skillfully modify (read: brutally hack) the kernel to disable DDP checksum generation on a system-wide basis. Caveat emptor.

Get

Download and untar the source for the kernel so that a custom kernel can be compiled with the DDP checksum verification patch.

cd /
curl http://cdn.NetBSD.org/pub/NetBSD/NetBSD-9.0/source/sets/syssrc.tgz --output syssrc.tgz
tar xzf syssrc.tgz

Patch

Apply patch to the kernel source.

/usr/src/sys/netatalk/ddp_output.c:53

Configure

Create a custom kernel configuration.

cd /src/sys/arch/i386/conf
cp GENERIC NODDPCKSUM
config NODDPCKSUM
cd ../compile/NODDPCKSUM/

Compile

Compile the kernel with the modification.

make depend ; make

Install

Install the new kernel in the system.

mv /netbsd /netbsd-GENERIC
mv netbsd /netbsd

Reboot

shutdown -r now

Ghostscript

Ghostscript is a rendering engine for the PostScript and PDF page description languages. Certain older and more recent versions of Ghostscript contain a driver that supports all of Apple's dot matrix printers.

Install

Agree to the license

Review and agree to the gnu-agpl-v3.

echo "ACCEPTABLE_LICENSES=gnu-agpl-v3" >> /etc/pkg_install.conf

Fetch, untar, compile and install the source (and dependencies)

This took about 3 hours.

cd /usr/pkgsrc/print/ghostscript-agpl
make install

Test

Install a ribbon, power up the printer, load some paper and use either the direct or LocalTalk connection test below -- depending on your printer's capabilities or configuration. The command-lines are only for testing.

Set Driver

Enter one of:
driver=appledmp # Apple Dot Matrix Printer
driver=iwlo # ImageWriter (15")
driver=iwhi # ImageWriter II
driver=iwlq # ImageWriter LQ

Set Resolution

Enter one of:
resolution=120x72 # Apple Dot Matrix Printer
resolution=160x72 # ImageWriter (15")
resolution=160x144 # ImageWriter II
resolution=320x216 # ImageWriter LQ

Set Paper Size

Enter one of:
paperSize=letter
paperSize=legal

Print - Direct Connection

gs -q -dBATCH -dNOPAUSE -dSAFER -sDEVICE=$driver -sPAPERSIZE=$paperSize -dFIXEDMEDIA -dPSFitPage -r$resolution -sOutputFile=$outFile $inFile
cat $outFile > $port (on Windows, set MODE.COM %PORT%: baud=19200 parity=n data=8 stop=1 octs=on idsr=on odsr=on to set line params and use print.exe /d:%PORT%: %outFile%)

Print - LocalTalk (complete netatalk section, first.)

gs -q -dBATCH -dNOPAUSE -dSAFER -sDEVICE=$driver -sPAPERSIZE=$paperSize -dFIXEDMEDIA -dPSFitPage -r$resolution -sOutputFile=$outFile $inFile
pap -p $printerName:$printerType $outFile

Berkeley DB

netatalk has a dependency on Oracle's Berkeley DB (bdb) library, so you must compile and install bdb in order to use netatalk.

Obtaining the source

Download

You will have to register for an Oracle account (if you don't have one already) and agree to their Terms and Conditions in order to download from the BerkeleyDB downloads page.

Untar

cd /usr/local/src
tar zxf db-18.1.40.tar.gz

Agree to the License Agreement

Berkeley DB is free, but comes with conditions. Be sure to review the License Agreement to understand your usage terms and obligations.

Review

cd db-18.1.40
vi LICENSE
Read the license
:q

Build and Install

Configure

cd build_unix
../dist/configure

Make

make

Install

make install

netatalk

netatalk 2.x is both a set of kernel routines and userland programs that enable full interoperability with a wide range of AppleTalk network services, including file and print services. (netatalk 3.x does not support many of the classic AppleTalk protocols -- specifically DDP -- it has a TCP/IP-based file sharing focus.)

Obtaining the source

Download

Save to /usr/local/src.

Extract

cd /usr/local/src
tar xzf netatalk-2.2.6.tar.gz

Apply pap.c patches

The base netatalk pap(1) userland program has a bug that prevents it from working with the ImageWriter II and/or LQ in AppleTalk mode, so Connor Taffe's <cptaffe@misc.home.arpa> 0001-Fix-PAP-status-for-ImageWriter-II.patch and Carpentier Pierre-Francois' kakwa netatalk/pap.c patch must be used.

Download

Extract

Apply

diff --git a/bin/pap/pap.c b/bin/pap/pap.c
index 0c62da4b..53221c3f 100644
--- a/bin/pap/pap.c
+++ b/bin/pap/pap.c
@@ -890,17 +890,21 @@ static int send_file(int fd, ATP atp, int lastfile)
* The stinking LaserWriter IINTX puts crap in this
* field.
*/
+			/*
if (((char *) rniov[0].iov_base)[0] != 0) {
fprintf(stderr, "Bad status response!\n");
exit(1);
}
+			*/
#endif				/* NONZEROSTATUS */

+			/*
if (((char *) rniov[0].iov_base)[1] != PAP_STATUS
|| atpb.atp_rresiovcnt != 1) {
fprintf(stderr, "Bad status response!\n");
exit(1);
}
+			*/

if (debug) {
printf("< STATUS\n"), fflush(stdout);
@@ -931,6 +935,7 @@ static void updatestatus(char *s, int len)
{
int fd = -1;
struct iovec iov[3];
+	char error_code[len];

if (status) {
if ((fd = open(status, O_WRONLY | O_TRUNC)) < 0) {
@@ -945,7 +950,9 @@ static void updatestatus(char *s, int len)

iov[0].iov_base = "%%[ ";
iov[0].iov_len = 4;
-	iov[1].iov_base = s;
+	//iov[1].iov_base = s;
+	sprintf(error_code, "%X", s);
+	iov[1].iov_base = error_code;
iov[1].iov_len = len;
iov[2].iov_base = " ]%%\n";
iov[2].iov_len = 5;
diff --git a/bin/pap/papstatus.c b/bin/pap/papstatus.c
index b113f667..3dea1743 100644
--- a/bin/pap/papstatus.c
+++ b/bin/pap/papstatus.c
@@ -44,6 +44,15 @@

#define _PATH_PAPRC	".paprc"

+#define COLOR_RIBBON_INSTALLED 0b10000000
+#define SHEET_FEEDER_INSTALLED 0b01000000
+#define PAPER_OUT_ERROR        0b00100000
+#define COVER_OPEN_ERROR       0b00010000
+#define PRINTER_OFF_LINE       0b00001000
+#define PAPER_JAM_ERROR        0b00000100
+#define PRINTER_FAULT          0b00000010
+#define PRINTER_ACTIVE         0b00000001
+
/* Forward Declaration */
static void getstatus(ATP atp, struct sockaddr_at *sat);

@@ -87,6 +96,7 @@ static char *printer = NULL;
static char cbuf[8];
static struct nbpnve nn;

+
int main(int ac, char **av)
{
ATP atp;
@@ -199,5 +209,22 @@ static void getstatus(ATP atp, struct sockaddr_at *sat)
return;		/* This is weird, since TIDs must match... */
}

-	printf("%.*s\n", (int) iov.iov_len - 9, (char *) iov.iov_base + 9);
+	// printf("%.*s\n", (int) iov.iov_len - 9, (char *) iov.iov_base + 9);
+	char status = rbuf[9];
+	if (status & COLOR_RIBBON_INSTALLED)
+		puts("Color ribbon installed");
+	if (status & SHEET_FEEDER_INSTALLED)
+		puts("Sheet feeder installed");
+	if (status & PAPER_OUT_ERROR)
+		puts("Out of papaer");
+	if (status & COVER_OPEN_ERROR)
+		puts("Cover open");
+	if (status & PRINTER_OFF_LINE)
+		puts("Printer offline");
+	if (status & PAPER_JAM_ERROR)
+		puts("Paper jam");
+	if (status & PRINTER_FAULT)
+		puts("Printer fault");
+	if (status & PRINTER_ACTIVE)
+		puts("Printer active");
}
--
2.41.0
                                    

Configure

CFLAGS+="-O0" (if your VAX compiler is cranky)
./configure --with-bdb=$path --without-ldap --with-ssl-dir=no --enable-ddp --disable-cups

Compile

make

Install

make install

gdevadmp PPDs

Why and how to install the gdevadmp device PPDs (for best results.)

FAQs

Capacitors?
Those caps won't last forever, sadly. Hopefully the ICs and motors will.
Ribbons?
The author has a stock of some for the LQ that are sealed and may be resold at a later time. These also occasionally show up on eBay (where I used to work.) The non-LQ black ribbon is still manufactured. The non-LQ color ribbon has had several user community supported production runs (one of which was too inky) at this point and they can be found on eBay, too.
Why not use the C. Itoh driver in Windows?
You can, just not for color printing.

Colophon

This guide lives at http://jmoyer.nodomain.net/admp/ and is hosted by NODOMAIN.NET, a private, hybrid cloud run by Josh Moyer <JMoyer@NODOMAIN.NET>.