Professional Web Applications Themes

Linux to emulate/act as a printer. - UNIX Programming

Hello, I have a device which outputs data to a printer. I have to collect these data and do smth with them. Today (working already 15+hours), i read a lot about parallel port and how data is transmitted/received, so i wired my own cable: data to data, pin 1 (at pc) to pin 11 (at device), so i could write not busy pin 10 (at pc) to pin 1 (at device), so i could read strobe pin 16 (at pc) to pin 10 (at device), so i could write ack pin 17 (at pc) to pins 12 and 15 (at ...

  1. #1

    Default Linux to emulate/act as a printer.

    Hello,

    I have a device which outputs data to a printer.
    I have to collect these data and do smth with them.

    Today (working already 15+hours), i read a lot about parallel
    port and how data is transmitted/received, so i wired
    my own cable:

    data to data,
    pin 1 (at pc) to pin 11 (at device), so i could write not busy
    pin 10 (at pc) to pin 1 (at device), so i could read strobe
    pin 16 (at pc) to pin 10 (at device), so i could write ack
    pin 17 (at pc) to pins 12 and 15 (at device), so i could write
    not out of paper and not error (tell that nothing is wrong with
    printer)
    ground to ground,
    other cables not used.

    My idea is to control the status registers, so i (linux box) could
    act as a real printer, for example if i saw 'strobe low' (reading
    status ack (pin 10 at pc which is connected to device's pin 1),
    i'd know device is sending a byte, i would acknowledge that
    (by writing to pin 16) and continue reading byte by byte.

    Unfortunately something is wrong. I have tested the wiring -
    it is ok. I know about hardware invertion in parallel port, so
    i high and low pins correctly.

    The device just holds 'strobe' high, data bit 2 high and data bit 4
    high. As i understand the device waits me (printer) to low busy,
    and do the same to error and out of paper. I have done it but the
    device never changes those strobe, bit2 and bit4.

    If i connect the device to a printer, the printer prints data out
    perfectly. I dont have so advanced devices to trap printer and device
    to see their conversation..

    So something is wrong, i must ask if i have have understood how the
    printers work correctly:
    1) If there is no paper or is error, those pins are set high.
    2) Printer sets busy low, indicating it is ready to accept data
    3) Device sets data pins high, putting a byte on the wire, and sets
    strobe low.
    4) Printer sets busy high, indicating it is processing data
    5) Printer reads data pins.
    6) Printer sets busy low, sets ack low, waits ~ 5us, highs ack
    7) goto 1, procedure continues.

    Am i correct?

    Also, please, if you know how to do this easier, be so kind and
    tell me.


    Thanks,
    P.Krumins
    Peteris Guest

  2. #2

    Default Re: Linux to emulate/act as a printer.

    On Thu, 25 Dec 2003 23:18:58 -0500, Peteris Krumins wrote:
     

    So Kermit didn't work out for you?

    Mike
    Michael Guest

  3. #3

    Default Re: Linux to emulate/act as a printer.

    Michael B Allen <com> wrote in
    news:com:
     
    >
    > So Kermit didn't work out for you?
    >[/ref]

    No, Kermit did not seem to be designed to interface parallel port.


    P.Krumins
    Peteris Guest

  4. #4

    Default Re: Linux to emulate/act as a printer.

    On Sat, 27 Dec 2003 11:00:16 -0500, Peteris Krumins wrote:
     
    >>
    >> So Kermit didn't work out for you?
    >>
    >>[/ref]
    > No, Kermit did not seem to be designed to interface parallel port.[/ref]

    That's odd. I did exactly that in college (~1996). I connected the
    parallel ports of an old Data General to an OS2 machine and "printed"
    the data to the OS2 machine right into Kermit. I believe your "device
    which outputs data to a printer" is no different from the Data General
    in my case.

    Mike
    Michael Guest

  5. #5

    Default Re: Linux to emulate/act as a printer.

    Michael B Allen <com> wrote in
    news:com:
     
    >> No, Kermit did not seem to be designed to interface parallel port.[/ref]
    >
    > That's odd. I did exactly that in college (~1996). I connected the
    > parallel ports of an old Data General to an OS2 machine and "printed"
    > the data to the OS2 machine right into Kermit. I believe your "device
    > which outputs data to a printer" is no different from the Data General
    > in my case.
    >[/ref]

    I verified again, kermit does not have an option to communicate with
    parallel port.
    Maybe those were serial ports you connected the device and a computer to?


    P.Krumins
    Peteris Guest

  6. #6

    Default Re: Linux to emulate/act as a printer.

    On Sun, 28 Dec 2003 16:26:32 -0500, Peteris Krumins wrote:
     

    Entirely possible.

    How about this then:

    http://www.lvr.com/parport.htm

    Looks like you want to use inb(2), outb(2), ioperm(2) and so on.

    Mike
    Michael Guest

  7. #7

    Default Re: Linux to emulate/act as a printer.

    net 
    >
    >Entirely possible.
    >
    >How about this then:
    >
    > http://www.lvr.com/parport.htm
    >
    >Looks like you want to use inb(2), outb(2), ioperm(2) and so on.
    >
    >Mike[/ref]

    If you don't need much from the printer end you could also consider a
    stand-alone Forth rather than Linux. I used one to bang on a floppy drive
    a bit at a time. Keyword "ENTH".

    Rick Hohensee

    cLIeNUX Guest

Similar Threads

  1. Line printer configuration on Fedora linux
    By ravikatti@gmail.com in forum Linux / Unix Administration
    Replies: 11
    Last Post: June 8th, 04:51 PM
  2. Need help printer setup on Redhat Linux
    By RC in forum Linux / Unix Administration
    Replies: 4
    Last Post: June 2nd, 06:30 PM
  3. Printer + Linux = no carriage return
    By Charles in forum Linux Setup, Configuration & Administration
    Replies: 5
    Last Post: December 7th, 02:55 PM
  4. Replies: 2
    Last Post: August 16th, 06:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139