Sunday, June 8, 2008

Legacy Printing

Thirteen years ago, I purchased a laser printer that still works great despite a few wrinkles and liver spots. Here's how I keep it alive currently.

Hardware:

    The hardware hasn't changed in nearly ten years.
  • An Apple LaserWriter 4/600 PS, capable of printing from serial or network.
  • An EtherWrite ethernet-to-localtalk (ethernet to apple serial cable) adapter.
  • A Hawking PN400TP 4-port ethernet hub (not router or switch, a hub)


The printer doesn't have an ethernet port, only a localtalk (serial) port. Long ago, our last serial-printer Mac died, so the only way to talk to the printer is through the network via the EtherWrite adapter.

The EtherWrite is not detectable on the network if it's directly connected (by ethernet) to a mac or a router. It only works if the connection passes through a hub first. I don't know why. The EtherWrite's measly documentation is unhelpful, and the company that made it died long long ago.

The printer itself still has clean and sharp output. It's outlasted a couple serial, USB, and multifunction inkjets. Toner is still available. The case is yellowing, and the rear feeder spring has been lost, so it feeds out the top - I taped the rear feed selector level in the position I wanted.

Since I print at home only rarely, I leave the printer/adapter/hub assembly powered off for months at a time. When I need to print, I turn them all on, then alternate unplugging/replugging the printer and adapter until they show up on the network. I've never figured out what the proper power-up sequence should be - and I've tried.


Software:

  • A MacBook G4 running OS X 10.5
  • My laptop running Ubuntu 8.04, printing via CUPS.

The printer only speaks Apple's localtalk. It's built-in on the MacBook, and available as an add-on on Ubuntu.

Printing from the MacBook is simple. First, it needs to be plugged into the router, since my router's wireless doesn't support Appletalk. Next, print the document. If the printing errors out "cannot connect to printer," then cycle the power on the printer or the adapter. Since the printed document is in queue, when the printer appears on the network, the printer will begin working despite the original error message.

Printing from linux is a bit more tricky, and Ubuntu doesn't make it easy. But it can be done. These instructions are for Ubuntu 8.04, and your results may vary.

  1. Install the netatalk package with sudo apt-get install netatalk. Due to a bug in the package, you might get a bunch of errors:
    dpkg - trying script from the new package instead ...
    hostname: Unknown host
    invoke-rc.d: initscript netatalk, action "stop" failed.
    dpkg: error processing /var/cache/apt/archives/netatalk_2.0.3-6ubuntu1_i386.deb (--unpack):
     subprocess new pre-removal script returned error exit status 1
    hostname: Unknown host
    invoke-rc.d: initscript netatalk, action "start" failed.
    dpkg: error while cleaning up:
     subprocess post-installation script returned error exit status 1
    Errors were encountered while processing:
     /var/cache/apt/archives/netatalk_2.0.3-6ubuntu1_i386.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install. Trying to recover:
    dpkg: error processing netatalk (--configure):
     Package is in a very bad inconsistent state - you should
     reinstall it before attempting configuration.
    Errors were encountered while processing:
     netatalk
    Don't sweat if the errors look like these - you'll fix them in the next step. What's happening is that the bug prevents netatalk from figuring out the name of it's host.

  2. The netatalk package is broken. Edit these two files to fix them - then netatalk will work Edit the files even if you didn't get the errors in the last step.
    /etc/default/netatalk
    FROM: ATALK_NAME=`/bin/hostname --short`
    TO: ATALK_NAME=`/bin/hostname`
    
    /etc/init.d/netatalk
    FROM: ATALK_NAME=`/bin/hostname --short`
    TO: ATALK_NAME=`/bin/hostname`
  3. Test the printer connection.
      nbplkup PrinterName - Find the printer on the network.

    If the printer's not on the network, there are three possible reasons:

    1. Most wireless routers talk Appletalk only on the wired connections - if you're using wireless, that may be the problem. Obviously, this doesn't apply to Apple wireless routers. For example, our Macbook can't talk wirelessly to the Apple printer because the wireless router can't understand Appletalk.
    2. The netatalk daemon in being flaky. There's a second serious bug in netatalk: The daemon looks for Appletalk devices on the network at startup; if it can't find any, then it shuts down instead of sleeping. For example, if I boot my computer into eth1 (wireless) connection -and we already know my router can't handle wireless Appletalk- netatalk finds no Appletalk network and the daemon shuts down. If I plug in eth0 (wired) connection, and nbplkup PrinterName, it will still fail - netatalk never checked the new connection. Use sudo /etc/init.d/netatalk restart (or stop and start to reset the daemon.
    3. The printer or adapter is being flaky. I make sure the printer is visible to the Macbook (always best to start with a known point, and the Macbook speaks Appletalk like a native). Otherwise, cycle the power on the printer or adapter and try again. With such old hardware, I don't know the correct order to power them up. It can be annoying.

  4. Test command-line printing. Before setting up CUPS, install 'pap' (actually just a script to make pap executable from CUPS) and test it on the command line. CUPS needs pap in the next step.
    • Download pap and save it to your desktop.
    • Make pap executable with sudo chmod +x Desktop/pap
    • Install pap in the correct directory with sudo mv pap /usr/lib/cups/backend
    • Restart CUPS with sudo /etc/init.d/cupsys restart
    • Prepare a test file for printing. The printer seems to only speak Postscript, so your testfile must be in Postscript format. I used this one. In Ubuntu, the a2ps package (included with default install) will create .ps files. Usage: a2ps input_text_file -o output_file.ps
    • Test print using pap -p Printername Testfile.ps

  5. Add the printer to CUPS
  6. Most interesting. I can't get CUPS to print, though the rest is great. Hmmmm.


Update: October 2009 - The old hardware finally died, so I never followed up any further.

No comments: