Hello all,
WiFly Shield WRL-09954
I’m trying to send data to my website and everything work great except the data goes to the website only on the first time of the loop. this is the code
#include "WiFly.h"
#include "Credentials.h"
byte server[] = { 66, 249, 89, 104 }; //
Client client("google.com", 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...");
}
void loop() {
if (client.connect()) {
Serial.println("connected");
client.println("GET http://xxxxxxxxx?id=1&content=test");
client.println();
} else {
Serial.println("connection failed");
}
if (client.available()) {
char c = client.read();
Serial.print(c);
}
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
for(;;)
;
}
delay(5000);
}
I delay the loop for 5 sec the first time its looping the data polling into my website but thats all the rest doesnt go through, so please I need help how to solve it.