hi
i have been trying to get my wifly shield to to access a web page for example google serach and so far whatever i try my code isnt working i have been stuck on this for ages and really frustrating. my shield does connect to my router but when it comes to accessing a webpage and send a url package through it doesn't work
#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(;;)
;
}
}
if anyone can help that would be great
thank you