   return n;
 }
 
-void netsend_P(int n, PGM_P str) {
+boolean netsend_P(int n, PGM_P str) {
   //DEBUG_SERIAL.println("NSP");
   char buff[BUFFER_SIZE+1];
   strncpy_P(buff, str, BUFFER_SIZE);
   buff[BUFFER_SIZE]=0;
-  netsend(n, buff);
-}
-
-void netsend(int n, char* str) {
+  return netsend(n, buff);
+}
+
+boolean netsend(int n, char* str) {
   //DEBUG_SERIAL.println("NSLL");
+  int tries = 10;
+  int i = 0;
   boolean ok = false;
   while (!ok) {
     while(waitData(50)) {

  readLineLowLevel();
  waitData(100);
  readLine();
}

boolean sendPrep() {

        skip();
      }
    }
    if (i++ > tries) {
      // ABORT
      espStream->print("\r\nAT\r\n");
      while(waitData(100)) {
        readLine();
      }
      return false;
    }
  }
  espStream->print(str);
  DEBUG_SERIAL.println(str);
