Networking a pen plotter under FreeBSD

    Most folks might consider this tutorial to be a solution in search of a problem. That is, it addresses a very specific and somewhat unusual situation, but one in which I nevertheless found myself. Anyway, here we go.

   This project grew out of the need to share a pen plotter among the half-dozen AutoCAD users in my office. I had: a) users running AutoCAD Release 14 under MS Windows 9x; b) an existing 10baseT LAN; c) an existing file server running FreeBSD 3.2R; d) a pen plotter which has only an RS232 interface. Without networking the plotter, the only way anyone could use it was to wheel the thing over to his desk and plug it into the back of his computer. This was less than convenient.

   The plotter in question is an elderly but perfectly good Houston Instruments DMP-61, and the instructions below are actually a recounting of what I had to do to get it running. Your mileage, as always, may vary, but I imagine it would be a similar procedure for anything with a serial interface. You could likely use this procedure as a starting point for networking any "weird" serial device, especially something for which there is no hope of finding a FreeBSD driver.

Last modified 25 August 1999

1.  Get Samba up and running.

    First, install Samba. The easy way to do this is by using the FreeBSD ports collection, which is what I did.

   Once Samba is installed, you will need to configure it - at a minimum - to be a print server. This may be simplified if you already have a printer working under FreeBSD: given that the printer already works, it should be fairly straightforward to get Samba to serve it up to Windoze clients.

   Print server configuration, as well as the entire Samba package, is very thoroughly documented at the Samba web site. Follow the link to "documentation." I can also recommend the book Samba: Integrating Unix and Windows by John Blair. The book provides a good discussion of how SMB works as well as the specifics of getting Samba running. It was a big help to me, and is worth having.

2.  Connect the plotter to a serial port

    Connect the plotter to one of the BSD box's serial ports; simple enough, but be sure to use the right cable. I connected via the 25-pin serial port; here is a diagram of the cable that I made for this application.

               2 >--------< 3
  DB25 female  3 >--------< 2   DB25 female
  to BSD box   4 >--+            to plotter
               5 >--+
               7 >--------< 7

This is supposed to indicate that pins 4 and 5 are jumpered at the computer end. Although I have not tried using the 9-pin port, I imagine the equivalent cable would look something like this:

               3 >--------< 3
  DB9 female   2 >--------< 2   DB25 female
  to BSD box   7 >--+            to plotter
               8 >--+
               5 >--------< 7

...jumpering pins 7 and 8.

3.  Edit your rc.serial file

    The file rc.serial initializes the FreeBSD machine's serial ports, and is located in /etc. You need to add a line like

      stty  </dev/cuaa1 clocal -crtscts -parenb cs8 cstopb raw 9600

This configures the port cuaa1 - the second serial port, as FreeBSD devices are numbered starting at 0 - to operate with the following parameters: ignore modem control lines; no handshake; no parity; 8 data bits; 2 stop bits; raw; 9600 baud. There are two important points here:

For more information on port configuration options, see man stty.

4.  Give the plotter a printcap entry

    Now you need to edit /etc/printcap to let the FreeBSD box know that it has this "printer" available. Here is what I added to printcap for this:

   plotter|Houston Instruments DMP-61 pen plotter:\
      :sh:\
      :lp=/dev/cuaa1:sd=/var/spool/plotter:lf=/var/log/lpd-errs:

At t his point in the process I rebooted, but that was mainly due to my lingering superstitions left over from use of Other Operating Systems :^). Well, also to make sure that things would initialize properly on an actual boot. Anyway, you should be able to run the stty command manually; just type the line you added to /etc/rc.serial at the command prompt, as root.

5.  Test it

    Let's give it a whirl; here's the basic idea. Turn on the plotter and load paper. You can load a pen as well, for total realism. Fire up AutoCAD on the client PC, configure a new "printer" under AutoCAD, and plot to it; your newly-networked pen plotter should start doing its thing.

Detailed instructions are below.

6.  Distribute instructions to your users

    All that's left is to let your users know the plotter is available, and tell them how to use it. As always, make changes to reflect your own reality. And of course, before announcing it to the world, test this on your own to make sure your instructions are good. Here is what I emailed to my users:

How to use the network plotter

1. From within Windows
 - Open Network Neighborhood;
 - There should be a server named Engineering, with
          "Engineering File Server" in the comment field.
 - Hanging off that machine, there should be a printer named "plotter."
 - That's it. Just make sure that you can see the plotter on the
           network. Do NOT attempt to "install a new printer" from
           within Windows.

2. From within AutoCAD
 - Launch AutoCAD; it is not necessary to open a drawing.
 - Pull down the Tools menu and pick Preferences.
 - In the Preferences dialogue box, click on the Printer tab.
 - Click on the button labeled New.
 - Scroll down the list of drivers; the one you want is "Houston
           Instrument ADI 4.2 by Autodesk, Inc." Select it.
 - Type in a description that you will remember later. I call mine "HI
           Network Plotter," but you can call it whatever you like.
 - When you click OK you should get a text dialog asking a number of
           questions. Here are the answers:
       Plotter model is DMP-61;
       Port timeout - take the default;
       Which port - Network, not serial. Now a dialogue will come up
             asking you to "browse for the printer," so you should be
             able to click through to Network Neighborhood ->
             Engineering -> plotter, then click OK.
       Change pens while plotting? Take the default, which is No.
       Bunch of other stuff, followed by "Do you want to change
       anything?" The right answer here is No.
 - Now it will go back to the Preferences dialogue, and at this point
       you can click OK.

Now, when you plot from AutoCAD, you can click on the "Device and
Default Selection" button in the Print dialogue and select the plotter.

3. Using the plotter itself
 - Turn on power (!) ...the switch is located on the front of the
        plotter, under the lip, towards the right-hand side.
 - Load paper. Flip up the two pinch roller arms; slide the
        paper under them until the front edge of the paper lines up
        with the fold in the metal and the right edge of the paper
        lines up with the edge of the white line. Flip down the two
        pinch roller arms to lock in the paper.
 - Press the Load button and wait for the gyrations to end.
 - Load a pen in the carrier; you may want to test it on a piece of
        scrap paper first.

4. There is no 4; that's it!


Good luck!