50

I'm reverse-engineering a serial protocol and getting frustrated by bad tools. Does anyone know of a good, free tool for logging data to/from serial ports on Windows?

Requirements:

  • Must be free
  • Must not take control of the port (i.e. must hook the file APIs or the kernel rather than trying to open the device)
  • Must have some sort of filtering features
  • Writes either human-readable or binary logs, preferably in an easy to parse format

Any ideas? Portmon works, but its logs are difficult to work with and its filters are effectively useless; I've also tried a few commercial tools and nothing seems to fit the bill.

MPelletier
  • 16,256
  • 15
  • 86
  • 137
Serafina Brocious
  • 30,433
  • 12
  • 89
  • 114
  • 1
    According to my experience, RealTerm (http://realterm.sourceforge.net/) is far best. . Monitoring, Echo, Capturing (To disk) all can be performed. – Hassan Rahman Mar 19 '15 at 12:31
  • 7
    move to electrical engineering? This question deserves to be answered, despite stackoverflow's snobbery against software recommendations. – Jason S Nov 21 '17 at 16:50
  • I've spend few hours today solving same problem as OP. Found [SerialMon](https://www.serialmon.com/) which did the job well enough. – Sinatr May 04 '21 at 09:10
  • There is another option that is not purely software but is quite cheap. Buy 2 serial to USB converters. Assume you want to monitor COM1 and the USB converters are COM2 and COM3. Hook the TX line of COM1 to the RX line of COM2. Then hook the RX line of COM1 to the RX line of COM3. You can then monitor COM2 for transmitted data and COM3 for received data. – MikeKulls Nov 28 '21 at 23:05

4 Answers4

16

I hear a lot of good things about com0com, which is a software port emulator. You can "connect" a physical serial port through it, so that your software uses the (monitored) virtual port, and forwards all traffic to/from a physical port. I haven't used it myself, but I've seen it recommended here on SO a lot.

Coderer
  • 25,844
  • 28
  • 99
  • 154
11

Portmon from sysinternals (now MSFT) is probably the best monitor.

I haven't found a good free tool that will emulate a port and record/replay comms. The commercial ones were expensive and either so limited or so complex if you want to respond to commands that I ended up using expect and python on a second machine.

Martin Beckett
  • 94,801
  • 28
  • 188
  • 263
0

I've been down this road and eventually opted for a hardware data scope that does non-instrusive in-line monitoring. The software solutions that I tried didn't work for me. If you had a spare PC you could probably build one, albeit rather bulky. This software data scope may work, as might this, but I haven't tried either.

SmacL
  • 22,555
  • 12
  • 95
  • 149
0

I'd get a logic analyzer and wire it up to the serial port. I think there are probably only two lines you need (Tx/Rx), so there should be plenty of cheap logic analyzers available. You don't have a clock line handy though, so that could get tricky.

Nick
  • 13,238
  • 17
  • 64
  • 100
  • The question asked for free tools. A logic analyzer is one of the most ideally suited tools to inspect, reverse engineer, or troubleshoot a link or bus. Another highly well suited tool is the obsolete Hewlett Packard 4957A / http://www.hpmuseum.net/display_item.php?hw=1124 These are not free tools, though. – ndemarco Feb 24 '22 at 20:49