 // Periodic write to Serial to test RPi <-> Arduino
 void timerWrite()
 {
+  int prefix_len = 0;
   char write_buf[80];
+  int write_buf_len = 0;
 
   ++prefix_write_count;
-  sprintf(write_buf,"timerWrite %d\r",prefix_write_count);
-  fifoCmdBufEnqueueCommand(write_buf,sizeof(write_buf),output_buf,IO_BUF_SIZE);
+  sprintf(write_buf," %d\r",prefix_write_count);
+
+  prefix_len = strlen(prefix_string);
+  fifoCmdBufEnqueueCommand(prefix_string,prefix_len,output_buf,IO_BUF_SIZE);
+  write_buf_len = strlen(write_buf);
+  fifoCmdBufEnqueueCommand(write_buf,write_buf_len,output_buf,IO_BUF_SIZE);
 }
 
 // Remove the first character in output_buf and write to serial

  timer.run();
  writeOutput();
  readSerialInput();
  //doCommand();
}

// Look for a <cr> terminated string at the beginning of input_buf

SimpleTimer timer;

#define IO_BUF_SIZE 200
char cmd_buf[IO_BUF_SIZE];
char input_buf[IO_BUF_SIZE];
char output_buf[IO_BUF_SIZE];

