24

I have an Apple ImageWriter II that I'm controlling directly over a serial port (Node.JS + serialport, Windows 10).

Generally speaking, it works fine. However, occasionally instead of printing text / responding to commands, it simply prints a hex dump of all the raw bytes that were sent to it:

enter image description here

This only seems to happen after I initially connect the USB -> serial cable to the PC and power on the printer. I.e. when it is printing correctly, I've never seen it spontaneously start doing this.

Power cycling the printer resolves the issue but I'm trying to find a way to ensure this doesn't happen in software.

Does anybody know what's going on here and whether or not there's a command to ensure it doesn't do this? I'm assuming it's going into some kind of debug mode or something, but I'm not sure why and I'm not sure how to get out of it without power cycling the printer. My goal is to guarantee that this never happens.


Connection details, from comments:

It is a USB <-> serial adapter with a male DB-25 connector, to a gender changer, to a null modem adapter, to a male DB-25 <-> mini-din cable, to the printer. The printer is configured for hardware flow control (DSR/DTR as per tech manual) and the PC is configured for hardware flow control. The PC configuration does not make it clear whether DSR/DTR is being used as opposed to RTS/CTS, but I can confirm that the flow control is behaving properly during operation. I have not probed the pins to see what activity happens on initial plug-in. I have not tried configuring the printer and PC for software XON/XOFF flow control.

Jason C
  • 581
  • 3
  • 13
  • 4
    If your Windows has PNP enumeration on, turn it off. Alteratively, if you first power on the device or connect RS232 cable and connect the USB last, try connectint USB first, then either power the device on or connect RS232 cable. If you have manual, seek a command to reset it or exit hexdump mode. – Justme Jun 22 '23 at 16:11
  • 1
    @Justme Thanks for the tips. I tried messing around with power on / cable plug-in order and after not getting consistent results, I looked harder in the technical manual and found the answer. The mode can only be entered by holding the SELECT button while powering on the printer, which means that the SELECT button on this particular printer might be a bit sticky. It's good news and bad news; I posted it in an answer. – Jason C Jun 22 '23 at 17:57
  • 1
    It might be helpful t add how the printer is connected, as 'serial' got many little pitfall, handshake being not the least. This is especially true as the image writer is very picky about DTR handling (pin 1 of the mini-DIN). Certain combinations are used for factory testing - wich includes AFAIR the mentioned dump mode. USB serial adaptors are known for each doing wired stuff as soon as it comes to any lines beside data. – Raffzahn Jun 23 '23 at 16:17
  • @Raffzahn It is a USB <-> serial adapter with a male DB-25 connector, to a gender changer, to a null modem adapter, to a male DB-25 <-> mini-din cable, to the printer. The printer is configured for hardware flow control (DSR/DTR as per tech manual) and the PC is configured for DSR/DTR flow control. I can confirm that the flow control is working properly during operation, but I have not probed the pins to see what activity happens on initial plug-in. I have not tried configuring the printer and PC for software XON/XOFF flow control. – Jason C Jun 23 '23 at 16:33
  • 1
    @JasonC Better add such to the question. Point here is that DTR (pin 1) of the image writer II is used to initiate factory test sequences as well, so this may in be related what that USB adaptor is doing when the printer is powered on. – Raffzahn Jun 23 '23 at 16:44
  • 1
    Sure; I've edited it into the question. – Jason C Jun 23 '23 at 16:50

1 Answers1

31

All right; I found the explanation in the technical manual:

To determine the actual data being received by your printer, turn the printer off, press the SELECT button, and hold that button down while you turn the printer back on. Then run the program. The data received by the printer will be printed out as hexadecimal codes, each pair representing a data byte. For example, the software reset sequence ESC c prints out as 1B 63.

There are two important points:

  1. The implication (and what I've observed in practice) is that there's no way to programmatically exit this mode, as all commands, including the software reset command, end up just printing a hex dump of the command without executing. Only a power cycle can reset it.

  2. However, the only way to enter this mode is to hold the SELECT button while powering on the printer.

This means that the SELECT button on this particular printer might be having some issues, since it sometimes thinks it's being held down on power on. This also, fortunately, means it isn't a quirk with USB plug-in / power-on ordering, or unfortunate random data being sent when the cable is plugged in, or anything like that.

I'll give a little love to the SELECT button and see if it solves the issue. I have a few other ImageWriters as well so worst case I'll just use a different printer.

Jason C
  • 581
  • 3
  • 13