 {
   int j;
   for(j=0;!Serial1.available() && j<ms; j++) delay(1);
-  if(j==ms) return false;
+  if(j==ms) 
+  {
+    Serial.print("RedFly Timeout!");  
+    return false;
+  } 
   else      return true;
 }
 

  digitalWrite(redFlyReset,HIGH);
  delay(110);
  
  Serial1.begin(9600);
//  Serial1.begin(19200);
  
  //auto baud rate detection
  for(int i=4; i!=0; i--) //try 4 times
  {
    Serial1.write(0x1C); //transmit 0x1C
    if(!redFlyTimeout(200)) continue;
    if(Serial1.read() == 0x55) //wait for 0x55
    {
      Serial1.write(0x55); //transmit 0x55
      redFlyTimeout(100);
      redFlyFlush();
      //skip firmware upgrade question at power on
      Serial1.write('n');
      Serial1.write('\n');

      redFlyTimeout(1000);  // "Loading..."
      redFlyFlush();
      redFlyTimeout(2000);  // "Loaded"
      redFlyFlush();

  digitalWrite(63,LOW);  // CS
  pinMode(62,OUTPUT);
  digitalWrite(62,LOW); // RESET
  delay(10);
  digitalWrite(62,HIGH); // RESET
  delay(10);

  lcd.begin(20, 4);

