     delay(1000);
   }
   Serial.print(IP);
-  Serial.print("Port:");
+  Serial.print(F("Port:"));
   Serial.println(80);
 }
 
 void wifi_init(){
-  connect_wifi("AT",100);
-  connect_wifi("AT+CWMODE=3",100);
-  connect_wifi("AT+CWQAP",100);
-  connect_wifi("AT+RST",5000);
+  connect_wifi(F("AT"),100);
+  connect_wifi(F("AT+CWMODE=1"),100);
+  connect_wifi(F("AT+CWQAP"),100);
+  connect_wifi(F("AT+RST"),5000);
   check_ip(5000);
   if(!NO_IP){
-    Serial.println("Connecting Wifi...");
-    connect_wifi("AT+CWJAP=\"tlapse\",\"timelapse\"",7000); //username,password,waittime
+    Serial.println(F("Connecting Wifi..."));
+    connect_wifi("AT+CWJAP=\"tlapse\",\"Timelapse-2016\"",7000); //username,password,waittime
   } else {
   }
-  Serial.println("Wifi Connect");
-  get_ip();
-  connect_wifi("AT+CIPMUX=1",100);
-  connect_wifi("AT+CIPSERVER=1,80",100);
+  Serial.println(F("Wifi Connect"));
+  //get_ip();
+  connect_wifi(F("AT+CIPMUX=0"),100);
+  //connect_wifi(F("AT+CIPSERVER=1,80"),100);
 }
 
 
 void setup() {
   Serial.begin(115200);
-  wifi.begin(9600);
+  wifi.begin(115200);
   wifi_init();
 
   root["ID"] = ID;
-  root["stime"] = stime;
-  root["mtime"] = mtime;
-
-  /*
-  // VirtualWire Initialise the IO and ISR
-  vw_set_ptt_inverted(false); // Required for RF Link module
-  vw_set_tx_pin(txPin);
-  vw_setup(1200); //Bits pro Sekunde
-  */
+  root["sendtime"] = stime;
+  root["measuretime"] = mtime;
 
   // We need to attach the servo to the used pin number 
   servo1.attach(servo_pin);
-  
   
   pinMode(servo_pin, OUTPUT);
   digitalWrite(servo_pin, LOW);
   
   dht.setup(dhtPin);
-  //Serial.println(F("setup end"));
-
-}
-
-unsigned long task1, task2 = 0;
+}
+
+unsigned long task1, task2, task3 = 0;
 void loop() {
   unsigned long currmillis = millis();
 
-  //falls der Luefter laeuft pruefe alle 5 Sekunden die Werte
+  //falls der Luefter laeuft pruefe alle 15 Sekunden die Werte
   if (isopen) {
     if ((unsigned long)(currmillis - task2) >= 15000) {
       byte i;

    //TransmitData(get_temp(), get_hum());
    root["temperature"] = get_temp();
    root["Humidity"] = get_hum();
    
    task1 = millis();
  }

  // checke die Luftfeuchtigkeit und wenn zu niedrig schalte Luefter ein.

    while(wifi.available()>0){
      if(wifi.find("STAIP,")){
        delay(1000);
        Serial.println(F("IP Address;"));
        while(wifi.available()>0){
          ch=wifi.read();
          if(ch=='+')
