Index: /trunk/Ohana/src/opihi/pantasks/ControllerOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/ControllerOps.c	(revision 11445)
+++ /trunk/Ohana/src/opihi/pantasks/ControllerOps.c	(revision 11446)
@@ -333,5 +333,5 @@
 int ControllerCommand (char *cmd, char *response, IOBuffer *buffer) {
 
-  int i, status;
+  int i, j, status;
   char *line;
   struct timespec request, remain;
@@ -355,18 +355,23 @@
   line = NULL;
   status = -1;
-  for (i = 0; (i < CONTROLLER_TIMEOUT) && (status != 0) && (line == NULL); i++) {
-    status = ReadtoIOBuffer (buffer, stdout_cntl);
-    line = memstr (buffer[0].buffer, response, buffer[0].Nbuffer);
-    if (status == -1) nanosleep (&request, &remain);
-  }
-  if (status ==  0) {
-    StopController ();
-    gprint (GP_ERR, "controller is down\n");
-    return (FALSE);
+  for (j = 0; (status == -1) && (j < 10); j++) {
+      for (i = 0; (i < CONTROLLER_TIMEOUT) && (status != 0) && (line == NULL); i++) {
+	  status = ReadtoIOBuffer (buffer, stdout_cntl);
+	  line = memstr (buffer[0].buffer, response, buffer[0].Nbuffer);
+	  if (status == -1) nanosleep (&request, &remain);
+      }
+      if (status ==  0) {
+	  StopController ();
+	  gprint (GP_ERR, "controller is down\n");
+	  return (FALSE);
+      }
+      if (status == -1) {
+	  gprint (GP_ERR, "controller is not responding\n");
+	  gwrite (buffer[0].buffer, 1, buffer[0].Nbuffer, GP_ERR);
+      }
   }
   if (status == -1) {
-    gprint (GP_ERR, "controller is not responding\n");
-    gwrite (buffer[0].buffer, 1, buffer[0].Nbuffer, GP_ERR);
-    return (FALSE);
+      gprint (GP_ERR, "controller still not responding, giving up\n");
+      return (FALSE);
   }
 
