     if(packetStatus == ZSTATUS_HEADER)
     {
       lastStatus = ZSTATUS_CONTINUE;
+      errorCount=0;
+      timeouts=7;
       switch(buf[0])
       {
       case ZMOCHAR_ZRINIT:
+        debugPrintf("RCV: ZRINIT\n");
         if(atEOF) // nextFile would go here!
         {
           uint8_t byts[4]={0,0,0,0};
+          debugPrintf("SND: ZFIN\n");
           sendBinHeader(ZMOCHAR_ZFIN, byts);
         }
         else
         {
           uint8_t byts[4] ={0,0,0,ZMOPT_ZCBIN};
           sendBinHeader(ZMOCHAR_ZFILE, byts);
-          String packet="";
+          String rfileSzStr="";
+          rfileSzStr += rfile.size();
           String p=rfile.name();
           int x=p.lastIndexOf("/");
           if((x>=0)&&(x<p.length()-1))
-            packet += p.substring(x+1);
-          packet += '\0';
-          packet += rfile.size();
-          packet += " 0 777 0 0 00";
-          sendDataPacket(ZMOCHAR_ZCRCW, (uint8_t *)packet.c_str(), packet.length());
+            p = p.substring(x+1);
+          uint8_t *pbuf = (uint8_t *)malloc(p.length() + (rfileSzStr.length()*2) + 25);
+          uint16_t pbuflen=0;
+          for(int i=0;i<p.length();i++)
+            pbuf[pbuflen++] = p[i];
+          pbuf[pbuflen++] = 0;
+          for(int i=0;i<rfileSzStr.length();i++)
+            pbuf[pbuflen++] = rfileSzStr[i];
+          //String nums=" 0 0 0 1 ";
+          String nums=" 13207776736 100644";
+          for(int i=0;i<nums.length();i++)
+            pbuf[pbuflen++] = nums[i];
+          //for(int i=0;i<rfileSzStr.length();i++)
+          //  pbuf[pbuflen++] = rfileSzStr[i];
+          //pbuf[pbuflen++] = 0x18;
+          pbuf[pbuflen++] = 0;
+          pbuf[pbuflen++] = 'k';
+          debugPrintf("SND: ZCRCW of len %d\n",pbuflen);
+          sendDataPacket(ZMOCHAR_ZCRCW, pbuf, pbuflen);
+          free(pbuf);
         }
         break;
       case ZMOCHAR_ZRPOS:

        return ZSTATUS_INVALIDCHECKSUM;
    }
    *bufSize = *bufSize - (crcBits / 8);
debugPrintf("RA-SUCCESS! %d\n",*bufSize);
    crc = (crcBits == 16) ? 0 : 0xffffffff;
    if(dtyp==ZMOCHAR_ZCRCG)
      acceptsHeader = false;
    else
      acceptsHeader = true;
    break;
  }
  case ZACTION_ESCAPE:
debugPrintf("RESC TIMEOUT\n");
    return ZSTATUS_TIMEOUT;
  case ZACTION_CANCEL:
debugPrintf("RCANCEL\n");
    crc = (crcBits == 16) ? 0 : 0xffffffff;
    return ZSTATUS_CANCEL;
  }
}


        if(!atEOF)
        {
          uint32_t pos=(buf[1]) | ((uint32_t)buf[2] << 8) | ((uint32_t)buf[2] << 16) | ((uint32_t)buf[2] << 24);
          debugPrintf("RCV: ZRPOS %d==%d\n",pos,Foffset);
          if(pos!=Foffset)
          {
            rfile.seek(pos);
            Foffset = pos;
          }
        }
        else
          debugPrintf("RCV: ZRPOS ??\n");
      }
      //FALLTHROUGH OK!
      case ZMOCHAR_ZACK:
      {
        if(buf[0] == ZMOCHAR_ZACK)
          debugPrintf("RCV: ZACK\n");
        
        {
          uint8_t byts[4]={(Foffset & 0xff),((Foffset >> 8)&0xff),((Foffset >> 16)&0xff),((Foffset >> 24)&0xff)};
          debugPrintf("SND: ZDATA: %d\n",Foffset);
          sendBinHeader(ZMOCHAR_ZDATA, byts);
          uint8_t data[1024];
          int len = rfile.read(data, 1024);
