Also, you may want (need) to change this little bit (which doesn’t tell us much at all)
client.flush();
if(DEBUG){
Serial.print("sent! - RSSI:");
Serial.println(Network.RSSI());
Serial.println("");
}
To this, which will print the response from pushingbox, which will be very helpful in faultfinding.
if (DEBUG) {
while (!client.available()) SPARK_WLAN_Loop();
while (client.available()) {
char c = client.read();
Serial.print(c);
}
Serial.println();
}
delay(150);
while(client.available()) client.read();
let me explain this a bit, the client.flush() just throws away the response from PushingBox
with DEBUG turned on (boolean DEBUG = true; at the top of the code) it will enter the if loop, then say sent etc. even if the pushingbox server didn’t have a clue what the spark said…
the updated code doesn’t throw away the response straight away, it checks DEBUG first, if its true then it wait’s for a response, once it starts getting the response it will print it on the serial terminal. then it prints a blank line to keep the output neat, then waits a bit longer and does a “client.flush()” but in a different way (that may help fix a bug)
here is an example of a good response:
HTTP/1.1 200 OK
Set-Cookie: 60gpBAK=R1225225159; path=/; expires=Fri, 27-Jun-2014 18:20:25 GMT
Date: Fri, 27 Jun 2014 17:21:58 GMT
Content-Type: text/html
Content-Length: 0
Connection: close
Set-Cookie: 60gp=R475267376; path=/; expires=Fri, 27-Jun-2014 18:37:01 GMT
Server: Apache
Content-Location: pushingbox.php
Vary: negotiate,Accept-Encoding
TCN: choice
X-Powered-By: PHP/5.2.17
When I get bored i may update the example code and see if pushingbox want to update the Git