 	cmd += "\"";
 	cmd += "\015\012";
 	
-	Serial.println(cmd);
-	ESPComm.print(cmd);
-	
-	if(ESPComm.find("OK")) {
-		Serial.println("[Connected to WiFi]");
+	dbgSerial.println(cmd);
+	Serial.print(cmd);
+	
+	if(Serial.find("OK")) {
+		dbgSerial.println("[Connected to WiFi]");
 		return true;
 	}
 	else {
-		Serial.println("[# Failed to connect to Wifi #]\n");
+		dbgSerial.println("[# Failed to connect to Wifi #]\n");
 		return false;
 	}
 
 }
 
 void testFailed(){
-	Serial.println("[### Previous Test Failed ###]");
+	dbgSerial.println("[### Previous Test Failed ###]");
 	while(1);
 }

}

bool connectWiFi() {
	ESPComm.println("AT+CWMODE=1");
	
	String cmd = "AT+CWJAP=\"";
	cmd += SSID;

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