Watching Serial Data with Uno R3

I tried searching the forum but wasn't having much luck ... so apologies if this has already been asked and answered.

Basically, I have VixenLights talking to my Uno over hardware serial and I'd like to see/monitor the data that Vixen is sending over. I ran across this video (Wireless Lighting Control with the Arduino and Vixen - Part 1 - YouTube) where the author accomplishes this using two Freakduino(?) boards, one having two serial ports. He mentions that this could probably done using SoftwareSerial so I'm trying to imagine how that might work.

Assuming I use SoftwareSerial to setup two GPIOs to act as RX/TX that echo what is being received over hardware serial, how do I connect my PC back to those SoftwareSerial pins so I can see the data using PuTTY?

UncleMoki:
Assuming I use SoftwareSerial to setup two GPIOs to act as RX/TX that echo what is being received over hardware serial, how do I connect my PC back to those SoftwareSerial pins so I can see the data using PuTTY?

You can't, which is why the normal approach is to use the software serial to communicate with the peripheral (such as Vixen lights). It leaves the hardware port free and connected to the PC.

If you just want to monitor traffic on the other ports, you can do it in software by echoing it to the USB serial in your sketch.

@aarg Thanks for the reply. Wouldn't I be left with the same core problem - how to get my PC software (whether PuTTy or VixenLights) to communicate with the RX/TX SoftwareSerial pins? Maybe I'm missing something really obvious .... hmmm ...

You can use a USB-TTL cable to connect a PC to SoftwareSerial pins.

...R

@Robin2 - Thanks for the reply. Looks like a USB to TTL cable is more than just a standard USB data cable with exposed wires on one end? Look like there is additional supporting hardware ... a USB to UART interface chip?

The SoftwareSerial docs says that the library replicates the function of the native hardware UART so I was wondering if it was suggesting that I could just wire it to a standard USB cable and viola.

UncleMoki:
Looks like a USB to TTL cable is more than just a standard USB data cable with exposed wires on one end? Look like there is additional supporting hardware ... a USB to UART interface chip?

Yes

The SoftwareSerial docs says that the library replicates the function of the native hardware UART so I was wondering if it was suggesting that I could just wire it to a standard USB cable and viola.

Yes and NO.

SoftwareSerial does provide similar functionality (though not nearly as well) as the hardware UART. But the UART on an Uno does not provide a USB interface. On an Uno board there is a separate Atmega 16u2 microprocessor that performs the USB to serial conversion.

USB operates at 400MHz IIRC and that is far beyond the capability of a 16MHz Atmega 328.

...R

@Robin2 - thanks SO MUCH for taking the time to explain.

So to accomplish what I'm wanting to do (echo serial data coming into the 1st board's USB Serial), I either need a USB to TTL cable ... OR ... another Arduino board (or similar with 5V logic) and use SoftwareSerial to create RX/TX pins on both boards for sending data across and then connect some terminal emulator to the 2nd board's USB to view the data?

If you only want to see it, not save it, and there's not a huge volume of traffic, you could output the data to an LCD or OLED etc display connected to your Arduino via I2C or similar. I'm unfamiliar with these lights so if it's a deluge of data you're expecting, this is a bad suggestion.

Thanks @strykeroz - to clarify, VixenLights is actually software talking to the Uno over USB (serial). From what I saw in the the example video referenced in the first post, the Vixen software appears to just send a bunch of bytes to the Uno as a "frame". The byte's position in the frame determines the target output pin while the byte's value is the value for the pin and can be set via digitalWrite or analogWrite, depending on whether PWM is needed.

I have a simple setup on a breadboard with some LEDs and resistors that seems to work so no problem there (yet). However, to be honest I wrote the sketch blind, trusting what other SAID the Vixen data would look like. I thought it would be helpful/educational to "see" the data for myself as it's being sent to the Uno by the Vixen software. Storing it would be neat but for now I just want to see as it's happening, much like the guy in the video did, I'm just not quite sure how to do it, preferably with what I have handy (an Uno, some salvaged cables, a couple of Adafruit dev boards, a Pi Zero and some basic components).

So far, my thoughts are:

  • Define some SoftwareSerial pins on the Uno and send the incoming Vixen data back out on the SoftwareSerial pins. Then buy a USB to TTL cable to send the data back to the PC via USB and view it using some terminal emulator like PuTTY.
  • Define some SoftwareSerial pins on the Uno and send the incoming Vixen data back out on the SoftwareSerial pins. Then use a 2nd board and reverse the process - define some SoftwareSerial pins to receive the data and send it back out via the 2nd board's USB which is connected to the PC and communicating with some terminal emulator like PuTTY.
  • Same as one of the above but instead of using SoftwareSerial, just tap into pin1 on the Uno. Not sure about this but I'm wondering if it might work since I'm not trying to send anything back, I just want to see the data being received by the Uno. I think the problem here is the Uno is 5v logic and the rest of my boards are all 3.3v logic ... and I don't have Logic Level Shifter.

I'm leaning towards #2 because I can use what I have handy - I think one of my Adafruit boards, though 3.3v logic might have an RX pin that is 5v safe.

Understood now. I'd not checked that link up to now. His board is similar to an Arduino Mega with more than one hardware UART.

If you just want to see the traffic, there's bound to be a software tool that can do that for you at the PC end...something like https://freeusbanalyzer.com/ might do the job.

UncleMoki:
So to accomplish what I'm wanting to do (echo serial data coming into the 1st board's USB Serial), I either need a USB to TTL cable ... OR ... another Arduino board (or similar with 5V logic) and use SoftwareSerial to create RX/TX pins on both boards for sending data across and then connect some terminal emulator to the 2nd board's USB to view the data?

I think you have got to the stage where you need to do an experiment with the simplest option and see if it meets your needs.

...R

@Robin2 - I hear you ... I'm just unsure and afraid I'm going to fry something :wink: ... paralysis by analysis, I guess.

Update - was able to get the data to show in a PuTTY terminal using a SoftwareSerial TX pin on the Uno connected to an RX pin on an Adafruit Feather Huzzah ESP8266 and then making a serial connection to the Feather via PuTTY. The code was pretty basic ... basically anything coming into the Uno's Serial was written back out on the SoftwareSerial TX pin. On the Feather ... basically anything that came in on Serial.read() back out to Serial.print() ... with some formatting added for readability.

Wiring was simple - the Uno's SoftwareSerial TX pin was connected to the Feather's RX pin (which I read is 5v safe though the board is 3.3v logic) and their GNDs were connected. The Feather and Uno were connected to the PC via USB.

While everything works exactly as expected using terminal emulators, the data I'm getting from VixenLights is showing as ASCII equivalent of the DEC data I was expecting ... and I'm not sure why. But at least the values are correct ... and neither board exploded in a ball of fire :).

SOLVED - Creating a SoftwareSerial TX pin on the Uno and then wiring it to my Feather's RX pin basically turned the Feather into a USB to TTL converter. All I needed was a sketch for the Uno to create the pins, do a Serial.Read to grab any serial data coming in over USB and then SoftwareSerial.print to send the data back out as output. Since the Uno's SoftwareSerial TX is connected to the Feather's RX, whatever the Uno sends is displayed as output from the Feather and onto whatever terminal emulator (PuTTY or Arduino's Serial Monitor) is connected to the Feather. No sketch needed on the Feather.

Thanks for your help/encouragement all :slight_smile: