   cnt++;
   if ((cnt % AD_SAMPLECNT)==0) {
     sched.oscillate(13,150, LOW,2);
-    timeouts=chkAdTimeouts(adArr,chcnt, ts, false);
+    cntTimeouts=chkCntTimeouts(ts,false);
+    cntChanges=chkCntChanged();
+    timeouts=chkAdTimeouts(adArr,chcnt, ts, (cntTimeouts || cntChanges));
     changes=chkAdChange(adArr,chcnt);
-    // if there is something to send, advance other channel sends
+    // if there is something to send, advance other channel sends,
     // in case they are enough near with timeout. This way we get
-    // more values to send in same packet.
-    if (timeouts || changes)
+    // more values to send in same m2x packet.
+    if (timeouts || changes) {
+      if (!cntTimeouts)
+	chkCntTimeouts(ts,true);
       chkAdTimeouts(adArr,chcnt, ts, true);
+    }
     calcAdChannels(adArr,chcnt);
     calcKw();
     sendM2X(adArr,chcnt);


#define AD_SAMPLECNT 10
#define FLAGS_DATACHANGE 0x01

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// mx2 credentials are stored with a tcpip config connection

  char chbuf[22];
  char prevtime[22];
  int response;
  time_t ts;
  float val;

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