Arduino Mega 2560 + Xbee Shield + WifiBee + WiflyHQ = ERROR!

I think a write the post in the wrong department...

Please read the topic: Arduino Mega 2560 + Xbee Shield + WifiBee + WiflyHQ = ERROR! - Programming Questions - Arduino Forum

There is no way to connect it!!! :fearful:

and i dont know what to do any more. :frowning:

thanx a lot for your help.

Hey,

Even though my issue was with the board I was using, here is the code you requested from my issue: http://forum.arduino.cc/index.php?topic=216964.0

// state of received data compared to expected 
boolean startState = false;
// stores incoming data
String response = String("");
// data compare 
String expected = String("START");

void setup() {
  // begin xbee com
  Serial1.begin(9600);
}

void loop() {
   
  // loops through checking received buffer for new data to compare to expected
  if(!startState){
   
     if(Serial1.available())
     {
       while(response.length() < expected.length()) {
         response += (char) Serial1.read();
       }
       // If we have a match, success
       if( response == expected) {
         startState = true;
       }
     }
     delay(100);
  }
  // If we have success, start sending data every second
  if(startState) {
    Serial1.print("running...");
    delay(1000); 
  }
   delay(100);
}

Notice that Serial1 uses pins 18 and 19 on the Mega 2560 (http://arduino.cc/en/reference/serial 3rd paragraph). I was not able to get SoftwareSerial working on any of the digital pins on the Mega 2560. I would just try and stick with the hardware serial to connect to your xbee.

On a side note, I spent a lot of time trying to debug code when all that was wrong is I needed to either update the xbee firmware or change some parameters. I would try this:

  1. Adapt my code to your setup
  2. Do a full update of the Wifibee’s firmware, even if you already have the newest one, upload it again
  3. Load the default configuration parameters
  4. If you have accessibility to a oscilloscope, probe your data lines to make sure you are getting the data you expect