Pages: [1]   Go Down
Author Topic: How to read data from Rx/Tx lines connecting two arduinos  (Read 1127 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13742
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Rob Tillaart

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

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 617
Posts: 49463
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 :
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27147
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: June 17, 2013, 12:56:54 pm by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27147
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I disconnected the cross-board jumpers on one end while uploading a sketch variation, then plugged them back in when done.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: