3

The title sounds worse than it really is :)

I have a printer which is connected to a host, the host uses proprietary hardware to send data to the printer. The issue is the host's date is limited to 2013 and I can't change it beyond that year without modifying the ROM on the host, which I don't think is practical.

The printer is a Transact Epic 950 and takes commands over RS232. You can find the OEM manual here

https://www.transact-tech.com/uploads/printers/files/95-05245-Rev-H-Epic-950-OEM-Integration-Manual.pdf

My workaround for this issue, was to create a circuit to sit between the Host and the Printer and basically change or replace the date before it hits the printer.

I have very little experience in electronics so wouldn't know where to start.

If anyone could point me in the right direction, that would be great.

Scott Seidman
  • 29,939
  • 4
  • 44
  • 110
henda79
  • 131
  • 3
  • 1
    Is the host just transmitting plaintext ASCII or is it sending bitmap / TrueType? If it's ASCII it should be fairly easy. – Transistor Jul 29 '21 at 17:13
  • I'm fairly sure its ASCII. The printer has fields into which the data is passed. There is the option of an image so maybe this is passed in hex. – henda79 Jul 29 '21 at 17:17
  • 1
    Assuming it's text as Transistor points out, this can probably be done with an Arduino Mega or equivalent, which provides the hardware for two serial ports at 5V, and a couple of MAX3232 (or equivalent) chips to convert between 5V and the higher-voltage RS-232 signals, as well as a 5V supply (USB or somewhere else). You'd need some C/C++ knowledge to write a program for it that can intercept the printed message and swap the date; assuming the fields are easy enough to parse this shouldn't be too difficult. – nanofarad Jul 29 '21 at 17:17
  • Yes, this sounds fairly possible, and you do not need to worry about "attacking" your own machines, because that is perfectly legal. – user253751 Jul 29 '21 at 17:19
  • 1
    Following up on my prior comment, if you can give some feedback about your level of familiarity with the things I mentioned so far, it will help determine whether a full answer is feasible and how detailed it should be to help make this a reality. – nanofarad Jul 29 '21 at 17:20
  • 1
    My electronics is very basic, resistors, diodes, transistors... basically school stuff. My expertise is software engineering, but I don't have much in C++. I'm higher level language guy. – henda79 Jul 29 '21 at 17:23
  • I think what I need to do; is somehow capture the data sent from the host and then I'll know what I've got to work with. – henda79 Jul 29 '21 at 17:24
  • You have the right intuition, 9600bd is chewable, electrically it might take some finagling, my concern would be testing in a way you don't damage host or printer. – crasic Jul 29 '21 at 17:26
  • @user253751 But the OP isn't attacking a machine, they are attacking the software running on that machine, which they may not own. Or, the license agreement that they signed may forbid such attacks. Seems to me that if this were perfectly legal there would be publicly available solutions already. – Elliot Alderson Jul 29 '21 at 17:37
  • I've spoken to the manufacturer of the "Host" which in fact is a gaming machine. The machine is a legacy product and they have no interest in supporting it. I have no intentions of reverse engineering the software in the machine, the intention is to correct the date printed on a ticket which for some stupid reason, stops at 2013 ?!? – henda79 Jul 29 '21 at 18:30
  • @henda79 One of the solutions people used for the Y2K problem (because it was a very simple quick fix) was to simply add an offset to the date, which just shifted the problem back a few years. A lot of them used an offset of 20, which made those systems encounter the problem again in 2020; sounds to me like this system may have done that with an offset of 14 for some reason. – Hearth Jul 29 '21 at 19:39
  • It could also be one of those rotating date stamps, which if that was the case you couldn't do anything about it, as the printer itself would be limited to 2013. – Hearth Jul 29 '21 at 19:41
  • @Hearth, I'm not sure why they done it, we have other machines running the same hardware and they don't have the date issue. For sure its the host, not the printer. – henda79 Jul 29 '21 at 23:14
  • Rolled back and flagged. Instead of vandalizing, bring the issue to meta, which is the right platform for such a discussion – Scott Seidman Aug 03 '21 at 22:41
  • @henda79 Please use the comment system to resolve problems, questions are used for only asking questions. Please visit the help center for guidance on what is on topic and what is not. – Voltage Spike Aug 03 '21 at 22:52

2 Answers2

5

Buy two USB to RS232 adapters, connect those to a PC between devices to sniff the bus with a terminal program that supports sniffing.

Another option with two separate standard terminal programs is to connect transmit pins of both devices also to two receive pins on PC so PC can see while the devices communicate together.

Justme
  • 147,557
  • 4
  • 113
  • 291
  • Thanks, I'll purchase the cables and connectors to check the output and work from there. – henda79 Jul 29 '21 at 18:32
  • This won't work if the protocol has any sort of tight timings. Most USB to serial converters are polled every (iirc) 16ms, this might create issues. I do know that I've had problem with high-baud ModBus RTU. Edit: I thought you wanted the data to be edited on the PC. – jaskij Aug 03 '21 at 22:47
  • @JanDorniak Sure, the pass-thru might not work if there is timing involved. That's why I suggested sniffing TX and RX separately too. And most does not mean all, and with good chipsets (and I only know of one good that I trust) and drivers the timeout is configurable, which can be set to minimum. – Justme Aug 03 '21 at 22:50
  • Maybe if you code it yourself using libftdi instead of relying on the OS it could be configurable and a passthrough would work. I mostly thought about actually changing the data, not just sniffing it. Also, I checked the converter I've got connected to my PC right now, turns out that FT232R has bulk endpoints with a vendor specific class. Bulk meaning that actual polling rate is... complicated to say the least. – jaskij Aug 03 '21 at 23:28
2

If the print data is ASCII it should be fairly easy.

Pseudo code for box in the middle.

while(1 == 1){
  a = readLine();     #Buffer one line ending in CRLF.
  b = replace("-2013", a, format(now(), "-YYYY"));
  serial.print(b);
}

The "-2013" or "/2013" should weed out non-date occurrences of 2013.

First thing to do is use a terminal emulator program to monitor the host output and check that it is in fact ASCII and to figure out what the line break character sequence is. Something like PuTTY would be an excellent choice.

Transistor
  • 175,532
  • 13
  • 190
  • 404