-#include <SoftwareSerial.h>
 #include <SIM900.h>
+
+#define debug Serial1
 
 SIM900GPRS gsm;
 SIM900Client client(&gsm);

char imeiStr[16];
long _startTime;

size_t freeRam ()
  {
  return RAMEND - size_t (__malloc_heap_start);
  } // end of freeRam
  
void setup(){
  Serial.begin(9600);
  Serial.println(F("Test of GSMGPRS_Shield"));
  Serial.print(F("GSM lib "));
  Serial.println(GSM_LIB_VERSION);
  Serial.print(F("SIM900 lib "));
  Serial.println(SIM900_GPRS_VERSION);
  Serial.print(F("Free memory = "));
  Serial.println(freeRam());
  
  // try to turn on the GSM Shield, stop if we fail  
  if(!gsm.turnOn()) {
    goto STOP;
  }
  Serial.println(F("Module on"));
  
  // initialize GSM
  while(gsm.begin() != GSM_READY) {
    Serial.println("gsm setup problem");
    goto STOP;
  }
  Serial.println(F("GSM ready"));

  Serial.print(F("Signal strength: "));
  Serial.println(gsm.getSignalStrength());

  gsm.getIMEI(imeiStr, 16);
  Serial.print(F("IMEI: "));
  Serial.println(imeiStr);
  
  // wait until GPRS is available
  while(!gsm.isGPRSAvailable()) {
    delay(500);
  }
  Serial.println(F("GPRS is available, attach!"));
  
  while(GPRS_READY != gsm.attachGPRS("online.telia.se", NULL, NULL)) {
      Serial.println("gprs join network error");
      goto STOP;
  }
  Serial.println(F("GPRS ready"));
  
  gsm.getIP(ipStr, 17);
  Serial.print(F("IP Address is "));
  Serial.println(ipStr);
  
  if(false == client.connect("www.yelloworb.com", 3000)) {
      Serial.println(F("connect error"));
      goto STOP;
  }
  Serial.println(F("connect success"));
  

  Serial.println(F("waiting to fetch..."));
  client.beginWrite();
  client.print(http_cmd);
  client.endWrite();

    }     
  }
  buffer[ret] = '\0';
  debug.print(F("Recv: "));
  debug.print(ret);
  debug.println(F(" bytes: "));
  debug.println(buffer);
  debug.println(F("fetch over..."));
  
  STOP:
  client.stop();
  gsm.detachGPRS(); 
  gsm.shutdown();
  debug.print(F("Free memory = "));
  debug.println(freeRam());
  debug.println(F("All Done!"));
}

void loop(){
