 
   lastReconnectAttempt = 0;
   reconnect();
+
+  sensors.begin();
+  if (!sensors.getAddress(insideThermometer, 0)) {
+    if (DEBUG_PRINT) {
+      Serial.println("going to sleep / sensor fail");
+    }
+    goingToSleep();
+  }
+  sensors.setResolution(insideThermometer, TEMPERATURE_PRECISION);
+  sensors.requestTemperatures();
+  tempCoutside = tempCinside = sensors.getTempC(insideThermometer);
+
+  digitalWrite(dsout, LOW);
+
+  if ( isnan(tempCinside) || isnan(tempCoutside) || isnan(vdd) ) {
+    if (DEBUG_PRINT) {
+      Serial.println("going to sleep / sensor value nan");
+    }
+    goingToSleep();
+  }
+
 }
 
 void loop(void)


String clientName;

  float tempCoutside ;
  float tempCinside ;

int vdd;



    int Attempt = 0;
    while (WiFi.status() != WL_CONNECTED) {
      if (DEBUG_PRINT) {
        Serial.print(". ");
        Serial.print(Attempt);
      }
      delay(100);
      Attempt++;
      if (Attempt == 150)
      {
        if (DEBUG_PRINT) {
          Serial.println("going to sleep / wifi con fail");
        }
        //goingToSleep();
        return;
      }
    }

