         sendmqttMsg(payload);
         sentMills = millis();
       }
-
       client.loop();
     }
     ArduinoOTA.handle();
   } else {
     wifi_connect();
-  }
-}
-
-void checkDisplayValue() {
-  if ( sleepmode != o_sleepmode )
-  {
-    displaysleepmode(sleepmode);
-    o_sleepmode = sleepmode;
-  }
-
-  HO = unihost + rsphost;
-  HL = unitot + rsptot;
-
-  if (( HO != OLD_HO ) || ( HL != OLD_HL))
-  {
-    displayHost(HO, HL);
-    OLD_HO = HO;
-    OLD_HL = HL;
-  }
-
-  if (( PW != OLD_PW ) && ( 0 <= PW < 10000 ))
-  {
-    displaypowerAvg(PW);
-    OLD_PW = PW;
-  }
-
-  if ( NW != OLD_NW )
-  {
-    displayNemoWeight(NW);
-    OLD_NW = NW;
-  }
-
-  if ( PIR != OLD_PIR )
-  {
-    displayPIR();
-    OLD_PIR = PIR;
-  }
-
-  if ((T1 != OLD_T1 ) || (T2 != OLD_T2 ) || (OT != OLD_OT) || ( H != OLD_H ))
-  {
-    displayTemperature();
-    OLD_T1 = T1;
-    OLD_T2 = T2;
-    OLD_OT = OT;
-    OLD_H = H;
-  }
-
-  if ( dustDensity != OLD_dustDensity )
-  {
-    displaydustDensity();
-    OLD_dustDensity = dustDensity ;
-  }
-
-  if (DEBUG_PRINT) {
-    Serial.print("=====> ");
-    Serial.print(T1);
-    Serial.print(" ===> ");
-    Serial.print(T2);
-    Serial.print(" ===> ");
-    Serial.print(OT);
-    Serial.print(" ===> ");
-    Serial.print(H);
-    Serial.print(" ===> ");
-    Serial.print(dustDensity);
-    Serial.print(" ===> ");
-    Serial.print(PIR);
-    Serial.print(" ===> ");
-    Serial.print(PW);
-    Serial.print(" ===> ");
-    Serial.print(HO);
-    Serial.print(" ===> ");
-    Serial.print(NW);
-    Serial.print(" ===> ");
-    Serial.println(moisture);
   }
 }
 


PubSubClient client(mqtt_server, 1883, callback, wifiClient);

float H  , T1 , T2 , OT , PW ;
int NW , PIR  , HO  , HL;

int unihost, rsphost, unitot, rsptot;

int sleepmode = LOW ;
int o_sleepmode = LOW ;

      } else {
        client.publish(hellotopic, "hello again 1 from ESP8266 s03");
      }

      if (DEBUG_PRINT) {
        Serial.println("");
      }

      client.loop();
      for (int i = 0; i < 6; ++i) {
        if (DEBUG_PRINT) {
          Serial.print("subscribe to : ");
          Serial.print(i);
          Serial.print(" : ");
        }
        client.subscribe(substopic[i]);
        client.loop();
        if (DEBUG_PRINT) {
          Serial.println(substopic[i]);
        }
      }

      if (DEBUG_PRINT) {
        Serial.println("sdone subscribe");
      }
      if (DEBUG_PRINT) {
        Serial.println("connected");
      }
