1

I have an old 9-pin OKI ML 3320 dot-matrix printer and i can't get it to work properly with cups.

When i send any document, the printer prints one line every ~13 seconds, often adding some random gibberish.

using echo "text\nline2\nline3" > /dev/lp0

creates:

text
    line2
         line3

same when using cat file.txt > /dev/lp0. It looks like the printer makes new line, but doesn't make carriage return.

thekiwi5000
  • 143
  • 1
  • 1
  • 6

1 Answers1

1

I have solved it.

The gibberish was caused by the loose cable, fixing it helped.

The bad line feed behavior was caused by not sending the printer \r after \n. This printer works in DOS line end mode.

Additional problem was non-ascii characters (ie. language specific letters like ĄĘŃĆ etc. or other alphabets).

To fix all of the above, you need to do the following steps:

  • Make sure the LPT cable is tight in both sockets;

  • Set proper codepage on the printer;

  • Create a script reading input, piping it through konwert command*, adding \r to end of each line and then writing it to /dev/lp0

*konwert - convert to specified charset. http://www.linuxcertif.com/man/1/konwert/

Available in the repos.

thekiwi5000
  • 143
  • 1
  • 1
  • 6