[SOLVED]Busted/Incompatible XBEE WIFI and Arduino UNO & Leonardo Wireless Shield

I've solved the problem XD XD XD XD XD XD.

The main problem were the shields they are not 100% compatible with the XBEE WIFI module but there is a workarround so they can be fully compatible
The workarround varies between the arduino UNO and the Leonardo.

If you want to know why the shield doesn't work read this
One of the problems is the current peak that is produced when the XBEE WIFI module powers up. It is 750mA just for a tiny fraction of a second but this is enought to drain the shield's built-in capacitors. So you need a bigger capacitor, i choose 500uF but I think a smaller capacitor would do nice.

The second problem is how the serial-USB conversion works.
The Leonardo's serial-USB converter is built-into the microcontroller while the UNO has a separate chip to do the serial-USB conversion.
The leonardo has another serial port called Serial1 which correponds with the digitals pin 0(RX) and 1(TX), this pins are where the XBEE module will send serial data.
The Shield's switch(USB-MICRO) only bypass the Shield's serial signal into the serial-USB converter(switch in the USB position) or intro the arduino(switch in the MICRO position).
This way the shield relies on a separate serial-USB chip but the Leonardo doesn't have one.
To get the shield working, the leonardo needs to act as a proxy between the XBEE serial port(Serial1) and the arduino microcontroler's serial port(Serial).

If you only want the solution read below

For the UNO:

  • Solder a 500uF between the Shield's XBEE VCC(3.3)[Pin 1] and GND[Pin 10] pins
  • Put the shield's switch in the USB position
  • use the X-CTU(digi app) to configure the XBEE

For the Leonardo the thing is a bit more complex.

  • Solder a 500uF between the Shield's XBEE VCC(3.3) and GND pins
  • Upload into the arduino this little sketch
#Redirects input from serial ports: Serial <-> Serial1
#
#define BAUD_RATE 9600
void setup() {
  Serial.begin(BAUD_RATE);
  Serial1.begin(BAUD_RATE);
  while(!Serial){ //required for the Leonardo
  ;
  }
}

void loop() {
  while(Serial.available()>0){ 
    Serial1.write(Serial.read());// input from Serial to Serial1
  }
  while(Serial1.available()>0){
    Serial.write(Serial1.read()); //input from Serial1 to Serial
  }
}
  • Put the shield's switch in the MICRO, yes you read it right MICRO, position
  • use the X-CTU(digi app) to configure the XBEE and let the magic happen :smiley:

Note: If you want to change the baud rate frist change the XBEE baud rate, then change the sketch baud rate and finaly change it in the X-CTU.