Note to self: Printing to the EP44 from Windows 10

OS: Windows 10, 64-bit, current as of 02 May 2019.

  1. Bought a USB to DE9 (DB9) cable that claimed to be FTDI
  2. It arrived and was a Winchiphead 340; asked for my money back
  3. Oh well. Plugged it in but Win 10 could not drive it. Removed it and installed 340.exe from the 340.exe/win7_win10/ folder on the little CD that came with the cable
  4. Plugged it in again
  5. Opened Device Manager; it was there as COM3
  6. Using Device Manager, set baud to 75, data bits to 8, parity to none, stop bits to 1 and flow control to none
  7. Plugged in the EP44 and set its terminal properties to match; use CR+LF to eat the LF that Windows sends (otherwise will get double-spaced output)
  8. Went to Add printer. Added a local printer to COM3 and chose the Generic Text Only driver
  9. Printed a test page, no problems
  10. Works; can print plain text and a handful of symbols
Photo showing the machine viewed from above.
The Brother EP44 dot matrix typewriter/serial printer.

The adapter does not work on Linux. I am more than a little annoyed by that, since that was why I wanted an FTDI one. I hardly ever use that Windows machine.

End it

Printing to the EP44 — doing it properly

I rigged up a dodgy way to print to the Brother EP44 using a simple three-wire cable. The problem with that is the printer cannot keep up with the serial port and the text starts to go funny.

Later, trying to play with it as a terminal device, I made a null modem cable and plugged a DE9 to DB25 adapter on it because the EP44 has a DB25 plug. I tried using that as a print cable, and because it has the full complement of wires for flow control, if I set the printer spooler to use XON/XOFF (software) flow control, I can print using lp without using a script that sends one line at a time — the printer can use the extra wires to signal to the computer to wait (buffer full).

screenshot showing the menu giving flow control options -- xon/xoff is software control
Using the CUPS interface at http://localhost:631 to set the options on the Brother EP-44 printer

The end result is that printing to the machine is very simple — if the full null modem cable is used. The 24-pin typeface is quite nice and very readable, and the only disadvantage really is the thin thermal paper (fax roll) that I have to use.

Printing from GUI applications does not work unless (like, say, nedit) they call lp to send the job. Using the CUPS browser interface to set up the printer works, but I have to use lp to send the job. Maybe I can figure it out, but it’s not really important.

The EP44 is a very portable printer. Works for ages off its batteries, or can even be run from the 5V output from a USB powerpack, if you don’t mind butchering a USB cable, as shown on YouTube.

It’s just a curiosity, but an impressive little one.

Here is setting it up using a hardware serial port, /dev/ttyS0.

  • Printer set to 1200 baud, 8 bit, no parity.
  • Open CUPS web interface
  • Add Printer
  • Serial Port #1
  • Set as in picture above
  • name it ep44
  • Make: Generic
  • Model: Generic Text-Only Printer (en)

Can set some defaults (TAB size, whether continuous or roll of paper, and so on). Don’t bother printing from the GUI, but open a command line, and…

$ lpstat -a
ep44 accepting requests since Mon 22 Feb 2021 17:22:12 AEDT
$ lp -d ep44 some-text-file.txt

Works a treat. Remember to set the printer so that line endings ar CR/LF, to absorb the unneeded line feed. Set it to typewriter codes to do underline and super/subscript using ESC codes. Otherwise, 7 or 8 bit. Need tor read the manual! (Can find it online with a web search.)

The future is 1984!

Time fixes the EP44

While I was monkeying around with my Brother EP44 — one funky old bit of hardware — I managed to send it some weird code that caused it to print really condensed characters and not respond to the return key… I was trying to use it as a serial printer, which worked on Windows via a USB to serial adapter and on Linux with a hardware serial port, but I could not get it to work on Linux via a USB adapter.

After I messed with it, whether I was typing or sending to it from the computer, the text looked like this:

Scan of bad text
Weird condensed text from my EP44 — not what I wanted to see…

And I thought maybe I’d bricked the thing. I tried turning it off and on again and suchlike, and there’s some kind of reset key combination too (turn it on with the red C key depressed), but that did not help. I took out the batteries for varying lengths of time and put them back in. No good.

