GPRS webserver upload problem

I am having a problem uploading data to my web server using GPRS. I have a php script which updates a database. When I call the script from a browser address line the script runs perfectly. When I call it using tcp GET the code runs through ok with all valid replies from GPRS but the web server doesn't acknowledge seeing the transmission, either in the visitors log or the error log. Here is a portion of the debug log:

test gprs uplink to vitalstates server Version:- 1.00
Deactivated
APN set!
Initialised!
Address obtained
Echo Disabled
AT+CIPSTART="TCP","www.vitalstates.org","80"
connected
AT+CIPSEND
GET /wstest/wstestupload.php?one=7771&two=7772&three=7773 HTTP/1.1

AT+CIPCLOSE
logged
AT+CIPSTART="TCP","www.vitalstates.org","80"
connected
AT+CIPSEND
GET /wstest/wstestupload.php?one=7771&two=7772&three=7773 HTTP/1.1

AT+CIPCLOSE
logged
AT+CIPSTART="TCP","www.vitalstates.org","80"
connected
AT+CIPSEND
GET /wstest/wstestupload.php?one=7771&two=7772&three=7773 HTTP/1.1

AT+CIPCLOSE
logged

If anybody has any thoughts I would be extremely grateful

Ed

/*
 * ***************************************************************************************
 *        test the gprs uplink with the test weather station
 *        
 * ***************************************************************************************
 */
#include <SoftwareSerial.h>
#include <avr/wdt.h>

#define DEBUG 1 
// #define UPLOAD 
#define LOG 

#define VER 2.0

#define GPRS_PIN 9
#define LED_PIN 13

#define APN "everywhere\",\"eesecure\",\"secure"                // APN for current EE sim card
#define vslserver "www.vitalstates.org"
#define vslwebpage "GET /wstest/wstestupload.php?"

/*
*********************************************************************
*  globals
*********************************************************************                                                          *
*/

SoftwareSerial GPRS(7, 8);  // TX on 7, RX on 8

/*
***********************************
* Function prototypes
***********************************
*/
;

void setup(void);
void loop(void);
void ShowSerialData ();
void upload_packet();



//  
//  ************************************************************************************
//
void setup() 
{
  if (DEBUG)
    {
       Serial.begin(19200);
       Serial.print("test gprs uplink to vitalstates server Version:- ");
       Serial.println(VER);
    }
    
  pinMode(LED_PIN, OUTPUT);                                   // Digital output pin to LED 1
  pinMode(GPRS_PIN, OUTPUT);                                  // GPRS initialise pin
  

 
 
  init_gprs();

  delay(500);
 
}
//
//  **********************************************************************************
//
void loop()
{
  
    upload_packet();
    delay(5000);
}
//
//  *********************************************************************************
//
 
void init_gprs()
{
  digitalWrite(GPRS_PIN, LOW);
  delay(1000);
  digitalWrite(GPRS_PIN, HIGH);
  delay(2000);
  digitalWrite(GPRS_PIN, LOW);
  delay(3000);

  GPRS.begin(19200); 
  
    wdt_enable(WDTO_8S);                                              // Set watchdog timer at 8 seconds
    while (!GPRS.find("OK"))                                          // deactivate GPRS PDP context
    {
      GPRS.println("AT+CIPSHUT");
      delay(3000);
    }
    wdt_disable();                                                    // Disable watchdog timer

    {if(DEBUG) Serial.println("Deactivated"); }
    
// *****************

    wdt_enable(WDTO_8S);                                              // Set watchdog timer at 8 seconds
    while (!GPRS.find("OK"))                                          // Set the APN
    {
      GPRS.print("AT+CSTT=\"");
      GPRS.print(APN);
      GPRS.println("\"");
      delay(3000);
    }
    wdt_disable();            // Disable watchdog timer

    {if(DEBUG) Serial.println("APN set!"); }


// *****************

    wdt_enable(WDTO_8S);                                              // Set watchdog timer at 8 seconds
    while (!GPRS.find("OK"))                                          // Bring up the wireless connection
    {
      GPRS.println("AT+CIICR");
      delay(2000);
    }
    wdt_disable();                                                     // Disable watchdog timer

    {if(DEBUG) Serial.println("Initialised!"); }


// *****************

    wdt_enable(WDTO_8S);                                              // Set watchdog timer at 8 seconds
    while (!GPRS.find("OK"))                                          // Get local IP address
      {
      GPRS.println("AT+CIFSR");
      delay(2000);

      GPRS.println("AT+CIFSR=?");
      delay(2000);
     }
    wdt_disable();                                                     // Disable watchdog timer
    

    {if(DEBUG) Serial.println("Address obtained"); }
    


// *****************

    wdt_enable(WDTO_8S);                                               // Set watchdog timer at 8 seconds
    while (!GPRS.find("OK"))                                           // Disable echo prompt
    {
      GPRS.println("AT+CIPSPRT=0");
      delay(2000);
    }
    wdt_disable();                                                     // Disable watchdog timer

    {if(DEBUG) Serial.println("Echo Disabled"); }


}

