 	}
 }
 
-int loops = 0;
+int loops = 1;
+int failCount = 0;
 
 void loop(){
-	dbgSerial.println("[Using External Code]");
+	dbgSerial.print("[Using External Code] [loop count: ");
+	dbgSerial.print(loops);
+	dbgSerial.print("] [failCount: "); 
+	dbgSerial.print(failCount);
+	dbgSerial.println("]");
 //	reset();  //only CERTAIN way I've found of keeping it going
 //  delay(5000);  //esp takes a while to restart
  // Serial.print("loops = ");  //check for successful connections to server

  //Parse the returned header & web page. Looking for 'Date' line in header

  
//  if (Serial.find("Hello")) //get the date line from the http header (for example)
//  {
//    for (int i=0;i<31;i++)  //this should capture the 'Date: ' line from the header
//    {
      if (Serial.available())  //new cahracters received?
      {
        char c=Serial.read();  //print to console
        dbgSerial.write(c);
      }
//      else i--;  //if not, keep going round loop until we've got all the characters
//    }
//  }

  Serial.print("AT+CIPCLOSE");  
  Serial.print("\015\012");


#define SSID    "NickNet"
#define PASS    "27304600"
#define DST_IP  "146.227.57.195" //Test server

#define LED 13