As a last resort, I took the batteries out and left it in a cupboard for months, hoping that when it reinitialised it would be all right. Yes, I was hoping for some kind of magic to occur. And it did.

Here is the most recent typing test:

a scan of the printout -- looks great!
Character set from the EP44 — ‘a’ is used to demonstrate the range of accents available

So it’s alive! I should note that I scanned the type at 600 by 600 greyscale using xsane, then used ImageJ to threshold it. That makes it look very black. The original scan looks more like this:

The scan before thresholding

It would not look so bad if I used clean, flat paper! Also, the fax roll is so thin it should really be backed when scanning. The thresholded image gives a good idea of the glyph shapes and the wide range of choices. The accent characters can be put above any character you like — they print, but do not move the typehead, then the next character goes underneath.

K41693501
Serial number
The logo on the EP44

Yay.

 

The Brother EP44 as a serial terminal for DOS

This is so nerdy.

I made up a printer cable for my EP-44 – it is the ‘Common serial printer cable’ taken from this page. I don’t normally take images from the web, but since pages do sometimes vanish, this is the wiring diagram I followed:

DB-9 (actually DE-9) to DB-25 serial printer cable wiring diagram

And it works very well as a serial printer cable from Linux (using a hardware DE-9 port). In fact, it works very well from DOS. I installed FreeDOS on a partition on an old Compaq Armada E500; it has a hardware serial port (DE-9) so is very nice for monkeying around.

Plugged the EP-44 into the computer and turned both on. Hint: this won’t work if this step is omitted!

Photo
The EP-44 connected to the Armada by a home-made cable

Set the EP44 to 1200 baud, N parity, 8-bit data and used the DOS MODE command to set the port to the same.

C:\> mode com1:1200,n,8,1,b

And I could print by copying stuff to COM1. Can also try:

C:\> mode lpt1:=com1:

This assigns COM1 as the printer port. The problem is that the EP44 has a very small buffer (160 bytes, IIRC), so as once before, it is a good idea to send the file a line at a time, using a little script. Slowing the baud rate right down (the computer can go as low as 110) helps, but even 110 baud is still a lot faster than the typewriter can print.

Now, I recently found out that using a full null-modem cable (uses more than the 4 wires in the diagram above) as a printer cable works really well with Linux — it allows for XON/XOFF flow control and line-by-line printing is not needed. DOS is not able to make use of the same cable, for some reason (or at least I could not do it), but works well with the simpler cable. So the EP44 (with and without hyphen) acts as a battery-powered 24-pin (NLQ) thermal printer that can be transported around with your laptop. How very 1990s!

But it gets funkier. If you like that sort of thing.

DOS has a little-used command called ctty, ‘change tty’. It can be used to make DOS look somewhere other than the console (ie keyboard and screen) for input and output. I found that it works with the EP-44, though the baud rate has to be set right down or the EP44 keystrokes don’t get captured (most worked, but the Enter key was flaky at higher baud. Who knows?).

On the DOS PC typed:

C:\> mode com1:110,n,8,1,b
C:\> ctty com1

with the EP-44 set at 110 baud, 8-bit data, no parity.
This gave me this on the EP44 screen (and on the fax roll I was printing onto):

photo
DOS prompt on the EP-44 screen

I could then type commands on the EP44 and get the output on the printer (it also appeared, uselessly, on the 16-character screen), with the console (screen) on the computer looking frozen and the computer keyboard not taking input. Here is a scan of a brief DOS session, as it happened on the EP-44.

scan of printout
DOS session on paper

At the end, as you can see, I typed

C:\> ctty con

and control went back to the computer and its keyboard. As you can see, during the session I can get listings, create and view files, and move around the directory structure. I’m sure I could do lots more. Anything that uses graphics, or addresses the video RAM directly, or even addresses the screen out of order, won’t work. I read somewhere that a DOS Elvis version worked on a DOS serial terminal; how it would work with a paper roll, I don’t know. I guess you’d have to use EDLIN or something! When I tried to use FreeDOS’s edit to look at a file, the screen on the computer lit up. The EP-44 printed the console output that firing up the editor gives (see below), but the editor screen itself appeared on the computer screen and could be used on the computer via the computer keyboard. When I exited edit (using the computer keyboard), control passed back to the EP44.

