[Solved] Wifly - Networking problems.

johnwasser:
In one case you use:

set wlan phrase mypassword

and in the other you use:

set wlan mypassword

Could that be the problem?

Sorry that was a typo in the message, I have now edited the initial post. I have now managed to get connected to a network by changing the join option to option 1. I have also managed to mash together code to set the WiFly up in code without using the Spiuart terminal with manual inputs.

How ever I now have another problem, I can't seem to get the WiFly example for a web client to work. The code i am using is:

#include "WiFly.h"

Client client("google.com", 80);

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

  Serial.println("connecting...");

  if (client.connect()) {
    Serial.println("connected");
    client.println("GET /search?q=arduino HTTP/1.0");
    client.println();
  } else {
    Serial.println("connection failed");
  }
   Serial.println("End of setup.");
  
}

void loop() {
  Serial.println("Start of void loop");
  if (client.available()) {
    char c = client.read();
    Serial.print(coffee);
  }
  
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
    for(;;)
      ;
  }
  Serial.println("End of void loop");
}

Using the serial prints I can tell that it hangs at the if (client.connect() statement. Hopefully I have provided enough information for someone to be able to shed some light on the problem. I have tried several suggestions on other web client examples and still doesn't work.

EDIT: Solved, was missing just one line that fixed it all.
WiFlyClient client;