[PROBLEM] WiFIBee works with Arduino Uno but not with Mega

Hello Together,
I have a xBee Shield with a WiFIBee. On my Arduino Uno it works very well without any problem. If I try it on my Arduino Mega with exactly the same Sketch I have the following errors on my console:

Starting
Free memory: 6710
setPrompt failed
Failed to enter command mode
Failed to start wifly

The Shield is a TinySine Bee Shield V1r1 configured to normal mode with Soft Serial on MCU (small switches on the board).
The WiFiBee is a RN171 from Roving.

I use the default Sketch from WiFlyHQ. I have just changed SoftwareSerial wifiSerial(8,9); to SoftwareSerial wifiSerial(2,3);.

Here is the whole Sketch:

/*
 * 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(2,3);

//#include <AltSoftSerial.h>
//AltSoftSerial wifiSerial(8,9);

WiFly wifly;

/* Change these to match your WiFi network */
const char mySSID[] = "--";
const char myPassword[] = "--";

//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(9600);
    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");
    }
    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());
	}
    }
}

Where is my fault? Do I have to change something to use it on my Arduino Mega?
I hope I will find someone who can help me, thank you.

Regards, Ralph

No one an idea where the fault could be? Any person experienced with Arduino Mega and WiFi Shield / xBees?

I know the Mega and WiFi shield, but those use SPI. Yours uses serial. The limitation is a hardware deal. This is from the SoftwareSerial library page.
http://arduino.cc/en/Reference/SoftwareSerial

Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).

You might want to consider using hardware serial. That requires pin bending and a couple of jumper wires.

Hi,
thank you very much for your answer. I have to possibility to change from SoftSerial to UART. But I took SoftSerial, because I don't know how to use it in the UART mode.
Would UART be better choice an the mega?
If yes, how can I use it, can you give me an example?

Is this a shield or a breakout board? A link to the wifi hardware might help.

Of course, I have this one:
http://www.ebay.com/itm/221338452000?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

And the Mega is an original Arduino...

No one an idea howIi can fix it? :cold_sweat:

Your tinysine wifi shield works on the UNO. Where did you get the sketch? Im having trouble figuring out which library I need.

how make you work it in arduino uno? you managed to connect the Arduino to a web server or something? I have the same shield and I get the same problem that you have when trying to connect to the Arduino Mega.