 					} else if (code == 1) {
 						wait = true;
 					} else {
-						Serial.println(F("ERROR: invalid G command wait flag (bad number)"));
+						wifi.Send(chlID,F("ERROR: invalid G command wait flag (bad number)"));
 						return false;
 					}
 				} else {
-					Serial.println(F("ERROR: invalid G command wait flag (no number)"));
+					wifi.Send(chlID,F("ERROR: invalid G command wait flag (no number)"));
 					return false;
 				}
 			}
 			do {
 				// absorb spaces
-				for (; *endptr == ' ' && *endptr == '\t'; ++endptr);
+				for (; *endptr == ' ' || *endptr == '\t'; ++endptr);
+				wifi.Send(chlID,endptr);
 			} while (parseCommandGServo(&endptr, speedControl, wait));
 			break;
 		case 'F': case 'f':
 			code = strtoul(&buf[1], &endptr, 10);
 			if (endptr == &buf[1]) {
-				Serial.println(F("ERROR: missing F speed parameter"));
+				wifi.Send(chlID,F("ERROR: missing F speed parameter"));
 				return false;
 			}
 			if (code >= 0 && code <= 255) {
 				servoSpeed = code;
+				wifi.Send(chlID,F("OK"));
 				return true;
 			} else {
-				Serial.println(F("ERROR: invalid F speed parameter"));
+				wifi.Send(chlID,F("ERROR: invalid F speed parameter"));
 				return false;
 			}
 			break;
 		case 'M': case 'm':
 			code = strtoul(&buf[1], &endptr, 10);
 			if (endptr == &buf[1]) {
-				Serial.println(F("ERROR: missing M address parameter"));
+				wifi.Send(chlID,F("ERROR: missing M address parameter"));
 				return false;
 			}
 			switch (code) {
 				case 100:
-					Serial.println(F("OK"));
+					wifi.Send(chlID,F("OK"));
 					softwareReset();
 					break;
 				case 101:
-					Serial.println(freeRam(), DEC);
+					wifi.Send(chlID,String(freeRam(), DEC));
 					break;
 				case 112:
 					detachServos();
-					Serial.println(F("OK"));
+					wifi.Send(chlID,F("OK"));
 					break;
 				default:
-					Serial.println(F("ERROR: invalid M address parameter"));
+					wifi.Send(chlID,F("ERROR: invalid M address parameter"));
 					return false;
 			};
 			break;
 		default:
-			Serial.println(F("ERROR: invalid command"));
+			wifi.Send(chlID,F("ERROR: invalid command"));
 			return false;
 	};
 }
 
-const uint8_t MAX_CMD_LEN = 32;
+const uint8_t MAX_CMD_LEN = 128;
+char buf[MAX_CMD_LEN + 1], c;
+uint8_t len = 0;
 
 void loop() {
-	char buf[MAX_CMD_LEN + 1], c;
-	bool suspendStore = false;
-	uint8_t i = 0;
-
-	// read to newline
-	// ignore any line that has over 32 characters
-	if (Serial.available() > 0) {
-		c = Serial.read();
-		if (c == '\n' || c == '\r') {
-			if (suspendStore == false) {
-				buf[i] = '\0';
-				processCommand(buf);
-			} else {
-				suspendStore = false;
-			}
-			i = 0;
-		} else {
-			if (i < MAX_CMD_LEN) {
-				buf[i] = c;
-				++i;
-			} else {
-				Serial.println(F("ERROR: command line too long"));
-				suspendStore = true;
-			}
-		}
+	len = wifi.ReceiveMessage(buf);
+	if (len > 0) {
+		processCommand(buf);
 	}
 }

					moveServoH(defaultServoPos, servoSpeedLocal, false, false);
				}
			} else {
				Serial.println(F("ERROR: invalid servoH position"));
			}
			return true;
		default:
			Serial.println(F("ERROR: invalid servo identifier"));
			return false;
	};
	return false;

					moveServoL(defaultServoPos, servoSpeedLocal, false, false);
				}
			} else {
				wifi.Send(chlID,F("ERROR: invalid servoL position"));
			}
			return true;
		case 'R': case 'r':
