Problem of communication with 2 Xbees, Uno and Mega

Hello,

We are trying to make communicate to Xbees Pro (Series 1): one is plugged to the UNO microcontroller, the other to the Mega 2560 microcontroller. At first we tried to plug one Xbee to a micro, and the other to the pc via an interfacing USB shield and it worked correctly, in both ways (emit from the pc towards the UNO or Mega, and vice versa).
But when we replaced the USB shield by the second microcontroller, nothing worked anymore. Do you have any idea what the reason could be? The programming commands we were using are: Serial.write() and Serial.read()
We used a baud rate of 115200.
Let me know if you need more information.
Thanks.

Let me know if you need more information.

How are the XBees configured?
What code is running on each Arduino?
What happens, in terms of what lights on the Arduino and one the attached XBee shield, flash when one Arduino sends data? What lights flash on the other XBee shield and Arduino when the first one sends data?
Which shields are you using?

On the Arduino UNO, the code is:

int essai;


void setup()
{
  Serial.begin(9600);
}


void loop(){
  essai = 48;
  Serial.write(essai);
  
  delay(2000);
  
}

On the Mega, the code is:

int message;
int led=13;

void setup(){
  Serial.begin(9600);
  pinMode(led,OUTPUT);
  digitalWrite(led,LOW); 
}

void loop(){
  if (Serial.available()>0){
    message=Serial.read();
    digitalWrite(led, HIGH);
    delay(500);
    digitalWrite(led,LOW);
  }
}

The Xbees configuration is standard, we just ran X-CTU but we didn't change any parameter.
When we try to make everything work, with both arduinos connected to 9V batteries, the RSSI led switches on the shield connected to the Mega.
Then if we try to plug the arduinos to 2 computers and to open the Serial monitor, then the leds TX start to blink on both arduinos.
On the serial monitor connected to the UNO, we can see some "0" printed and on the serial monitor connected to the Mega we can see some "1" printed.

Regarding the shield we use, you can see them on those links:

shield connected to the UNO:
http://www.lextronic.fr/P19084-platine-xbee-shield-pour-arduino.html

shield connected to the Mega:
http://www.lextronic.fr/P6560-platine-de-prototypage-pour-module-xbee.html

shield to connect the Xbee to the pc:
http://www.lextronic.fr/P4117-platine-dinterface-usb-pour-modules-xbee.html

The Xbees configuration is standard, we just ran X-CTU but we didn't change any parameter.

You need to. You need to set PAN ID, MY and DL. PAN ID can be any non-zero value, and must be the same on both XBees.

MY and DL can be any non-zero values. MY on one XBee needs to be the same as DL on the other.

If you set PAN ID, MY and DL on one XBee to 3333, 1001, and 1002, on the other one they must be 3333, 1002, and 1001.

I have tried to do it but it doesn't change anything. Do you have another idea?

On the serial monitor connected to the UNO, we can see some "0" printed and on the serial monitor connected to the Mega we can see some "1" printed.

You are sending the binary value 48 to the serial port, from the UNO, which should cause the character 0 to be printed on the serial monitor, and broadcast by the XBee on the UNO.

On the Mega, you are reading the data arriving on the serial port from the PC or from the onboard XBee. There is nothing in the code on the Mega that sends anything.

It is not clear how the XBee is connected to the Mega. The board that you linked to for the Mega is not a shield. How is that board connected to the Mega?

The pin Vin of the board is connected to the pin 5V of the Mega.
The pin Gnd of the board is connected to the pin Gnd of the Mega.
The pin Tx of the board is connected to the pin Tx of the Mega.
The pin Rx of the board is connected to the pin Rx of the Mega.
(actually I also have tried to connect Tx of the board with Rx of the Mega and Rx of the board with Tx of the Mega)

Do you think it could solve my problem to buy this shield?
http://docs-europe.electrocomponents.com/webdocs/0db9/0900766b80db99cc.pdf

Do you think it could solve my problem to buy this shield?

No.

If the PC and the UNO can talk to each other, move that shield to the Mega, and see of the PC and Mega can talk. If so, buy another one of those shields.