Hi
I have a WiFly Bee which appears to be doing everything I ask, but I’m having difficulty constructing HTTP GET or HTTP POSTs to pachube etc. I’m hoping someone can see the obvious error in my ways. I constructed a test sketch as follows:
#include <SoftwareSerial.h>
SoftwareSerial WiFly(2, 3);
void setup() {
Serial.begin(9600);
WiFly.begin(9600);
Serial.println("\r\n>> Entering command mode"); // game on
delay(300); // 250ms delay either side of command mode signal
WiFly.print("$$");
delay(300); // 250ms delay in going into command mode in the WiFly
while (WiFly.available()) Serial.write(WiFly.read()); // just to see what status if any comes back
// Open http connection
WiFly.print("open pvoutput.org 80\r\n");
delay(1000);
while (WiFly.available()) Serial.write(WiFly.read());
WiFly.print("GET <snip> HTTP/1.0\r\n");
delay(300);
}
void loop() { // spit out result of http GET, forever
while (WiFly.available()) Serial.write(WiFly.read());
}
In the part is a URL that when I paste it into a browser results in a OK 200: Added Status from PVoutput.org, ie a correctly formatted and testable URL that inserts a data point.
However when I run this sketch at the point where it hits the GET the status LED on the bee holds solid green for a few seconds, then eventually I get the CLOS confirmation the session has been dropped.
>> Entering command mode
CMD
ÁÿeþÙÿoutput.;ÿ 80
SþConnect to 106.187.39.38:80
<2.31>
*OPEN**CLOS*
I have another test sketch that does a POST method, which I’ve been comparing notes with a mate who has a wired shield network card and we can’t see how mine differs from his, however that results in a 405, Method Not Allowed. Clearly there’s an obvious step I’m missing ?
Thanks so much in advance, Geoff