Go Down

Topic: How to read data from Rx/Tx lines connecting two arduinos (Read 1 time) previous topic - next topic

belimawr

I have two arduinos communicating using the serial (Rx/Tx) but I need to see what is being transmitted to debug.

What I tried is to connect both arduinos (arduino nano and arduino ethernet using a FTDI board) to my laptop and use minicom and arduino IDE to "sniff" both data lines, but it does not work...

Is there a way to "sniff" bolt Rx/Tx lines without a logic analizer?

robtillaart

have you cross connected the lines?

The TX of Arduino 1 must connect to the RX of Arduino 2 and the other way around. Also connect grounds so they have a common reference.

and the baud rate should be the same of course.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

PaulS

Quote
but I need to see what is being transmitted to debug.

Then don't have the two Arduinos tying up the hardware serial port. Have them use SoftwareSerial and two other pins to talk to each other.

belimawr


have you cross connected the lines?

The TX of Arduino 1 must connect to the RX of Arduino 2 and the other way around. Also connect grounds so they have a common reference.

and the baud rate should be the same of course.

Yes I did it.



Quote
but I need to see what is being transmitted to debug.

Then don't have the two Arduinos tying up the hardware serial port. Have them use SoftwareSerial and two other pins to talk to each other.


It should solve my problems, thanks :

CrossRoads

#4
Jun 17, 2013, 07:54 pm Last Edit: Jun 17, 2013, 07:56 pm by CrossRoads Reason: 1
You can connect Rx to Tx, Tx to Rx  (and Gnd to Gnd if needed) and monitor what each one is outputting via the Serial monitor connected via the USB port.
You shouldn't enter anything from the Serial monitor as that will interfere with the  Tx lines, but you can certainly monitor what is happening on the Rx.
I was doing this over the weekend, two instances of the IDE on one computer, each with an Uno.
Used Serial.write commands to send simple messages back & forth. Data from 0x48 up to 0x126 showed up on the moniters as regular characters 0-9, A-Z, a-z, plus some of the punctuation characters. The complete list can be seen as www.asciitable.com
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

I disconnected the cross-board jumpers on one end while uploading a sketch variation, then plugged them back in when done.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up