         && abs(vaporPressureLast - vaporPressureNow) <= 0.5) {
 
         Serial.print("Do not connect. No change. Time passed since on ");
-        Serial.println(millis() - startTime);
+        Serial.println(millis() - systemStart);
     
         systemState.roundsWithoutTransmission++;
         systemState.writeToRtc(0, sizeof(SystemState));
-    
-        sleepNowForServer(8, startTime);
+
+        // TODO "8" here
+        sleepNowForServer(8, millis() - systemStart);
       } else {
         Serial.print("Connect because of change ");
         Serial.print(abs(systemState.lastTransmittedTemperatature - t));


  //*/

  sleepNowForServer(serverSecondsUntilOff, connectionTime);
}

void loop() {

}

void sleepNowForServer(short serverSecondsUntilOff, unsigned long connectionTime)
{
  unsigned long sleepMillis = 1;
  // TODO also check the serverSecondsUntilOff in this if
  if (systemState.serverSleepSeconds*1000 > millis() - connectionTime) {
    sleepMillis = systemState.serverSleepSeconds * 1000 - (millis() - connectionTime);
    //Serial.print("Correcting current sleep time ");
    //Serial.println(sleepMillis);
    sleepMillis += (serverSecondsUntilOff - 8) * 1000; // shift wake up time to the start of the window
    //Serial.print("To current sleep time ");
    //Serial.println(sleepMillis);
    // TODO consider passed time until here for this
  }
  Serial.print("Sleeping ");
  Serial.println(sleepMillis);
  ESP.deepSleep(sleepMillis * 1000, RF_NO_CAL);
}


    Serial.print(".");
  }
  Serial.print("Wifi Connected took ");
  Serial.println(millis()-systemStart);

  WiFiClient client;
  if (!client.connect(IPAddress(192,168,122,1), 80)) {
