-/*
- *  This sketch sends data via HTTP GET requests to data.sparkfun.com service.
- *
- *  You need to get streamId and privateKey at data.sparkfun.com and paste them
- *  below. Or just customize this script to talk to other HTTP servers.
- *
- */
+#include <ESP8266WiFi.h>
+#include "DHT.h"
 
-#include <ESP8266WiFi.h>
+#define DHTTYPE DHT22
+#define DHTPIN  2
 
 //const char* ssid     = "Livebox-9e38";
 //const char* password = "EDE79F89D642E0117543DD28A6";
 
-const char* ssid     = "Mutualab Coworking 1";
-const char* password = "maintenantautravail";
+//const char* ssid     = "Mutualab Coworking 1";
+//const char* password = "maintenantautravail";
 
 //const char* ssid     = "DARKSIDE";
 //const char* password = "8353481dd463";
+
+const char* ssid     = "SEBHOME_SENSOR";
+const char* password = "key_sensor_my";
 
 const char* host = "www.google.fr";
 const char* streamId   = "....................";
 const char* privateKey = "....................";
 
+
+ 
 // server address:
-char server[] = "www.arduino.cc";
+//char server[] = "www.arduino.cc";
+char server[] = "192.168.61.1";
 //IPAddress server(64,131,82,241);
 
 WiFiClient client;
 
 unsigned long lastConnectionTime = 0;            // last time you connected to the server, in milliseconds
-const unsigned long postingInterval = 10L * 1000L; // delay between updates, in milliseconds
+const unsigned long postingInterval = 100L * 1000L; // delay between updates, in milliseconds
+
+float humidity, temp_f;
+unsigned long previousMillis = 0;        // will store last temp was read
+const long interval = 2000; 
+DHT dht(DHTPIN, DHTTYPE,11);
 
 void setup() {
   Serial.begin(115200);

  }
}

void loop() {
  // if there's incoming data from the net connection.
  // send it out the serial port.  This is for debugging
  // purposes only:
  while (client.available()) {
    char c = client.read();
    Serial.write(c);
  }

  // if ten seconds have passed since your last connection,
  // then connect again and send data:
  if (millis() - lastConnectionTime > postingInterval) {
    httpRequest();
  }

}

  client.stop();

  // if there's a successful connection:
  if (client.connect(server, 5000)) {
    Serial.println("connecting...");
    // send the HTTP PUT request:
    client.println("GET / HTTP/1.1");
    client.println("Host: 192.168.61.1");
    client.println("User-Agent: ArduinoWiFi/1.1");
    client.println("Connection: close");
    client.println();
