Dot matrix printer interface: Software (feature demo / IRC)

Posted on 2014-10-04 at 00:19 in Programs, Videos by Robbi-985.

The printer is a new, colour Epson LQ-300+II this time. Sorry in advance – I was tired after spending the whole night coding. Here’s the program I made to send Epson’s ESC/P 2 commands to a compatible printer and do fancy stuff such as change effects, colour, size, and even send non-ASCII characters as graphics in the middle of ASCII text. It’s still a long way from a usable text editor, though.

The program can also monitor plain-text log files and print new lines of text as they are saved. Here, it prints off live chat logs from 4 IRC channels. I optimised it a little for IRC logs, so that it can print different parts in different colours. I considered making it monitor my web server’s log file, but visiting certain pages on my site can add dozens of lines at once to the log file, which would waste a whole sheet of paper in seconds.

[Watch in HD]

My program uses a USB interface, which I made with an Arduino, to communicate with the printer. The Arduino passes printer status info to the laptop, such as “error” or “paper out”, and forwards data from the laptop to the printer’s parallel port if the printer is ready.

I’m using a different, brand-new printer this time because it turns out that the other, second-hand printer had a bad head with 2 or 3 dead pins, causing blank lines in the print-out. I actually recorded several videos on the progress of cleaning the printer and its head, and was able to fix one of the pins, but 1 or 2 never came back to life, so it’d make a bit of an anticlimactic video that I might not upload. By the way, I recorded the pins firing in slow-motion, and one was very slow while the other didn’t move at all. I uploaded the video here.


2 Responses to Dot matrix printer interface: Software (feature demo / IRC)

  1. slim says:

    Hi Robbi,
    I know it’s a little direct but can you please help me on dot matrix printing job please
    We are trying to print a text file on continous paper with specific format on an Epson lq2090 but it does not work
    For the moment we are printing it in PDF it work but it’s slow can you please help ?

    • Robbi-985 says:

      The key is to change the configuration of the printer in Windows so that it uses the “Generic / Text Only” driver (at least, it’s named that way on Windows 7). View the installed printers (on Windows 7: Control Panel -> Devices and Printers), right-click your printer and choose “Printer Properties” (not “Properties”), go to “Advanced” tab, and next to “Driver:”, choose “Generic / Text Only” from the list. If that option isn’t in the list, click “New Driver…” (next to the list), choose “Generic” from the manufacturer (left) list, and “Generic / Text Only” from the printer (right) list. “OK” the Printer Properties window.

      If you’re lucky, programs that can output plain text (such as Notepad and Wordpad) can now print using that printer/driver. This will just send raw ASCII text to the printer, so you will have to adjust the printer’s settings to choose a font, draft mode (if wanted), paper width, and stuff. You will need to consult your printer’s manual to find out how to do that Even among Epson dot matrix printers, it varies, but it typically involves making the printer print out its internal settings along with instructions of how to change them, and then using buttons on the printer to change the settings. You will need to turn on a setting called something like “continuous paper”, “roll paper” or “roll mode”.

      Note: Some programs, like Notepad (I think), still send the Form Feed character at the end of a page, which may still cause the printer to roll through and waste a large amount of paper. Wordpad (at least, with some page settings adjusted) doesn’t do this. You might be able to fool the program into not trying to advance past “leftover” paper at the end of the job by changing the page settings, adding a custom paper size that is as short as possible, and using that as the paper size in your program, along with 0-length top/bottom margins, when printing.

      I hope this helps some time, even though my reply is probably too late for now.

Leave a Reply to slim Cancel reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>