Re: Linux "print server"

From: Robert Heller (heller_at_deepsoft.com)
Date: 08/07/03


Date: Wed, 06 Aug 2003 22:01:41 +0000


  "Geoff" <geoff@bogus.net>,
  In a message on Wed, 06 Aug 2003 10:08:21 -0400, wrote :

"> On Tue, 05 Aug 2003 14:15:18 +0000, Robert Heller wrote:
">
"> > be explained in the PPP HOW-TO). Question: why are you using PPP and a
"> > serial port? Wouldn't be simpler to just get a NIC and use Ethernet?
">
"> Yes it would be if the hardware supported it :)
">
"> I am generating PostScript files on a Commodore 64 running a DTP
"> application that runs under the Geos/Wheels OS. Printing directly to a
"> PostScript printer is a trivial matter, but I'd like to print on non-PS
"> printers as well. Not to reinvent the wheel (pun intended), I decided
"> Ghostscript would be the way to go. No, porting Ghostscrip to a C64 is
"> really not an option, so a Linux server seemed possible.
">
"> I already have TCP/IP communication using ppp between the C64 and the
"> Linux box. I can boot the Linux box, walk away, and log into my account
"> from the C64 too. I can send files to the Linux box manually using either
"> Y-modem or ftp protocols. But I'd really like the process to be automatic.
"> IOW create the PS file on the C64 and "print" the file directly to the Linux
"> box which would send it to my printer through Ghostscript without any
"> further intervention.
">
"> > In either case, once a TCP/IP connection is established via PPP or
"> > Ethernet, you just need lpd running (this is standard) and then it is
"> > just a matter of setting up print filters for your print queues.
">
"> > high-res color). The print daemon (lpd) runs the script specified in
"> > the /etc/printcap file and the script runs Ghostscript with the proper
"> > arguments. The RH print control dialog (written in Python/Tk) handles
"> > this for you. It is *extremely* painless. The only hard part is
"> > setting up the network itself.
">
"> What you describe here is a TCP/IP network. Correct me if I'm wrong. The
"> DTP app I use can send data to a serial port, but it uses regular hardware
"> flow control, not TCP/IP. Do I have to get the Linux box to listen for
"> both serial data AND TCP/IP packets on it's serial port? Do I need TWO
"> lines? Am I over thinking this thing?

Once you have PPP running over a Serial Port, you have a TCP/IP network
(that is what PPP does). In your original message you talked about
connecting to the Linux box with PPP. It sounds like this is not what
you want (or else one of us is confused).

There are three (separate!) possibilities:

1) Your C64 creates a PPP connection (I presume this means it has some
sort of TCP/IP stack going) to your Linux box. All you need at this
point is:

        A) Some flavor of lpd running on the C64 (source code for lpd
exists). It should be possible to
port the specific data transfer part of lpd, assuming you can do
programming at that level on the C64.
        
        B) You use some random other TCP/IP file transfer client (ftp,
ssh/scp, rsh/rcp) that transfers the file (using some sort of script)
and then remotely runs lpr on the Linux box. Is it possible to define
remote commands to be executed by the ftp daemon (this is a *potential*
security problem if it is not done right, but this is only a concern if
the Linux box is on the real InterNet, if it is an isolated two-node
network (C64 and Linux box), it is not an issue). I don't know if there
is any chance of porting OpenSSH to the C64.

For either A or B, the DTP program needs to save its PostScript to a
file and then invoke either your stripped down lpr/lpd hack (A) or invoke
the program that does the file transfer and remote program (lpr)
execution (B).

2) Your C64 does NOT create a PPP connection. Instead, you use the
(existing?) NULL modem serial cable and write a simple daemon that would
replace *getty on the serial port used by the C64. This simple daemon
'behaves' like a printer (somehow) and collects a PostScript file,
starting with the '%!PS' line to the next '%!PS', and then queuing this
to lpr (actually it just needs to do a popen("lpr","w") and send
everything from stdin to the file handle from popen, closing and
re-opening whenever a line starting with '%!PS' comes along, or just
closing when the line is idle for some period of time or something --
detecting EOF is a possible problem).

3) One possible hack: install ifmail on the Linux box and get some
simple FidoNet program for the C64. You than use the TIC protocol to
send the file. On the Linux box you can associate a program (script) to
run when a file for a particular File Area arrives. You create an area
called PRINTER and the script does an lpr... You'll need to set up a
cron job to process the TIC files.

(Option 3 is really a someone more 'organized' variation of option 2, in
that you are creating an actual network, but using the FidoNet protocol
instead of TCP/IP. Note: it is also possible to push FidoNet *over*
TCP/IP as well, so this is a possible variation with option 1, although
that would be serious over kill (a serial protocol over a TCP/IP network
over a serial line...).

">
"> Geoff
">
">

                                     \/
Robert Heller ||InterNet: heller@cs.umass.edu
http://vis-www.cs.umass.edu/~heller || heller@deepsoft.com
http://www.deepsoft.com /\FidoNet: 1:321/153

         



Relevant Pages

  • Re: Linux "print server"
    ... so a Linux server seemed possible. ... I already have TCP/IP communication using ppp between the C64 and the ... What you describe here is a TCP/IP network. ... DTP app I use can send data to a serial port, ...
    (comp.os.linux.misc)
  • Re: Why to up/not grade to/from W98 (was: new Pulsonix version 3 PCB software released)
    ... whos primary function was to read ... and reading BOT/EOT markers and the raw MFM. ... On serial better is to use a micro (cheap 2 $ PIC has serial port). ... Linux, why sell yourself out to Bill Gates? ...
    (comp.arch.embedded)
  • Re: Flow Control on Serial Device
    ... Are you using the exact same cable for the Linux system that you ... indeed a straight through cable? ... Then CTS and RTS are ... properly configure your serial port, ...
    (comp.os.linux.networking)
  • Re: minicom questions, need expert
    ... I do not know if the minicom utility can reach out into that FT232RL to ... then what linux utility can perform this initialization? ... It turned out that the serial port params on the legacy machine ... Do I need to train my src machine to send some sort of an eof signal? ...
    (Fedora)
  • FTDI usb-serial possible bug
    ... It describes a nasty behavior of the ftdi usb-serial linux driver. ... in bash and in python. ... The same test performed on a real serial port receiving continuous ... does not yield to any corruption problem. ...
    (Linux-Kernel)