Problem connecting to wifi

Hello,

I have a problem connecting to my home Wi-Fi using the WiFly Shield.

I have download the following library:

https://github.com/sparkfun/SparkFun_WiFly_Shield_Arduino_Library

I can connect to the Wi-Fi using the command mode through the Arduino Serial Monitor, but when I try to connect to the Wi-Fi using a sketch I can´t.

I need to make a GET request to a web page so I tried the following code (from the library) to do the test. I open the serial monitor to see how is it going and it always stops at “Association Failed”.

Please help! Thank you!

// (Based on Ethernet's WebClient Example)

#include <SPI.h>
#include <WiFly.h>



byte server[] = { 66, 249, 89, 104 }; // Google

//Client client(server, 80);

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

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

  WiFly.begin();
  
  if (!WiFly.join("ssid", "pass")) {
    Serial.println("Association failed.");
    while (1) {
      // Hang on failure.
    }
  }  

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

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

Also posted (equally badly) in the Spanish section

AWOL:
Also posted (equally badly) in the Spanish section

Sorry, what was bad? I correct the code mode.
I didn't know there was a Spanish section, but when I noticed I put it there too because my English is bad.
Anyone can help?

Nobody? :frowning: