Reprogram OpenLog to record TXD and RXD

I want to use an OpenLog to monitor data signals been sent between two devices, for this I need to monitor the RXD and TXD lines of one device.

As I understand the standard OpenLog firmware is designed to just record data it receives on the RXD line. And TXD is used for it to send data.

Just looking for confirmation that it's possible to modify the standard firmware to record both RXD and TXD lines (GitHub - sparkfun/OpenLog: Open Source Hardware Datalogger). Additionally can I use an Mega 2560 board to reprogram the OpenLog, rather than purchasing an FTDI Basic board from SF.

Thanks,
Marco

You will need two OpenLogs for that. Only one line can be monitored at any one time.

Alternative: logic probe. This cheap one can monitor 8 lines simultaneously (and decode data bytes).

Ever been in one of those car dealerships where the vehicles have no prices listed? Your question is somewhat like that ... if you have to ask, you cannot afford it. In this specific case, I use the word "afford" to mean "accomplish without significant assistance."

Frankly, I'm not sure I could do this (phantom captures) without some serious bench time with real hardware. Assuming I feel confident I could do it, I'm not sure that OpenLog is the template I would start with for the project.

Consider:

  • you cannot receive serial data on a Tx line, so you need 2 Rx inputs
  • Using 2 Atmega UART Rx lines, there would be 2 input buffers
  • The above buffers are not synchronous
  • pseudo-threading both RX inputs would need to be carefully timed
  • adding a per-character/byte timestamp is outside OpenLog

And many, many more design concerns. You would be recording 2 signals as a "phantom" logger so there is no way to Ack/Nak the transmitters.

So, while I give myself a 50% chance of writing such a project before I get frustrated and abandon it, I have no way of judging your success potential; therefore, my belief is that I cannot confirm that it is possible to modify the standard (OpenLog) firmware.

Regards,

Ray

PS: jremington has the right idea. I own a Saleae Logic Analyzer and it easily handles such tasks.

Yes. And then figuring out who said what when will be hard to impossible. Said with french accent. Unless you arrange that what you record had build-in timing info.

You could use an Arduino with two ports.

The logic analyser is a good idea, but not really practical for any long term monitoring.

Having said that I must limit out that there is no excuse not to have one, these and others like it you can find even cheaper work very well:

I got a counterfeit of this clone, I think it was $13 and a bit of a wait ordered on ebay.

Use it alla time, surprise myself.

a7

I hsve used this to monitor the serial connection on a vending machine I had to reverse engineer. Use a diode to the RX line, to the Rx on the logger and the Tx as normal, It's up to you to see what is Transmitted and what is Received.

The OpenLog is a great little device, and just as cheap as the logic probe. I've used it for months at a time.

It is possible to have it record a millis() or micros() time stamp along with each character or line received (for later analysis), but synchronizing two loggers could be a bit tricky.

@mb19414 you don't say if the 2 devices exchange data at the same time, or if 1 device only transmits in response to a message from the other device.

What baud rate are the devices using?

Have you chosen Openlog because the systems are out in the field? If it's a bench setup, then a cheap LA as suggested by @jremington in #2 would work.

The hardware is basically an Arduino Nano with an SD Card slot.

They are playing a bit fast-and-loose with the specs since they are running the processor at 3.3V and 16 MHz. I don't see any level shifters so the serial port is 3.3V.

For baud rates below 115200 you could use Software Serial to add a second "serial port". That would let you record two streams at the same time. You may need to modify the log format to keep track of which direction the bytes are moving.

The hardware is not designed to be re-purposed so an Arduino Nano with an SD Card module would be a much better solution. If you want to tap into a USB connection you will need two USB-to-Serial modules.

If you use an Arduino Pro Micro, which has built-in USB, you wouldn't need a USB-to-Serial on one side and your wouldn't need to keep the baud rate down because it has a hardware serial port as well.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.