It would be possible to use a normal DOS session to put the commands that initiate the serial session into autoexec.bat, such that the machine would boot into that state. Then you’d have headless DOS. Kind of.

scan of output
Running edit

I found that many but not all of the special characters (accents, pound sign, that sort of thing) that the EP44 could generate could be written to a file and would then show up when viewing the file on the computer.

scan of printout
Non-keyboard characters that worked

It depends on where they sit in the ASCII table, I guess.

You can backspace over a mistyped command or file name (like the word ‘symbol’ above), and fix it before sending it to the computer, but of course the typewriter has already printed your mistake, giving overwritten results.

The typewriter lets you choose between CR and CR+LF for line endings, so if you get too many empty lines, try adjusting that setting. DOS uses CR+LF, so if the typewriter is just expecting CR it will not eat the LF and you get double-spaced output.

photo
The scanned output as it came out of the typewriter

Of course, this is just a toy. I tried playing with agetty under Linux, but I could not get the same results, not with the simple cable nor the full null-modem cable. Probably some serial port settings are not right, but I ran out of enthusiasm when trying to sort it out.

Anyway, useless but nifty.

USB to serial (DE9, often called DB9) — what chip is that?

Just my notes on a small fraction of what’s out there.

Any cheap unit (under about $10) is likely to have a WinChipHead CH340/341 (or whatever it is called), and might work but might not. Mixed results at best. One of these almost bricked one of my machines. Also, even though they are notionally a Prolific copy — in that on Linux you’ll use the pl2303 kernel module as a driver — Linux will often not be able to drive them. Windows seems to do better, because the manufacturer-supplied drivers are better for Win; but still not quite right.

It’s not always easy to know whether a cable will have an original chip in it or a cheap knockoff. I guess if you buy an FTDI-made cable you can be sure it will contain an FTDI chip. I’ve seen a lot of cables advertised as FTDI but the outer mouldings are the same as on the really cheap WinChip cables, and I have my doubts about what’s inside.

Some experts recommend FTDI — http://www.usconverters.com/index.php?main_page=page&id=62&chapter=0.

