Communicating Between 2 Arduinos

Hi, I'm having a problem with communicating between 2 Arduinos. I have 2 arduinos connected to 2 different computers, they are connected directly from tx to rx. Data is transmitted, but it does not seem to be correct at all.

If I type "1" into the serial monitor of 1 arduino, 4 separate lines come into the serial monitor of the other arduino, the first 2 lines change and the last 2 lines are pretty much always 13 and 10. It does not matter what I type into the first serial monitor, the other's serial monitor always pops up with 4 lines of data, 2 different numbers and then 13 and 10.

Is this normal? It doesn't seem like it is. Anyone know what is going wrong?

Thanks

Type of Arduino? Code fractions? Comm Speed? These things are nice to have to troubulshoot Mega can for exemplel communicate at different speeds to computer and "slaves". Are there calculations between sending and receving or just plain relay? Hehe, the 13 and 10, linefeed and return?

D.

The 13 and 10 are the carriage return and line feed characters added by the Serial Monitor window.

Don't know about your other problems without seeing some code and output samples.

Both boards are Duemilanove with the ATMega328. Both set up for 9600 baud and its just a simple relay(i think thats the term) just printing on 1 serial monitor and Serial.available and Serial.read on the 2nd arduino. Unfortunately I do not have the code or monitor results at my disposal right now.

directly from tx to rx

But these lines are being used by the USB / Serial bridge at the same time so what you receive from one arduino is interfering with the communications to it from the PC.

Must say I agree, use SoftwareSerial: http://www.arduino.cc/en/Tutorial/SoftwareSerial

to avoid conflicts between arduinos.

D.

I loaded the software serial code up on 2 arduinos and connected them, pin 6 to pin 7 and pin 7 to pin 6, but nothing is transmitted between them on the serial monitors. I'm not sure what I'm doing wrong.

are you relaying the messages to the ordinary serial to bee seen on the computers, pc1>ardu1>ardu2>pc2 serial monitor only sees the usual rx tx I think Test it by having arduinos blink led or something when they get software serial message like: ard1 turns on led for 500ms and sends message to ard2 if ard2 sees message then it turns on led for 500ms and sends message to ard1 or computer...

D.

ps. code is helpful.

Make sure you connect the grounds.

But other than that... we won't be able to tell what the problems are without some code like stated above. :)

oh. forgot.. have you gotten through any examples with softserial I forgot to check on the playground if it was the SoftwareSerial9 that was there, for if you get it to work that it supports more speed. http://arduiniana.org/2009/05/direct-port-io-in-newsoftserial-9/ sorry about this, there are probably better examples on that site http://arduiniana.org/libraries/newsoftserial/

I use ArduinoMega so I don't have this problem of lacking serial ports (have 4 serial ports now). but that doesn't mean that I won't communicate back and forth with another smaller arduino cluster later ;)

sorry again, but I must rest now, 4 hr till I must wake up again and things are getting blurry. D.

Hi this guy posted some usage of NewSoftSerial: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1260038244 Granted, he only uses it for communicate between a chip and arduino, but the dynamics and code is the same.

just add: Serial.print(b);

after his mySerial.print(b);

this would copy the other arduinos output on to your serial monitor.

The other arduino should ideally have another picture ;) but otherwise about the same setup (tx and rx pins reversed too) so whenever you press reset-button on either arduino, the init-picture is sent to the other arduino and relayed to the other arduino's serial-monitor

Good luck :P D.

If you are sending characters and getting decimal numbers, then you might be using the wrong encoding format. Perhaps the sender is shipping out ASCII numbers instead of character codes. How else would 10 (linefeed) and 13 (carriage return) appear?