 int failCount = 0;
 
 void loop(){
-	Serial.print("[Using External Code] [loop count: ");
-	Serial.print(loops);
-	Serial.print("] [failCount: "); 
-	Serial.print(failCount);
-	Serial.println("]");
+	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
- // ESPComm.print("loops = ");  //check for successful connections to server
-  //ESPComm.println(loops); 
+ // Serial.print("loops = ");  //check for successful connections to server
+  //Serial.println(loops); 
   loops++;
   String cmd = "AT+CIPSTART=\"TCP\",\"";  //make this command: AT+CPISTART="TCP","146.227.57.195",80
   cmd += DST_IP;
   cmd += "\",80";
   cmd += "\015\012";
   
-  ESPComm.print(cmd);  //send command to device
+  Serial.print(cmd);  //send command to device
 
   delay(2000);  //wait a little while for 'Linked' response - this makes a difference
-  if(ESPComm.find("Linked"))  //message returned when connection established WEAK SPOT!! DOESN'T ALWAYS CONNECT
-  {
-   Serial.print("Connected to server at ");  //debug message
-   Serial.println(DST_IP);
+  if(Serial.find("Linked"))  //message returned when connection established WEAK SPOT!! DOESN'T ALWAYS CONNECT
+  {
+   dbgSerial.print("Connected to server at ");  //debug message
+   dbgSerial.println(DST_IP);
   }
   else
   {
-    Serial.println("'Linked' response not received");  //weak spot! Need to recover elegantly
+    dbgSerial.println("'Linked' response not received");  //weak spot! Need to recover elegantly
 	++failCount;
   }
 
+<<<<<<< HEAD
   cmd =  "GET / HTTP/1.1\r\n";  //construct http GET request
   cmd += "Host: nickmccomb.com\r\n\r\n";        //test file on my web
   ESPComm.print("AT+CIPSEND=");                //www.cse.dmu.ac.uk/~sexton/test.txt
   ESPComm.print(cmd.length());  //esp8266 needs to know message length of incoming message - .length provides this
   ESPComm.print("\015\012");
-  
-  if(ESPComm.find(">"))    //prompt offered by esp8266
-  {
-    Serial.println("found > prompt - issuing GET request");  //a debug message
-    ESPComm.print(cmd);  //this is our http GET request
-	ESPComm.print("\015\012");
+=======
+  cmd =  "GET /~sexton/test.txt HTTP/1.0\r\n";  //construct http GET request
+  cmd += "Host: cse.dmu.ac.uk\r\n\r\n";        //test file on my web
+  Serial.print("AT+CIPSEND=");                //www.cse.dmu.ac.uk/~sexton/test.txt
+  Serial.print(cmd.length());  //esp8266 needs to know message length of incoming message - .length provides this
+  Serial.print("\015\012");
+>>>>>>> parent of 40fe488... Added Current ESP Development Code
+  
+  if(Serial.find(">"))    //prompt offered by esp8266
+  {
+    dbgSerial.println("found > prompt - issuing GET request");  //a debug message
+    Serial.print(cmd);  //this is our http GET request
+	Serial.print("\015\012");
   }
   else
   {
-    ESPComm.print("AT+CIPCLOSE");  //doesn't seem to work here?
-	ESPComm.print("\015\012");
-    Serial.println("No '>' prompt received after AT+CPISEND");
+    Serial.print("AT+CIPCLOSE");  //doesn't seem to work here?
+	Serial.print("\015\012");
+    dbgSerial.println("No '>' prompt received after AT+CPISEND");
   }
 
   //Parse the returned header & web page. Looking for 'Date' line in header
 
   
-  if (ESPComm.find("Date: ")) //get the date line from the http header (for example)
+  if (Serial.find("Date: ")) //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 (ESPComm.available())  //new cahracters received?
+      if (Serial.available())  //new cahracters received?
       {
-        char c=ESPComm.read();  //print to console
-        Serial.write(c);
+        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
     }
   }
 
-  ESPComm.print("AT+CIPCLOSE");  
-  ESPComm.print("\015\012");
-
-  if(ESPComm.find("Unlink"))  //rarely seems to find Unlink? :(
-  {
-    Serial.println("Connection Closed Ok...");
+  Serial.print("AT+CIPCLOSE");  
+  Serial.print("\015\012");
+
+  if(Serial.find("Unlink"))  //rarely seems to find Unlink? :(
+  {
+    dbgSerial.println("Connection Closed Ok...");
   }
   else
   {
-    //ESPComm.println("connection close failure");
+    //Serial.println("connection close failure");
   }
 	
 	

		}
	}
	if(!connected){
		Serial.println("[### Failed to connect to WiFi ###]");
		testFailed();
	}
	
	digitalWrite(LED, HIGH);
	delay(1000);	
	
	Serial.println("[Set single connection mode]");
	ESPComm.print("AT+CIPMUX=0\015\012");
	
	if(ESPComm.find("OK")){
		Serial.println("[Module Responded OK]");
	}
	
	Serial.println("[Requesting IP]");
	ESPComm.print("AT+CIFSR\015\012");
	for(int i = 0; i < 500; ++i){
		if(ESPComm.available()){
			Serial.print((char) ESPComm.read());
		}
		delay(1);
	}

	
	delay(500);
	
	dbgSerial.println("[Prompting Reset]");
	Serial.print("AT+RST\015\012");
	
	if(Serial.find("OK")){
		dbgSerial.println("[Module Responded OK]");
	}
	else {
		testFailed();
	}
	
	dbgSerial.println("[Attempting to connect to WiFi]");
	bool connected = false;
	for (int i = 0; i < 5; i++){
		if(connectWiFi()){
