       iotName(ad[chan].name);
       iotAddValue(ad[chan].measured.analog,chbuf);
       iotNext();
+      sendingad=true;
     }
   }
 
   // counter build part
-  timeout=(ts-cntArr[0].last_send > measTimeout);
+  if (sendingad) // if already sending ad values, add counters a bit earlier to same packet
+    timeout=(ts-cntArr[0].last_send > measTimeout-300);
+  else
+    timeout=(ts-cntArr[0].last_send > measTimeout);
   float diff=abs(cntArr[0].measured.analog-cntArr[0].prevsnd.analog);
   bool changed;
   float limit;

    }
  }
  else if (timeout) {
    iotName(cntArr[0].name);
    iotAddValue(cntArr[0].measured.analog,chbuf);
    iotNext();
    cntPrepareForNext(0,ts);
  }

  int response;
  bool timeout=false;
  time_t ts;
  boolean sendingad=false;

  ts=now();
  buildTime(ts,chbuf);