Here is what I found out about some of the infinite number of options.

  1. The really cheap (often blue) no-name ones that are on ebay for like $5. Good luck! It might work, and you’ll save $30+ compared to some options, but it might not; I’ve had limited luck. They have a knock-off of the Prolofic PL2303 — at least, that’s the kernel module that Linux loads (though that does not mean the device will work as you expect).
  2. ATEN UC232A or A1. What’s the chip? Linux driver (see https://assets.aten.com/product/manual/uc232a-uc232a1_um_w_2020-10-13.pdf) uses the pl2303 module. So that is … Prolific.
  3. Alogic UD29A PL2303 — Prolific (see https://www.alogic.co/pub/media/mageworx/downloads/attachment/file/a/p/ap1103_20140103.zip).
  4. CHIPI-X10 — FTDI (https://ftdichip.com/products/chipi-x10/) — actual FTDI product, so probably a good bet! (FT231X); also other options too (eg US232R-10-BULK).
  5. Astrotek 205153-D00000 — manufacturer website down. Probably PL2303 or clone.
  6. Klik KU2DB9015 — shops say FTDI, but cannot find manufacturer page. ‘CD’ at https://www.comsol.com.au/Products-by-Category/USB-Converters/KU2DB9015 has PL2303 and FTDI drivers on it … so probably FTDI.
  7. MCT U232-P9 — this is advertised in some places as FTDI, but a little bit of digging suggests it is Prolific. Some older ones use a Phillips chip. Seems like an old device.
  8. Sunix UTD1009DF — manufacturer says FTDI: https://www.sunix.com/en/product_detail.php?cid=1&kid=3&gid=18&pid=1924.
  9. Sunix UTS1009GC is Prolific. So is UTS1009D — varies by model.
  10. Unnamed one from Jaycar — (https://www.jaycar.com.au/usb-to-db9m-rs-232-converter-1-5m/p/XC4834) Prolific (based on drivers supplied).
  11. CableCreation — seems to do both. Seems too cheap … sold on Amazon, which I try to avoid.

FreeDOS and email (FLmail)

It works. What else can I say?

Step 1 was to get networking working. For that, I’ll write another post.

But for now:

The machine is a Compaq Armada E500 — an old laptop from a times when USB was coming in and floppy drives were going out. Powerful by DOS standards (Pentium III, 30 GB HDD, 300+ MB RAM). It uses an Intel(R) PRO/100 (e100) for wired networking, which makes setting it up as easy as DOS networking can be.

The mail client is FLmail — from Georg Potthast, here: https://sourceforge.net/projects/fltk-dos/files/Applications/Binary%20versions%20of%20FLTK%20applications/. It’s a very useful suite of stuff — this version of Dillo works well on DOS too. And muPDF, FLwriter and a-paint are all very nice. Georg’s work on FreeDOS is truly outstanding. See here: https://sourceforge.net/p/freedos/news/2013/09/flmail-email-client-for-dos/

The mail provider I tried it with was GMX. They provide free email access, and their app is not too bad. Getting FLMail to work was not too hard. The POP3 server is pop.gmx.com (port 995) and the SMTP is mail.gmx.com (port 587) And then I created a directory in C:\FLMAIL that matched my username. Then it worked! Ah… but I did edit the config file by hand. The file was in directory of C:\FLMAIL\XD640CFG\ETC and called FLMAIL.CFG. I deleted the section about yahoo and changed all instances of dosusb (the example account) to my username.

Here is FLMAIL.BAT — the batch file (shell script) to launch FLmail; my notes have stars (*).

@echo off
REM Customize these lines for your system:
REM --------------------------------------
set FLTK_SCHEME=grad1
set FLMAIL=C:\FLMAIL
rem set FLMAIL=G:\FLMAIL

REM * The wrong video option here and the computer will lock up, or
rem * errors will be thrown and the program will crash. YMMV

set NANOSCR=640 480 8888

REM -------------------------------------------
REM You shouldn't need to edit below this line.
REM -------------------------------------------

REM * -- but I did! REM * On my machine, I have a working wattcp.cfg in REM * c:\fdos\ and all config or batch files that need it are REM * edited to look there. And the WATTCP.CFG environment
REM * variable is already set, so I do NOT want to set it
REM * here, so I commented it out. rem set WATTCP.CFG=%FLMAIL%\xd640cfg\etc %FLMAIL%\bin\flmail.exe %1 >flmail.log

Some notes:

  • I am not using 2 factor auth on GMX. I set up a mail account completely separate from any sensitive or personal mail account. If using Gmail, you must use an app password (16 character combination). It works, but the password is stored in the clear, if you store it.
  • I found the video mode to use by trial and error. When setting up in DOS, you must be prepared to reboot the machine when something goes bad!
  • FLmail uses SSL and TLS, but if you ask it to store your password it will be stored on your computer in the clear.
  • Some screenshots can be found here: http://techbastards.com/get-your-emails-in-a-graphical-dos-client/
  • DOS networking is never really seamless — DOS is a one-thing-at-a-time experience, so you can’t ask FLmail to download your emails and then tab out to do something else — but while you wait a status line keeps you informed about what the program is doing.
  • It can cope with HTML emails.
  • It includes an address book and some other utilities.
  • You can have separate accounts and access them all, but they should have different user names (the bit before the @ in the email address, usually).
  • I have used it to send attachments no problems. For example, I emailed myself the FLMAIL.BAT file shown above.
  • It has not been updated since about 2014, but that does not seem to be an issue.

Conclusion: Quite usable!

DOS is dead, but lots of people won’t let it rest!

Using find to copy files from anywhere

Note to self:

I want to copy all files with, say, ‘dave’ in the title, no matter where they are or what the case is. In other words, I want to collect them all in one place.

There’s a really easy way to do this, using the Linux/unix find command.

First, I find the files and look at them, just to make sure they are (mostly) the ones I want:

$ find . -iname "*dave*" | more

Let’s parse this.

find is the command

the dot, ., means ‘from the current directory’. I had already cded to the relevant directory, in this case my home directory. I could have instead typed:

$ find /home/username -iname "*dave*" | more

and done the same thing. Now,-iname means ‘examine the names of the files, ignoring case’. If I had just used -name, the search would be case-sensitive.

Then I give the pattern I want to look for — anything with ‘dave’ in it. Then I just pipe (|) through more in case there are lots of answers.

I’m going into all this detail because find is so powerful, but that power means the help for it (the man page) can be quite daunting.

OK, so I know what files I will get. Now, I want to copy them all to a USB stick. So:

$ find . -iname "*dave*" -exec cp -iv {} /media/username/USBNAME \;

Now, -exec says ‘execute the next bit as a command’.

cp -iv is just the cp (copy) command, running verbosely (v) so I can see what’s going on, and interactively (i) so I can check if any files are getting overwritten. Because I am copying files from all over my file space, I could dig up two files with the same name, and the later one might overwrite the first when I copy. cp -i will ask me, and it will show me the paths, and if one directory is preferable to another, I can say no, don’t copy over. Or I can open a new terminal window or tab and compare the two files and see if they are the same or different and if different which one I want.

The empty pair of braces stand in for the output of the find command, result-by-result, so find finds a matching file, then runs the cp command with the file name where the braces are, then finds another file, and so on until no more files are found.

The semicolon ends the command, a bit like a line of C code, but to be read as  a semicolon it must be escaped, hence the preceding backslash.

This is a very useful general recipe:

$ find [files according to some rule] -exec [some commands, using {} as the input file] \;

End of note to self.

Talking to the EP-44

Talking to the EP44 from a computer is dead easy. First, I wired up a null-modem cable (I ordered one, but it turned out to be a basic extension cable — wires were not crossed over. So I cut it in the middle and crossed them over myself).

Then I attached the cable to the EP-44 and to the serial port on the back of the computer (note, I used a real, hardware serial port for this, not a USB-to-serial converter).

Turned on the EP-44 and set it to terminal and to 1200 baud, 8 bit data.

On the computer, used stty to set /dev/ttyS0 to 1200 baud.

$ stty -F /dev/ttyS0 1200

$ stty -F /dev/ttyS0 -a

speed 1200 baud; rows 0; columns 0; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0; -parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

$ sudo adduser -a -G dialout username

Then typed:

$ cat /dev/ttyS0 &

$ cat > /dev/ttyS0

The first cat command takes anything from the serial port and puts it on the screen — in UNIX, everything is a file, including the serial device. The second command (not cast off), sends whatever I type on the computer to the thermal printer. So one could use this a bit like the talk and ytalk programs on UNIX.

That’s it, it works.

screenshot of a terminal session
Talking to the EP-44: Text on the screen of the laptop

scan of the same text on the EP44 printout
The same text on the EP44 printout

Now, the same connection can be used to send the contents of the printer’s memory (about a page or two of text) to the computer screen. You just press the Text button on the EP44 and cat the port to a file ($ cat /dev/ttyS0 > filename.txt).

Note that this is different from actually using the printer as a terminal, in that I am not sending commands to the computer and getting back the output, though clearly that can be done, seeing as the characters are moving between the two devices.

The text below was typed on the EP and uploaded to the computer using cat.


Blogpost

The Brother EP-44 can be used as an editor and word processor. It’s memory can hold about 3700 characters, which can be edited, modified and then either printed on the EP-44 or transferred via a null modem cable to a computer for printing, uploading or editing. The text you are reading now was written on the EP-44 without any of it being printed. Having said that, the 16-character screen of the EP-44 is not much good for editing. Indeed, if you get distracted and forget the start of the sentence, it can be all to easy to start one sentence and finish another.
I can check how many characters I have left by pressing CODE+r (‘REMAIN’). The manual, available online at http://munk.org/projects/Brother-EP44-User_manual.pdf gives details of the editing functions available. They are adequate, if not easy by modern standards. If you carried around enough equipment, it would be possible to send the text to an office over the phone lines via the RS232 port on the side, but it is hard to believe that anyone would bother. Even in the early 1980s, one of the little LCD notebook computers of the time, like the TRS-80 would be highly preferable (though three times the price). The main benefit of the EP lies in the attached printer, which means it is better used for input than output — input via the keyboard or via the serial line when using it as a printer. Speaking of input via the keyboard, I must say that the keyboard is surprisingly easy to use. It looks like a big calculator but types much better than that. Indeed, you can build up pretty high speed if you try. It works very well on the lap, and the keys are very reliable; you know when you’ve hit one, so you very rarely double hit or miss a character. The gaps between them help avoid hitting the wrong key, and mean that the overall dimensions are those of a full-sized device. Were I to make any change, I would put in a horizontal rather than vertical return key — why? — because I tend to hit it when I am looking for backspace.
One more comment. Although only showing 16 characters, the screen is surprisingly useful. It is big enough to show you the last word you typed, so you can quickly backspace over errors and fix them. If you are used to fixing errors on the spot rather than leaving them and going over the document later, then it is possible to make pretty clean copy without too much trouble.
As a final note, with this much text typed, I currently have 1280 characters left in the machine’s memory. Hence, we can see that the EP-44 (or EP44, depending on which documentation you read) can certainly provide enough space to write up a blog post of more than adequate length, especially when discussing a topic as boring and redundant as this one!
Now, at the end, let’s add in the non-ascii characters and see what can be downloaded over the serial line.
1234567890-=qwertyuiop asdfghjkl;’zxcvbnm,./
!@#$% &*()_+QWERTYUIOP ASDFGHJKL:”ZXCVBNM,.?
+ []{}<> $ \ ;’ #| &!@ *
OK, that’s done. Now we have 719 remaining.


Notes:

  • The text above between the horizontal lines makes up about 550 words, so we can estimate something like 650 words as the limit. Compare the list of characters that made it over the serial line with the type specimen:

scan of the typeface -- it's quite nice

  • The text above was sent by hitting CODE+s then text. Note that nothing seems to happen, but tail -f on the file works well and shows it to be transferred. To empty the memory and prevent the content getting printed at an inconvenient time, the simplest thing to do is turn the machine off, then turn it on with the C key (red cancel key) held down; this returns it to factory settings, a bit of a nuclear option. It is not supposed to print what is sent to the computer, but it does, so maybe there’s a bug in mine, I don’t know, but this will do.

Over and out

lpr on Win 10

lpr came along with gnuwin32, which I always find useful. From the man page:

lpr spools a file to the specified printer device. No formatting is done — data is sent “raw”.
This is useful, for example, for sending Postscript data to a Postscript printer.

H:\>which lpr
C:\Users\username\installs\getgnuwin32\GetGnuWin32\gnuwin32\bin\lpr.EXE

How to get the print queue name?

Windows:

Settings → Printers & scanners

Choose the printer of interest and look at Hardware properties. See the entry “\\Server name here\KONICA MINOLTA C224e PCL SP” (I have clumsily changed the real name of the queue) — that total string, exactly as given in quotes (because of the spaces), gives the printer queue.

Screen shot, showing the required information
Look at the top field in the General tab of the Hardware properties dialogue

If on the Windows command line I type:

C:\> lpr -d "\\Server name here\KONICA MINOLTA C224e PCL SP" textfile.txt

Then my plain text file comes out the printer.

Note that lpr is raw — so don’t send a PostScript file unless it is a PostScript printer! I found could send PostScript and (some) EMF (Windows enhanced metafile) directly! But not PDF. Of course, that relates directly to the model of printer. This could be useful to print to an old serial printer.

In Windows, you can create the environment variable PRINTER:

C:\> set PRINTER=\\Server name here\KONICA MINOLTA C224e PCL SP
C:\>echo %PRINTER%
\\Server name here\KONICA MINOLTA C224e PCL SP

and then print using:

C:\> lpr filename

(Can put the environment variable in the settings to make it permanent.)

This works nicely with the output from a2ps (if I set it up to print to a PostScript file) and LaTeX, because I can print the output of dvips. Note, though, that the PostScript file itself may need to have duplex and tumble commands inserted correctly if you want 2-sided printing to work well. This stuff varies from place to place.

 

Command liney

 

 

Printing from HP 200LX palmtop

The HP 200LX has a serial port on the side. It’s little and rectangular, but pretty standard apart from that. Since I have acquired an appropriately vintage serial printer, I thought I’d give printing from the LX a try.

It turns out to be remarkably simple once the hardware is in place.

The printer has a female DB25 plug on it. I had an old serial line that had a male DB9 (DE9) on one end and a female DB25 on the other, but I also have an adapter that will make a male DB9 into a male DB25. Thus, it seemed to me I could put a rectangular plug on the end of the cable attached to the male DB9, then convert that to DB25 and plug it into the printer.

The first way I tried to get a plug that would fit the 200LX serial port was using a 5 x 2 section of IDE ribbon connector — but the pin spacing is too big by a factor ot 5/4 (4 pins fit in the space where 5 need to go). Purely by chance, I found a broken Conner CP2121 hard drive, and you can see that on the PCB there are some pins and on them is a sort of socket plug thingy (see, I know all the technical terms). Since the drive was cactus, I pulled this off, filed it down to be 5 x 2 and found that it fitted perfectly!

Photo of dismantled hard drive
The Conner HDD opened up — yellow arrow shows the pins in question

photo showing the white plastic plug
The case of the Conner HDD with the plug, after it was removed from the pins shown in the previous picture and filed down to size

Soldering the wires on was tricky, but since I was making a 3 wire null modem (see this page), I did not need to deal with all of them. I decided to solder them all because I might want to make up a full handshaking cable at some time, but I could not use them all because the DE9 was missing some wires. I think it was a commercial ‘dumb’ null modem cable or something. Checked for continuity and crosstalk frequently.

Wiring is pin 2 on end 1 ro 3 on the other, 3 on end 1 to 2 on the other and 5 to 5
The null modem wiring — image from https://www.lammertbies.nl/comm/info/RS-232_null_modem.html

 

photo of the plug, held in pliersphoto of the plug, held in pliers
Soldering the wires onto the back of the plug

I then used a multimeter to check which wire went with what pin on the DB9 plug, and soldered the two halves together to get my LX null modem cable. The main challenge is really anchoring the wires such that you don’t break the connections when pulling out the plug (my main tactic — very subtle —  is to use lots of tape). The other trick is that a rectangular plug can be put in upside down. The LX socket has a rebate in the top edge to prevent this, so I glued and taped a waste bit of wire insulation to the appropriate side of the plug so it would only go in one way. The other trick is to remember that the pin numbering you see on the LX has to be mirrored (right to left become left to right) when numbering the wires on the plug.

Here is a picture of the final cable — hardly a professional job, but I could confirm using a multimeter that the three wires I needed (2-3, 3-2 and 5-5) were unbroken, and that there was no crosstalk between wires. Ready to go!

photo, showing lots of tape
The final cable — hardly tidy

I set the printer to 300 baud (it is very old), 8 data bits, no parity.

I used the Setup menu on the LX to turn on the COM1 port (to save batteries, I keep this turned off whenever I am not actually using it) and to configure the printer. The old printer is plain text, so Epson FX-80 is the most suitable of the three printers built into the LX; chose 300 baud.

Saved all the changes and exited Setup.

Opened Memo, opened a memo and sent it to the printer. No worries! Almost … the printer is really a typewriter, and it prints slowly and has only 160 bytes (not KB, B) of a print buffer, so even at 300 baud the characters are soon coming too fast for it. It can only print small files, or bits of a file. But I can print from:

  • Lotus 123
  • Memo
  • Appointment
  • And probably other things if I could be  bothered.

What about printing from the command line?

Opened the DOS prompt and typed:

a:\> mode com1:300,n,1,8,b

Now, it is tempting to then use mode to redirect the printer (lpt1:) to the COM1 port, but Setup has already done this, so now I just need to go:

a:\> copy file.txt lpt1:

the serctl program that comes with the LX can turn the serial port on or off, wired or infrared, from the command line.

So there it is, the LX can print to the EP44. There was one other thing to try. The LX comes with a terminal program, and the EP44 can store 2 pages of text in its own memory, Can the EP44 text be dumped into the LX?

Yes.

If I run the terminal program, set the baud rate to match the typewriter, and then start capturing the session (but without echoing local commands to the file!) then I can hit ‘Text’ on the typewriter and the contents of its memory will appear on the screen of the LX and then in the capture file.

Thus, the battery-powered HP 200LX can be paired with the battery-powered (but much larger) EP-44 in some weird kind of 1990s mobile office situation.

Who cares?


Serial port pinout

[1 2 3 4 5 ]
[6 7 8 9 10]

1 – DcD
2 – Rx
3 – Tx
4 – DTR
5 – GND
6 – DSR
7 – RtS
8 – CtS
9 – RI
10 – Shield ground