SOLVED: Advice needed for HTTP GET method and WiFly Bee

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

In case this helps identify my mistake, from tera term:

get everything
WiFly Ver 2.31, 01-01-2012 on RN-171
Beacon=100
Probe=5
Reboot=0
OPEN=*OPEN*
CLOSE=*CLOS*
REMOTE=*HELLO*
FlushSize=64
MatchChar=255
FlushTimer=10
IdleTimer=0
CmdChar=$
IF=UP
DHCP=ON
IP=192.168.34.6:2000
NM=255.255.255.0
GW=192.168.34.1
HOST=0.0.0.0:2000
PROTO=TCP,
MTU=1524
FLAGS=0x7
TCPMODE=0x0
BACKUP=0.0.0.0
DNS=192.168.34.1
Name=server1
Backup=backup2
FTP=208.109.78.34:21
File=wifly-EZX.img
User=roving
Pass=Pass123
Dir=public
Timeout=80
FTP_mode=0x0
SSID=Jarvis
Chan=0
ExtAnt=0
Join=1
Auth=WPA2
Mask=0x1fff
Rate=12, 24 Mb
Linkmon=5
Passphrase=******
TxPower=0
SleepTmr=0
WakeTmr=0
Trigger=0x1
Autoconn=0
IoFunc=0x0
IoMask=0x21f0
IoValu=0x0
DebugReg=0x0
PrintLvl=0x0
TimeEna=0
TIMEADR=129.6.15.28:123
Zone=7
Baudrate=9600
Flow=0x0
Mode=0x0
Cmd_GPIO=0
JoinTmr=1000
Replace=0x24
DeviceId=WiFly-EZX
Password=
Format=0x0
Signal=0
Average=5
BCAST=255.255.255.255:55555
Interval=0x7
Sensor=0x0
SensePwr=0x0
<2.31>

A small step forward …

REMOTE=*HELLO*

That was causing the WiFly to insert a HELLO before the GET or POST which resulted in the 405 error. To fix,

set comm remote 0

I’m hoping calling this mystery “solved” and from here out I’d like to think all remaining issues are likely of my own doing :smiley: