Hi everybody,
I write this because i do not have any idea about how to solve it!...
This is the situation, i'm trying to program a Wifi whield on arduino mega 2560, the WfifiBee by Tinyshine with a Xbee Shield by SainSmart on an Arduino Mega 2560. Using the library of WifliHQ...
When i try to do it i get an error, it seams that the arduino and xbee shield uses the same pin serial ports to comunicate, so i try to change the xbee shield serial port with the software: SoftwareSerial.h... But i cant find the solution!
The Xbee Shield its working because i have programed from the console, so i can send a PING from a computer to the arduino and it responds , but i would be able to setup, control and use the configuration of the wifi shield from arduino...
Using any example from the library WIFLYHQ i get the same error: Result doing it with the HttpClient example:
Starting
Free memory: 6708
setPrompt failed
Failed to enter command mode
Failed to start wifly
The example code:
/*
* WiFlyHQ Example httpclient.ino
*
* This sketch implements a simple Web client that connects to a
* web server, sends a GET, and then sends the result to the
* Serial monitor.
*
* This sketch is released to the public domain.
*
*/
#include <WiFlyHQ.h>
#include <SoftwareSerial.h>
SoftwareSerial wifiSerial(8,9);
//#include <AltSoftSerial.h>
//AltSoftSerial wifiSerial(8,9);
WiFly wifly;
/* Change these to match your WiFi network */
const char mySSID[] = "myssid";
const char myPassword[] = "my-wpa-password";
//const char site[] = "arduino.cc";
//const char site[] = "www.google.co.nz";
const char site[] = "hunt.net.nz";
void terminal();
void setup()
{
  char buf[32];
  Serial.begin(115200);
  Serial.println("Starting");
  Serial.print("Free memory: ");
  Serial.println(wifly.getFreeMemory(),DEC);
  wifiSerial.begin(9600);
  if (!wifly.begin(&wifiSerial, &Serial)) {
    Serial.println("Failed to start wifly");
terminal();
  }
  /* Join wifi network if not already associated */
  if (!wifly.isAssociated()) {
/* Setup the WiFly to connect to a wifi network */
Serial.println("Joining network");
wifly.setSSID(mySSID);
wifly.setPassphrase(myPassword);
wifly.enableDHCP();
if (wifly.join()) {
  Serial.println("Joined wifi network");
} else {
  Serial.println("Failed to join wifi network");
  terminal();
}
  } else {
    Serial.println("Already joined network");
  }
  //terminal();
  Serial.print("MAC: ");
  Serial.println(wifly.getMAC(buf, sizeof(buf)));
  Serial.print("IP: ");
  Serial.println(wifly.getIP(buf, sizeof(buf)));
  Serial.print("Netmask: ");
  Serial.println(wifly.getNetmask(buf, sizeof(buf)));
  Serial.print("Gateway: ");
  Serial.println(wifly.getGateway(buf, sizeof(buf)));
  wifly.setDeviceID("Wifly-WebClient");
  Serial.print("DeviceID: ");
  Serial.println(wifly.getDeviceID(buf, sizeof(buf)));
  if (wifly.isConnected()) {
    Serial.println("Old connection active. Closing");
wifly.close();
  }
  if (wifly.open(site, 80)) {
    Serial.print("Connected to ");
Serial.println(site);
/* Send the request */
wifly.println("GET / HTTP/1.0");
wifly.println();
  } else {
    Serial.println("Failed to connect");
  }
}
void loop()
{
  if (wifly.available() > 0) {
char ch = wifly.read();
Serial.write(ch);
if (ch == '\n') {
  /* add a carriage return */
  Serial.write('\r');
}
  }
  if (Serial.available() > 0) {
wifly.write(Serial.read());
  }
}
/* Connect the WiFly serial to the serial monitor. */
void terminal()
{
  while (1) {
if (wifly.available() > 0) {
  Serial.write(wifly.read());
}
if (Serial.available() > 0) {
  wifly.write(Serial.read());
}
  }
}
Anybody can give some light on this darkness!!!
P.D.: Sorry about my english!