Hi
i brought a WiFly Shield for a new porject im working on but the issue that iam getting is that every time i run my code it stops at client.connect, i feel as i have tried everything to fix it including turning my firewall off, but for the life of me i cant seem to understand why its keeps stopping there. i have used the spi to configure it to my router (set ssid, set password) and it connects perfectly but when it comes to the client part it just doesnt work. the code iam using is the example code that comes with the library i installed.
#include <SPI.h>
#include <WiFly.h>
#include "Credentials.h"
byte server[] = { 74, 125, 224, 50 }; // Google
//Client client(server, 80);
WiFlyClient client("google.co.uk", 80);
void setup() {
Serial.begin(9600);
WiFly.begin();
if (!WiFly.join(ssid, passphrase)) {
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(;;)
;
}
}
it outputs connecting and then suddenly stops and says connection failed which is the client.connect part
if anyone can help me that would be great i would really appreciate it
thank you so much