//
//  **********************************************************************************
//

void ShowSerialData ()
{
  while(GPRS.available())
  {
    char c = GPRS.read();
//    {if(DEBUG)Serial.print(c); }
  }
}

//
//  **********************************************************************************
//
void upload_packet()
{
    wdt_enable(WDTO_8S);      // Set watchdog timer at 8 seconds

    GPRS.print("AT+CIPSTART=\"TCP\",\"");
    Serial.print("AT+CIPSTART=\"TCP\",\"");
    delay(500);
    GPRS.print(vslserver);
    Serial.print(vslserver);
    delay(500);
    GPRS.println("\",\"80\"");
    Serial.println("\",\"80\"");
    while (!GPRS.find("CONNECT OK"))
    {
      delay(500);
    }

    wdt_disable();          // Disable watchdog timer
    
if (DEBUG){Serial.println("connected");}

// Send data to vitalstates log

    Serial.println("AT+CIPSEND");     // Start data send
    GPRS.println("AT+CIPSEND");     // Start data send
    delay(2000);
    ShowSerialData();
    
    Serial.print(vslwebpage);
    GPRS.print(vslwebpage);
    delay(100);
    ShowSerialData();

    GPRS.print("one=");
    Serial.print("one=");
    delay(100);
    ShowSerialData();

    GPRS.print("7771");
    Serial.print("7771");
    delay(100);
    ShowSerialData();
    
    GPRS.print("&two=");
    Serial.print("&two=");
    delay(100);
    ShowSerialData();
   
    GPRS.print("7772");
    Serial.print("7772");
    delay(100);
    ShowSerialData();

      GPRS.print("&three=");
      Serial.print("&three=");
      delay(100);
      ShowSerialData();

      GPRS.print("7773");
      Serial.print("7773");
      delay(100);
      ShowSerialData();

      
      GPRS.println(" HTTP/1.1\r\n");
      Serial.println(" HTTP/1.1\r\n");
      delay(100);
      ShowSerialData();

    GPRS.println((char)26);
    delay(2000);

    wdt_enable(WDTO_8S);      // Set watchdog timer at 8 seconds

    while (!GPRS.find("SEND OK"))
    {
      delay(500);
    }

    wdt_disable();          // Disable watchdog timer
/*
  while(GPRS.available())                                             // empty GPRS reply buffer
  {
    Serial.print(GPRS.read());
  }
*/
   wdt_enable(WDTO_8S);      // Set watchdog timer at 8 seconds

    GPRS.println("AT+CIPCLOSE");
    Serial.println("AT+CIPCLOSE");
    while (!GPRS.find("CLOSE OK"))
    {
      delay(500);
    }

    wdt_disable();          // Disable watchdog timer

if (DEBUG){Serial.println("logged");}
 
}

Try with HTTP/1.0 or actually send a complete HTTP 1.1 header (which you currently don't).

Hi Pylon

I've tried it with 1.0 and 1.1, with and without the cr/lf and still no mention in the visitors/error log on the web server....it's as if my message just doesn't exist.

I'm not sure what you mean by a full HTTP/1.1 full header though.....I've done some reading on HTTP but most of it leaves me no wiser...I did pick up on the relevance of the cr/lf which some servers reject.

but thanks for looking anyway.

Without the "Host" header it works only if you have only one webserver listening on that IP. If you have virtual hosts (so if you're using a provider) the "Host" header is mandatory.

after you pointed me in the direction of the header yesterday I made a few experiments and changed the http\1.1 header to include the host and connection paras....I understand from the docs that the host is compulsory for shared host servers.....

it still didn't work......

I then tried the same coding approach to a friends server which is dedicated...that didn't work either...

I've elaborated on printing out the full responses to the AT+ commands and I'm just not getting through to the servers concerned.....i.e I'm not getting back the responses shown in all the documents I've read so far. I always get back 'SEND OK' from the CIPSEND command but none of the following header info which the documentation suggests I should get.

I'm continuing to chase this but if you have any further suggestions please let me know.

thanks for the help so far....

Solved!

not sure whether this is legit but................

the GET request required the full URL, almost as if the server wasn't receiving the host parameter....

also the Http1.1 needed terminating with cr/lf/cr/lf without a space or blank line between the 2 cr/lf...

as soon as I had the concatenated cr/lf the remote server responded...

the full URL is needed after the GET for proxy servers according to the documentation I found, but I was sending to a non proxy server and it still needed the full URL after the get.

go figure!

thanks for looking